The CSS Minifier strips the parts of a stylesheet the browser never needed: comments, indentation, the line breaks between rules and the last semicolon in every block. What it will not do is rewrite your CSS. Rules are never merged, declarations are never reordered or deduplicated, and shorthands are left alone, because the order of declarations is load-bearing in real stylesheets and a `display:-webkit-box` sitting above a `display:flex` is a fallback rather than a duplicate. Optionally it also collapses six-digit hex colors to three, trims pointless zeros off numbers and drops rules whose body is empty. The Beautify mode runs the same tokenizer in reverse, so a minified file you inherited comes back with one declaration per line and one selector per line.
The guide behind this tool
Minifying CSS Saves Almost Nothing, Until You Delete the Comments
Three stylesheets measured as they would be served: stripping whitespace bought 3 to 5 percent, stripping comments bought up to 58. Why the gap is that wide.
Paste your CSS into the left pane, or drop a .css file onto it.
Leave it on Minify, or switch to Beautify if what you have is already compressed and you need to read it.
Adjust the checkboxes if you want license comments dropped, colors left untouched, or empty rules kept.
Read the size line above the output: original size, new size, and how much smaller it came out.
Copy the result, or download it as a .min.css file next to your original.
It is built so it cannot, by only ever removing whitespace and never adding any. Anything that had no space between it survives byte for byte, and the tokenizer treats strings, url() and comments as single units so a semicolon inside a data URI or a brace inside a content string is never read as structure. The spaces that genuinely carry meaning are kept: the one in `calc(100% - 20px)`, the one in `a :hover`, and the one in `screen and (min-width: 640px)`, all three of which are common ways a careless minifier corrupts a file.
30+ Free Tools
Explore all categories
From text processing to developer utilities, all free, all instant, no sign-up.