CSS minifier

Minify and improve the performance of CSS code.

  • Development
  • 100% free
  • No sign-up
  • Runs in your browser
CSS minifier

What is the css minifier?

The CSS minifier removes comments, line breaks and unnecessary spaces from your stylesheets, drops the last semicolon of each rule and shortens zero values, while keeping strings and selectors intact. It runs in your browser.

CSS is render blocking: the browser can't paint the page until the stylesheets are loaded. Smaller CSS files mean a faster first paint, better Core Web Vitals and a better experience on slow mobile connections.

How to use the css minifier

  1. 1Paste your CSS code.
  2. 2Press Minify to compress it.
  3. 3Copy the minified stylesheet.

Features

Comment removal

All /* comments */ are stripped.

Whitespace cleanup

Spaces, tabs and line breaks are reduced to the minimum.

Safe for strings

Quoted strings and selectors such as a :hover are preserved.

Private

Your code is processed locally in your browser.

Frequently asked questions

Will minifying break my CSS?

No, only characters that don't affect the styles are removed.

Should I also combine my CSS files?

With HTTP/2 combining matters less, but fewer, smaller files still help.

What about unused CSS?

Minification doesn't remove unused rules. Tools like PurgeCSS can do that as part of your build.

Can I minify inline styles?

Yes, or use the HTML minifier, which also minifies style tags.