CSS Minifier
A CSS minifier strips comments and collapses whitespace that doesn’t affect rendering, while carefully preserving whitespace that is meaningful — like the space in a descendant selector (`div p`) — and never touching content inside quoted strings. Removing that space would turn two separate selectors into the single invalid token `divp`, which is the main way a naive whitespace-stripping approach silently breaks a stylesheet instead of just shrinking it.
How it works
- Paste CSS in the box.
- Read the minified output and the byte-size reduction.
- Copy the result with the Copy result button.
Formula Strip comments; collapse whitespace except where semantically significant
Frequently asked questions
Will this break selectors like "div p" or "div > p"?
No — whitespace that changes selector meaning (the descendant combinator) is preserved. Only whitespace that CSS ignores is removed.
Does this touch content inside strings?
No — text inside quotes (e.g. content: "a b") is copied through untouched, spaces and all.
Does this rename classes or restructure rules?
No — this only removes comments and non-essential whitespace, not a structural optimizer.
Is this as aggressive as a build-tool minifier?
It is more conservative by design — safe, predictable output over maximum byte savings.
Is my CSS uploaded anywhere?
No. Minification runs entirely in your browser.