CSS Minifier

Minify CSS with the csso optimiser to make stylesheets smaller and faster.

What does a CSS minifier do?

A CSS minifier removes comments and whitespace from a stylesheet and rewrites values in their shortest form — for example #ff0000 to red and 0px to 0 — so the file downloads faster without changing how pages look.

Optimisations

  • Removes comments (optionally keeping /*! license */ comments) and whitespace.
  • Shortens colours, numbers and units.
  • With restructure: merges identical selectors and declarations for even smaller output.
  • Keeps meaningful spaces, such as in calc(100% - 10px) and descendant selectors like a :hover.

The tool uses csso, a CSS optimiser that parses CSS properly instead of using fragile search-and-replace, so the output is safe to deploy.

Minify your HTML and JavaScript too with the HTML Minifier and JavaScript Minifier.

Frequently asked questions

Is "restructure" safe?

Yes for normal stylesheets. If your CSS relies on rule order in unusual ways, turn it off for a plain minification.

How much smaller will my CSS be?

Typically 15–40 % smaller before gzip, depending on how much whitespace and how many comments it has.

Is my CSS uploaded?

No, minification happens in your browser.