undelo

CSS Minifier

Minify CSS by stripping comments and unnecessary whitespace

Minifies CSS by stripping comments and unnecessary whitespace, shrinking the file size while keeping the same styles.

How it works

The minifier removes /* comments */, collapses runs of whitespace, and strips spaces around structural characters like { } : ; ,. It's a regex-based, best-effort minifier rather than a full CSS parser, so it checks that curly braces are balanced first as a basic sanity check before processing.

Frequently asked questions

Does it validate that my CSS is fully correct?

Not fully — it checks that braces are balanced as a basic sanity check, but a real CSS parser it is not. CSS with other kinds of mistakes (a missing value, a broken selector) will still "minify" without complaint, since catching every possible error reliably needs a full parser.

Why did it reject my CSS with an error?

Only for unbalanced curly braces — an unequal number of { and } characters (counted outside of strings and comments) means something is structurally broken, so minifying it further isn't attempted.

Can minifying break a string value in my CSS, like content: "a b"?

It's possible — whitespace inside string literals like content: "a b" can get collapsed along with everything else, since this is a lightweight, regex-based minifier rather than one that fully understands CSS string syntax. This is a known, accepted trade-off for keeping it simple.

How much smaller does minifying actually make my CSS?

It depends heavily on how much whitespace and how many comments the original has — a heavily-formatted stylesheet with lots of comments can shrink noticeably, while already-compact CSS won't change much.

Is my CSS sent anywhere?

No — minification runs entirely in your browser using JavaScript string processing. Nothing is uploaded.