WebTools

Minify CSS

CSSO: it restructures and merges rules, not just strips spaces.

Minify CSS with CSSO, which does rather more than strip whitespace: it shortens colours, collapses shorthand properties and, if you let it, merges rules that share declarations.

Restructuring is where the real difference comes from, and it is also what deserves a second look: it changes the order of rules, and in stylesheets with a lot of crossing specificity that can change the outcome.

How to use it

  1. Paste the CSS.
  2. Decide whether to enable restructuring.
  3. Copy or download the .min.css.

Frequently asked questions

Is restructuring safe to enable?
It is in the vast majority of stylesheets, but check the page afterwards. If you have rules that depend on source order to beat each other, better to leave it off.
What are /*! */ comments?
The convention for a comment that must not be removed, such as a licence header. With the box ticked they survive and the rest go.
How much is usually saved?
Between 15 and 30 % on a hand-written stylesheet. If the server already gzips or brotlis, the end gain is more modest, but still real.

Related tools