CSS Minifier
- Paste your CSS into the input field.
- The minified result appears alongside the original size, the final size and the saving as a percentage.
- Copy the result into your production file.
- Comments in /* ... */ form, entirely.
- Whitespace around braces, colons, semicolons, commas and the >, + and ~ combinators.
- The last semicolon before each block closes, which is optional.
- Line breaks and indentation, collapsed into a single space.
The typical reduction lands between 15% and 30% of the text, depending on how much indentation and how many comments there were.
The real gain, though, is smaller than that number suggests: servers deliver CSS with gzip or brotli compression, and those algorithms already handle repeated whitespace very well. Once compressed, the difference between the minified and the original version is usually far more modest.
That does not make minification pointless — it reduces size on disk, browser parse time and transferred volume when no compression is in play. It just calibrates the expectation.
This is text-based minification, not a minifier with a full syntax parser. It does not reorder properties, remove duplicate rules, merge selectors or shorten colours.
One side effect worth knowing: multiple spaces inside a text value, as in content: "a b", are collapsed along with everything else. If your CSS depends on exact spacing inside quotes, check the result.
For a production pipeline, tools such as cssnano and lightningcss perform structural optimisations that textual minification cannot reach.
All processing happens in your browser; nothing is sent to a server.
Frequently asked questions
For ordinary CSS, no. The only case to watch is multiple spacing inside quoted values, which gets collapsed.
The additional gain is modest, because gzip already compresses repeated whitespace well. It still reduces size on disk and browser parse time.
Because it is optional on the last declaration of a block. Removing it saves one byte per rule and does not change behaviour.
Not exactly: comments and the original formatting are lost. You can reindent the result, but what was removed does not come back. Always keep the source version.
No. Minification happens in your browser.