Minify CSS
Strip whitespace and comments from CSS.
How to use Minify CSS
Strip whitespace and comments from CSS to shrink the file your visitors download. Minification keeps every rule and selector intact — it only removes characters a browser does not need.
- Paste your stylesheet into the Your text field.
- Press Run to strip comments and unnecessary whitespace.
- Copy the minified CSS into your production build.
When you actually reach for this
- You are shipping a stylesheet to production and want to shrink the payload by removing comments, whitespace, and redundant rules.
- You need a smaller CSS file to fit a size budget or speed up first paint.
Where this tool stops being accurate
- Minification can drop the last semicolon or merge selectors, which is safe for CSS but means you should keep the unminified source for edits.
- Aggressive merging may change source-map line mapping, so regenerate maps from the minified output if you debug live.
Frequently asked questions
What does Minify CSS do?
Strip whitespace and comments from CSS.
Is it safe to minify CSS that uses @media and :root variables?
Yes — proper minifiers preserve media queries and custom properties; only insignificant whitespace and comments are removed. Keep the original for maintenance.
My minified CSS looks broken in one browser — why?
Likely an unclosed brace or invalid rule in the source that the minifier collapsed; validate the original CSS rather than the minified result.
Should I minify CSS during development or only at deploy?
Keep the readable version in your editor and minify as a build step. Editing minified CSS is slow and error-prone, so treat the output as generated, not source.