CSS Minifier

Strip comments and whitespace from CSS and see exactly how many bytes you saved.

Original: 0 Chars
Result: 0 Chars
0% Space Saved
0 Bytes Removed

Paste a stylesheet, click minify, and get a compact version with the comments and needless whitespace removed — plus a readout of the original size, the new size, and exactly how many bytes and what percentage you saved. Smaller CSS means fewer bytes for browsers to download, which is one of the simplest wins for page speed. It all runs in your browser; nothing is uploaded.

What it actually removes

This is a lightweight, rule-based minifier. It strips /* … */ comments, collapses runs of whitespace to a single space, removes spaces around the structural characters { } ; : ,, and drops the redundant final semicolon before each closing brace. That covers the bulk of the wasted bytes in hand-written CSS while leaving your selectors, property names and values exactly as you wrote them.

What it does not do

It's a whitespace-and-comment compressor, not a full optimiser. It won't shorten hex colours (#ffffff#fff), merge duplicate selectors, remove unused rules, or reorder properties — the kind of transforms a build tool like cssnano performs. For a normal stylesheet the savings are still meaningful, but if you need aggressive optimisation as part of a build pipeline, use a dedicated tool. Keep your original, readable CSS in source control and minify a copy for production.

Frequently Asked Questions

How is the "saved" figure calculated?

It compares character counts: the bytes saved is the original length minus the minified length, and the percentage is that difference divided by the original length. Both update each time you minify.

Will minifying change how my CSS behaves?

No. It only removes comments and non-significant whitespace and the last semicolon before a brace — none of which affect how the CSS is applied. Your rules render identically.

Does it shorten colours or merge rules?

No. It is a whitespace and comment stripper, so it leaves selectors, values and colours untouched. For hex-shortening, rule merging or dead-code removal, use a build-time optimiser like cssnano.

Is my CSS uploaded to a server?

No. The minification runs entirely in your browser with JavaScript, so your stylesheet never leaves your device.