CSS Minifier & Beautifier
Minify CSS to shrink stylesheets, or beautify minified code back into readable form.
Loading tool…
How to use it
- Paste your stylesheet in the input box.
- Press Minify to strip comments, collapse whitespace and remove redundant semicolons — or Beautify to re-indent minified CSS.
- The character count before and after shows the savings.
- Copy the result directly from the output box.
About this tool
Removes comments, redundant whitespace and the final semicolon in a rule block, and can optionally compress colors. The beautify mode re-indents any stylesheet into a consistent, readable layout. Processing is regex-based on the client, which is safe for CSS and keeps the tool dependency-free.
Your input never leaves the browser: this tool works entirely offline once the page has loaded.
Frequently asked questions
Is regex-based minification safe for CSS?
For CSS, comment/whitespace stripping at this level is safe because the language has no eval-like constructs. The tool is string-aware, so content inside quoted strings is left untouched.
Are minified styles byte-for-byte optimal?
No — colors are not shortened (except !important spacing) and vendor prefixes are preserved as written. For maximum compression, run the output through your build pipeline as well.