🎨

CSS Minifier

Compress CSS by stripping comments, whitespace, and redundant code to speed up your website.

OPTIONS

Why Minify CSS?

CSS files can grow large with comments, indentation, and verbose property values. Minification strips all of this out, producing functionally identical CSS that loads faster. For large stylesheets (50KB+), minification can shave hundreds of milliseconds off rendering time, which directly impacts Largest Contentful Paint (LCP) scores.

CSS Minification Techniques

Comment removal deletes all /* … */ blocks. Whitespace collapse removes spaces around selectors, braces, colons, and semicolons. Last-semicolon removal drops the final ; in each rule block. Hex shortening converts #ffffff to #fff and #aabbcc to #abc where possible. Leading zero removal converts 0.5em to .5em.

Will minification break my CSS?
No β€” all transformations are semantically equivalent. The browser interprets minified CSS identically to the original.
Should I keep the original source?
Yes β€” always keep your readable source files and use minified versions only for production deployment.
How much file size can I save?
Typically 10–30% reduction from minification alone. Combined with GZIP, you can achieve 70–80% transfer savings.
Does it handle CSS variables and media queries?
Yes β€” all valid CSS syntax including custom properties, media queries, animations, and pseudo-selectors is handled correctly.

Related Tools