CSS Minifier
Minify CSS to reduce file size and improve page load speed. Free, instant.
What Is CSS Minification?
CSS minification removes all characters that the browser ignores — comments, whitespace, newlines and redundant semicolons — without changing how any of your styles render. The result is a smaller file that transfers faster over the network, reducing page load time and improving Core Web Vitals scores. A typical CSS file shrinks by 20–40% through minification alone; combined with Gzip or Brotli compression by your web server, total bandwidth savings often exceed 80%.
What Does CSS Minification Remove?
- CSS comments — everything between
/*and*/is stripped. - Unnecessary whitespace — spaces, tabs and newlines between rules are collapsed or removed.
- Spaces around punctuation — spaces around
:,;,{,}, and,are eliminated. - Trailing semicolons — the last semicolon before a closing brace is optional and removed.
CSS Minification vs Gzip Compression
Minification and server-side compression are complementary, not interchangeable. Minification reduces the raw character count by 20–40%. Your web server (Apache, Nginx, Cloudflare) then applies Gzip or Brotli compression to the minified file, compressing the result by a further 60–80% over the wire. Use both for the smallest possible transfer size.
Minify vs Beautify
Minify for production deployment. Beautify (expand) when you need to read or edit compressed CSS. Use the CSS Beautifier to convert minified CSS back into readable form for debugging.
How Much Does CSS Minification Actually Save?
| File size | After minification | After minification + Gzip |
|---|---|---|
| 10 KB | ~7 KB (30% smaller) | ~2.5 KB (75% smaller) |
| 50 KB | ~33 KB (34% smaller) | ~10 KB (80% smaller) |
| 200 KB | ~130 KB (35% smaller) | ~38 KB (81% smaller) |
For most projects, enabling Gzip or Brotli on the server delivers far greater savings than minification alone. Minification is still worth doing — it reduces the size the server has to compress, and it eliminates the overhead of decompressing comments and whitespace on the client. Together, the two techniques can cut a 200 KB stylesheet to under 40 KB over the wire.