Skip to content
toolgrid

No tool found. Try another word.

CSS Minifier

Minify CSS with CSSO: removes whitespace and comments, shortens colors and values, and merges duplicate rules. See the size saving instantly.

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the CSS Minifier

  1. 1 Paste your CSS.
  2. 2 Choose whether to restructure rules and keep license comments.
  3. 3 Copy the minified CSS or download it as styles.min.css.

About the CSS Minifier

Minified CSS loads faster: every byte counts for the first render of a page, because CSS blocks rendering until it has been downloaded. The minifier uses CSSO (CSS Optimizer), a minifier that does more than remove whitespace.

Besides removing spaces, line breaks and comments, CSSO rewrites values in their shortest form (#ffffff becomes #fff, 0px becomes 0, font-weight: normal becomes 400) and, with restructuring on, merges rules with the same selectors or declarations and removes overridden properties.

Restructuring is safe for normal stylesheets, but in rare cases where the order of rules matters in unusual ways you can switch it off. Comments that start with /*! are typically license notices; keep them if the license requires it. Always test the minified stylesheet before deploying.

Frequently asked questions

Is the minified CSS equivalent to the original?

Yes, CSSO only makes changes that keep the meaning of the stylesheet. Check the result in your browser, especially with restructuring on.

How much smaller does CSS get?

Usually 20–40% for handwritten CSS. With gzip or Brotli on top, the download is a fraction of the original.

What does restructuring do?

It merges rules that share selectors or declarations and drops declarations that are overridden later, saving extra bytes beyond removing whitespace.

Can I minify Sass or Less?

Compile it to CSS first; the minifier expects plain CSS.