One-Click Minify
Compress your CSS in a moment. Whitespace, line breaks and comments are removed without changing your rules.
Minify CSS online to cut file size, remove whitespace and comments, and get a lighter stylesheet in one click. Fast, free and no signup.
Everything runs in your browser. Your CSS is never uploaded or stored.
Paste your code into the editor or upload a .css file from your device.
The tool removes whitespace and comments and shows how much space you saved.
Copy the result or download it as a ready-to-use minified CSS file.
Looking for a free CSS minifier? Paste your stylesheet or upload a CSS file, click one button and get a smaller version that is ready for production. The tool removes extra spaces, line breaks and ordinary comments, keeps your quoted strings and license comments safe, and shows the original size, the minified size and the percentage you saved. There is nothing to install and no account to create, and your code never leaves your browser. Whether you maintain a small blog theme or a large web application, a smaller stylesheet means less data for every visitor to download.
This online CSS compressor was designed for people who want a quick result without setting up Node, a bundler or a build pipeline. Use it to minify CSS for a WordPress child theme, a Shopify store, a landing page or a client project, and download the result as a .min.css file. It works on Windows, Mac, Linux, Android and iPhone, so you can compress CSS wherever you are working.
Compress your CSS in a moment. Whitespace, line breaks and comments are removed without changing your rules.
See the original size, the minified size and the space saved, so you know exactly what the optimization achieved.
The minifier runs locally in your browser with JavaScript. Your code and files are not uploaded to any server.
CSS minification is the process of reducing the size of a stylesheet by removing characters that browsers do not need to read it. These include spaces, tabs, line breaks, indentation and comments. The meaning of the stylesheet stays the same, only the formatting is stripped. Developers write readable CSS with indentation and notes, and then ship a minified copy to the live website. You may also hear the same job called CSS compression, CSS compressing or CSS optimization.
Smaller CSS files can reduce the amount of data a browser must download before it can draw the page, which may help loading speed, especially on slow mobile connections. Page speed is part of the overall experience that search engines look at, so minifying CSS is a common step in technical SEO and performance work.
This is what the minifier does to a small piece of CSS. The rules are the same. Only the formatting is removed.
/* Button styles */
.button {
display: inline-block;
padding: 12px 24px;
color: #ffffff;
}
.button:hover {
background-color: #1d4ed8;
}
.button{display:inline-block;padding:12px 24px;color:#ffffff}.button:hover{background-color:#1d4ed8}
The table shows how each part of your stylesheet is handled. Everything that only exists for human readers is removed. Everything that affects the result or has a legal purpose is kept.
| Part of the CSS | What happens | Result |
|---|---|---|
| Spaces, tabs and line breaks | Removed or reduced to a single space where one is needed | Smaller file |
| Ordinary comments /* ... */ | Removed | Smaller file |
| Space around { } ; , > ~ | Removed | Smaller file |
| Space after a colon | Removed | color: red becomes color:red |
| Last semicolon in a block | Removed | a{color:red;} becomes a{color:red} |
| Quoted strings | Kept exactly as written | content and font names stay safe |
| License comments /*! ... */ | Kept | Copyright notices are not lost |
| Spaces between selectors and values | Kept where they matter | .a .b and 1px solid #ccc stay correct |
These words are often mixed up, but they describe three different things. Minification rewrites the file itself so it contains fewer characters. Compression, such as Gzip or Brotli, is applied by your web server when the file is sent and is undone by the browser. Beautifying is the opposite of minifying: a CSS beautifier adds indentation and line breaks so people can read the code again.
| Technique | Where it happens | What it changes |
|---|---|---|
| Minification | Before you upload the file (this tool) | The text of the file: fewer characters, same rules. |
| Gzip or Brotli compression | On your web server, while the file is sent | The bytes on the wire. The browser unpacks them automatically. |
| Beautifying | In your editor or an online tool | Adds whitespace so the code is readable for people. |
A minified file is smaller before compression and usually smaller after it too. If your site only uses one of the two techniques, add the other for the best result.
The saving depends on how your stylesheet is written. Code with deep indentation, long comments and generous blank lines shrinks the most. A file that was already tight, or one that is mostly long data URIs, shrinks less. Hand-written CSS often drops by a noticeable share, and the size comparison under the output shows the exact number of bytes and the percentage for your file. Treat minification as one part of CSS performance. Deleting rules that no page uses, avoiding huge frameworks for small sites and loading only the CSS a page needs can save even more.
Minification is designed to keep the behavior of your stylesheet, and this tool takes care to keep quoted strings, license comments and the spaces that selectors and values need. Even so, no automatic text tool can promise perfect output for every unusual or browser-specific piece of CSS. Always test the result on your website before you use it in production.
The workflow is almost the same on every platform. Keep your readable stylesheet as the source file, paste it into the minifier, download the .min.css result and upload it next to the original. In WordPress, enqueue the minified file in your child theme with a version number so browsers fetch the new copy after each change. In Shopify, add the file to the theme assets and point the stylesheet link to it. On a static site, replace the link in your HTML head. If your host or plugin already minifies CSS automatically, check the page source first so you do not process the same file twice.
Minifying CSS is not a magic ranking switch, but it supports the things search engines care about. A lighter stylesheet helps pages render sooner, which can improve Largest Contentful Paint and the feel of the page on mobile networks. Better loading metrics make a good experience more likely, and a good experience supports engagement and conversions. Treat CSS minification as one item on a technical SEO checklist, next to image compression, caching, a CDN and removing unused scripts. Tools such as PageSpeed Insights and Lighthouse often list unminified CSS as an opportunity, and running your file through this tool is a quick way to clear that warning.
| Task | Why it matters | Effort |
|---|---|---|
| Minify CSS | Fewer bytes before the page can render | Very low, one click here |
| Enable Gzip or Brotli | Smaller transfer on top of minification | Low, a server setting |
| Remove unused CSS | Less code to download and parse | Medium |
| Use caching and a CDN | Repeat visits and distant visitors load faster | Low to medium |
| Inline critical CSS | Faster first paint for the visible part of the page | Medium to high |
Never minify CSS by deleting characters manually in your editor. It is easy to remove a space that a selector needs, such as the one in .menu .item, or to break a value like margin: 0 auto. A tool understands which spaces matter and which do not, keeps strings and license comments intact and gives the same result every time. Let the tool do the repetitive work and keep your attention on the design.
This CSS minifier is free to use as often as you like, with no signup and no watermark. It runs entirely in your browser, so the code you paste and the files you choose are never sent to our server. Minify your CSS, copy it or download it, and use it on your website.
Find answers to common questions about minifying, compressing and optimizing CSS.
A CSS minifier is a tool that makes a stylesheet smaller by removing characters the browser does not need, such as spaces, line breaks, indentation and ordinary comments. The rules and their meaning stay the same, only the formatting is removed.
Paste your CSS into the left editor or upload a .css file, then click Minify CSS. The minified code appears on the right with the original size, the new size and the percentage saved. You can then copy it or download it as a .min.css file.
It should not. Minification only removes formatting, so the design stays the same. Because no automatic tool can promise perfect results for every unusual stylesheet, test the minified file on your site before you replace the live CSS, and keep a backup of the original.
A smaller file means fewer bytes to download, which helps most on slow connections and on pages with large stylesheets. The real gain depends on your hosting, caching and compression, such as Gzip or Brotli, which work well together with minification.
It removes ordinary comments. Comments that start with /*! are kept on purpose, because they usually hold license or copyright notices that you may need to keep in your file.
No. The tool works fully in your browser with JavaScript. The code you paste and the file you choose are not sent to our server and are not stored.
Yes. It is free to use as many times as you like, with no signup, no watermark and no file limit other than a 5 MB size limit per uploaded file.
Minify and compress CSS, make code readable again with the CSS beautifier, tidy stylesheets with the CSS formatter or format and validate JSON. Explore free developer tools to format, convert and debug your code in one place.
Explore All Developer Tools →