CSS Minifier
Shrink CSS for production.
CSS Minifier at a glance
CSS Minifier is a free online developer tool you can use right now to shrink CSS for production โ no account, no install and no usage limit. It runs entirely inside your browser, so whatever you enter stays on your own device.
- Price
- Free โ no trial, no paid tier, no watermark
- Sign-up
- Not required
- Where it runs
- In your browser โ nothing is uploaded to a server
- Works on
- Chrome, Safari, Firefox and Edge โ desktop, tablet and phone
- Category
- Developer Tools
About CSS Minifier
Remove comments, redundant whitespace and unnecessary semicolons from a stylesheet to reduce the number of bytes shipped to a browser.
The saving is real but usually smaller than expected once compression is accounted for. Minification typically removes 15-30% of a stylesheet's raw size, but servers already gzip or brotli CSS in transit, and those algorithms are very effective on the repetitive whitespace minification strips. On an already-compressed response, minification often adds only a few percent more. It is worth doing โ it costs nothing โ but it is not where a slow page is losing its time.
The larger win in CSS is almost always removing rules nobody uses. Most sites ship stylesheets where a substantial fraction of the rules match no element on any page, usually inherited from a framework or a previous design. Minifying dead CSS makes dead CSS smaller. Removing it makes the file smaller and the browser's style calculation faster.
Keep your source readable and minify as a build step. Editing minified CSS directly is miserable and the mistakes are hard to spot, which is exactly why the practice is to minify on the way out rather than to work in minified files.
How to use CSS Minifier
- Paste your CSS into the box.
- Comments and unnecessary whitespace are stripped automatically.
- Copy the minified output into your production build.
Frequently asked questions
How much smaller will my CSS get?
Typically 15-30% of raw size, depending on how heavily commented and formatted the source is. After gzip or brotli โ which your server almost certainly applies โ the additional saving is usually only a few percent, since compression already handles repetitive whitespace well.
Will minifying break my styles?
It should not. Only comments and whitespace that CSS ignores are removed. The one thing to watch is a CSS hack that deliberately relies on unusual whitespace or malformed syntax to target an old browser โ those can be affected.
Should I minify by hand or in my build?
In your build. Keep the source readable and minify on the way out. Editing minified CSS directly is error-prone and unnecessary.
What helps more than minifying?
Removing rules nothing uses. Most stylesheets carry a large fraction of dead rules inherited from frameworks or old designs. That reduces both the file size and the browser's style-matching work, which minification cannot touch.