CSS Minifier / Beautifier

Compress CSS into a single compact line, or reformat it back into readable, indented code.

css-minifier.js

Paste any CSS and either minify it — stripping comments, whitespace and line breaks to shrink file size for production — or beautify it back into clean, indented, readable formatting for editing. Both directions run instantly using simple text-processing rules directly in your browser.

How to use it

  1. Paste your CSS into the input box.
  2. Click Minify to compress it, or Beautify to reformat it.
  3. Review the result in the box.
  4. Copy the result for use in your project.

Frequently asked questions

Does minifying remove comments?

Yes, all /* ... */ comments are stripped out during minification to save space.

Will beautifying fix broken CSS syntax?

No — this reformats spacing and indentation but doesn't validate or fix invalid CSS properties or selectors.

How much size reduction can I expect from minifying?

It varies by how much whitespace and commenting the original had, but 10–30% size reduction is common for typically-formatted CSS.