What gets removed
- Comments, except license comments that start with /*! when you choose to keep them.
- Spaces, tabs and line breaks around braces, colons, semicolons, commas and combinators.
- The last semicolon in each rule.
- Empty rules that do nothing.
Safe size savings
- Shorter colors: #ffffff becomes #fff and #aabbcc becomes #abc, when each pair of digits repeats.
- Zero without a unit: 0px becomes 0. The units that cannot be removed are left alone, such as % and the time and angle units: 0s, 0deg and 0% keep their unit.
- Leading zeros: 0.5em becomes .5em.
- Trailing zeros: 1.50 becomes 1.5 and 2.0 becomes 2.
The unit and number changes are not applied inside calc(), min(), max(), clamp() and var(), where a unitless zero can make a value invalid. Custom property values (--name) and unicode-range are copied as they are.
Size and gzip
The results show the size before and after, and the size when compressed with gzip, which is what most servers send. Minifying and gzip work together: gzip shrinks repeated text, and minifying removes the text that gzip cannot, so the saving on the wire is smaller than on disk, but it is still worth having.
Where the bytes go
Under the result, a table shows how many bytes each step saved: whitespace, comments, semicolons and empty rules, and shorter numbers and colors. It shows which step matters for your file. For more control, with three levels and extra savings such as merging neighboring rules, use the CSS compressor.
Good to know
- Keep your readable source file, and minify a copy. A minified file is hard to edit.
- Very old browser hacks, such as *zoom and _height, are left in place, because they are valid declarations to the parser.
- This tool does not merge rules or rename anything, so it never changes how the cascade works.
- For a whole site, a build tool can minify automatically. The CSS minification guide explains how.
For the full explanation, read the CSS minification guide. To read minified CSS, use the CSS beautifier. To tidy code you are writing, use the CSS formatter. You can also minify other files with the JavaScript minifier and the HTML minifier.