100% Free · No Signup · No Ads

CSS Minifier

Minify CSS without ever reordering your selectors — with a live before/after rendered preview and a real gzip-compressed size estimate.

The preview applies your CSS to a small sample page so you can confirm styling still looks right.

Minified output



  

Everything in one tool

🔒

Never reorders your rules

Selectors and declarations stay in exactly the order you wrote them, so cascade and specificity behavior is never affected.

👁️

Live rendered preview

See your CSS applied to a sample page before and after minifying, so you can confirm nothing visually broke.

📦

Real gzip size estimate

Get an actual gzip-compressed size using your browser's native compression engine, not just a raw byte count.

🧵

Safe with strings & url()

Content inside strings and url() — file paths, font names, content values — is parsed and left completely untouched.

🎛️

Handles custom properties

CSS variables are minified for whitespace and comments, but zero-unit stripping is safely skipped for their values.

🎚️

Safe presets

Start with Safe or go Aggressive — no need to research every option before you get a usable result.

How this compares

Some popular CSS minifiers reorder rules to squeeze out extra bytes — which can quietly change how your cascade behaves.

FeatureSEOTriggersToptalCleanCSS
Whitespace, comment & syntax minification
Never reorders selectors or declarationsDocumented cascade-order bugCan restructure rules
Live before/after rendered preview
Real gzip-compressed size estimate
Fetch directly from a live URL
No ads, no account

Need to minify the HTML too? Try the HTML Minifier.

What gets minified — and what's kept intentionally safe

TransformationWhy it's safe
Whitespace collapsingRuns of whitespace are collapsed, but the single space used as a descendant combinator (like div p) is always preserved — only removed where it's purely cosmetic.
Comment removalOrdinary comments are stripped; license comments starting with /*! can be preserved with a dedicated option.
Hex color shortening#ffffff becomes #fff only when each channel pair is identical — otherwise the color is left as written.
Selector & rule orderNever changed. Reordering can flip which rule wins when two selectors share specificity — this tool avoids that risk entirely.

Frequently asked questions

It can if the minifier reorders your rules, since CSS cascade order and specificity depend on where a rule appears. This tool never reorders selectors or declarations — it only removes whitespace, comments, and redundant characters, so the cascade behaves exactly the same as your original file.

Yes. Custom properties (values starting with --) are minified for whitespace and comments like everything else, but zero-unit stripping is skipped for their values, since a custom property might be consumed elsewhere expecting a specific unit.

No. Content inside strings and url() is parsed and passed through untouched — whitespace collapsing and other transforms are never applied inside them, so file paths, font names, and content strings stay exactly as written.

Yes. Gzip compresses repetitive whitespace efficiently, but minification still reduces the amount of CSS the browser has to parse, and it typically saves additional bytes on top of compression from things like removed comments and shortened hex colors.

Minification removes unnecessary characters (whitespace, comments, redundant syntax) without changing the meaning or order of any rule. Optimization tools that merge or reorder selectors can shrink files further, but they carry real risk of altering cascade behavior if two rules with the same specificity get reordered.