Skip to content

Code tool

CSS Minifier and Beautifier

Minify CSS for production, or beautify a minified stylesheet so you can read it again.

Runs entirely in your browser. Nothing you paste is uploaded.

Paste some CSS to get started.

CSS Minifier by YegappanFree tool. Open the full page for the guide.

How to use the CSS Minifier

  1. Paste your CSS into the left box.
  2. Select Minify to compress it, or Beautify to add line breaks and indentation.
  3. Check how much was saved, then copy the result or download it as a .css file.

What a CSS minifier removes, and what it keeps

A CSS minifier compresses a stylesheet by removing everything a browser does not need. A CSS beautifier does the opposite and turns minified CSS back to normal, readable code. This online tool does both.

Minifying deletes the parts of a stylesheet that only people need: comments, line breaks, indentation, spaces around braces and colons, and the final semicolon in each rule. Browsers read the result exactly the same way, and a smaller file reaches them sooner.

This minifier is deliberately conservative. It does not rename, merge or reorder rules, and it leaves values alone, so calc(100% - 2rem), custom properties, quoted strings and url() data URIs come through intact. It is tested against real stylesheets to confirm that browsers read the minified result as exactly the same rules.

Smaller CSS helps Core Web Vitals because stylesheets block rendering. For the biggest gains, combine minification with compression on your server (Brotli or gzip) and remove rules your pages never use.

Common questions

How do I minify CSS online?

Paste the stylesheet and choose Minify. Copy the compressed CSS and use it in place of the original file.

Will minifying change how my site looks?

No. Only whitespace and comments are removed, so browsers apply exactly the same rules.

How much smaller will my CSS get?

Hand-written CSS usually shrinks by 15 to 30 percent. Heavily commented files save more.

Can I get readable CSS back from a minified file?

Yes. Paste it and choose Beautify. Comments that were removed cannot be restored.

Is my CSS uploaded?

No. Everything runs locally in your browser.

Guides for the CSS Minifier

Related tools