CSS Minifier
Minify CSS by removing comments, whitespace, and redundant rules.
Frequently Asked Questions
What exactly does the minifier remove?
It removes block comments, collapses whitespace, strips spaces around tokens like `{ } : ; , >`, and removes the final semicolon before `}`. It also tries to strip `//` line comments when they are not part of a protocol-style value.
Does it validate that my CSS is syntactically correct first?
No. This is a regex-based minifier, not a full CSS parser, so invalid CSS can still be transformed into different-looking invalid CSS.
Why didn't the savings badge improve very much?
The stats compare input bytes with output bytes. If your CSS was already compact, there may not be much left for this minifier to remove.
Can regex minification break edge cases?
Potentially, yes. Because it is not AST-based, you should sanity-check unusual constructs or comment-like text after minifying.
Can I still pretty-print from the same page?
Yes. The shared component includes both Format and Minify buttons, so you can run either action from the same UI.