Quick Answer
A CSS minifier removes comments and unnecessary whitespace from stylesheets, producing a smaller file that renders identically. This tool preserves every value — colors, strings, custom properties — and shows your exact byte savings live.
What This Tool Does
Comments and whitespace are stripped while strings, custom properties and values are preserved exactly. The tool is conservative about where spaces are required (for example between the parts of a value like 1rem auto), so the output behaves identically. Optional optimizations — shortening hex colors, shrinking zero units, removing the last semicolon and dropping empty rules — squeeze out even more bytes.
Key Features
- Value-safe —
calc(), custom properties and quoted strings survive intact. - Comment removal — including multiline blocks.
- Hex shortening —
#ffffffbecomes#fffwhen the pairs repeat. - Unit optimization —
0pxbecomes0,0.5embecomes.5em. - Cleanup options — remove the last semicolon per rule and drop empty rules.
- Live savings + gzip estimate — input, output, percentage, and an approximate gzipped size.
- Upload file or load from URL — minify existing stylesheets directly.
- Copy or download the minified stylesheet.
How to Use the CSS Minifier
- Paste your CSS into the input box, or use Upload File / Load from URL.
- Open Show advanced options and tick Shorten hex colors, Optimize units, Remove last semicolon or Remove empty rules for extra savings.
- Read the minified output and the size stats, including the gzip estimate.
- Copy it or download
styles.min.css.
Use Cases
- Shrinking a framework’s CSS for a quick inline style block.
- Reducing payload for email templates or embedded widgets.
- Measuring how much whitespace is costing you.
Tips
- Pair with the CSS Beautifier when you need the readable version back.
- For production, let your build tool minify automatically; use this for quick edits.
Privacy
Minification runs locally — your stylesheet never leaves the browser.
Conclusion
Trim the fat from your CSS in seconds, see exactly what you saved, and ship it.