CSS Minifier Online

Compress CSS stylesheets to reduce file weight, decrease page load times, and improve Core Web Vitals. Strip comments, eliminate redundant spaces, remove trailing semicolons, and optimize zero-value units with instant byte savings calculations.

Compress CSS stylesheets for faster page delivery

Paste your stylesheet into the input area, select whether to remove all comments or preserve license headers, and select Minify. The optimizer strips unnecessary whitespace around braces, colons, and semicolons, outputting dense CSS code.

Zero-unit optimization and syntax compression

Measurements like 0px, 0em, and 0% are collapsed to simple 0 values where permitted by CSS specifications. Trailing semicolons before closing curly brackets are omitted to save additional bytes across large stylesheets.

Preserving CSS variables and media queries

The minifier respects modern CSS features including CSS custom properties, media queries, flexbox, and grid declarations. Values within calc expressions and quoted strings are preserved without syntax corruption.

Measuring compression efficiency locally

Every minification calculates the original byte length, the minified byte length, and the percentage reduction achieved. Processing runs locally without uploading your code.

Technical references: CSS Reference · W3C CSS Specifications

CSS Minifier FAQs

Smaller CSS files require less bandwidth, download faster over mobile networks, and allow browsers to parse and render critical CSS styles sooner.
Yes. Select the preserve license comments option to retain comments beginning with an exclamation mark while removing ordinary developer comments.
No. Minification alters only non-semantic whitespace and formatting. Property rules, cascade priority, and CSS specificity remain unchanged.
Yes. Variables defined with double hyphens and accessed through var() functions are preserved without disruption.
Minified CSS is designed for production delivery rather than manual editing. Always keep your formatted source file in your development repository.
No. All minification executes locally in your browser thread, keeping proprietary styles private.
Media query declarations like @media screen and (max-width: 768px) have their internal rule sets compressed while preserving query conditions.
In CSS syntax, the final declaration before a closing curly brace does not require a terminating semicolon. Omitting it saves one byte per rule block.
You can minify stylesheets up to 100,000 characters smoothly in a single operation.