Minify CSS Online — Safe, Conservative, In Your Browser

Strips comments and whitespace without ever touching what matters — calc() and strings survive.

🔒 Runs in your browser — files never uploaded ⚡ No signup 💯 Free

Minify CSS by removing comments, collapsing whitespace and dropping redundant semicolons — conservatively. Strings and url(…) values are preserved byte-for-byte, calc() expressions keep the spaces their operators require, and /*! license comments survive, as they legally should.

Runs instantly in your browser, nothing uploaded.

How to use CSS Minifier

  1. Paste your CSS.
  2. Click Minify.
  3. Check the saving — typically 15–40% depending on comment and indentation habits.
  4. Copy or download as a .css file.

Why "conservative" is a feature

Aggressive CSS minifiers rewrite values — shortening colours, merging shorthands, reordering rules — and each rewrite is a chance to change rendering in an edge case. This one only removes what provably cannot matter: comments, inter-token whitespace, the final semicolon before a closing brace. Your stylesheet's behaviour is untouched by construction.

The concrete case that bites people: calc(100% - 20px) requires the spaces around its minus sign — remove them and the expression is invalid. Minifiers that treat CSS as text get this wrong; this one never touches the inside of parentheses.

What actually shrinks CSS

Honestly? Gzip does most of it — CSS is repetitive, and compresses to 15–20% of its size on the wire regardless of minification. Minification adds a real but secondary saving on top, and its main practical value is bundling hygiene: consistent output, no stray comments shipped to production.

Reading minified CSS

The CSS beautifier reverses this losslessly — unlike JavaScript, nothing in CSS minification destroys information.

Frequently asked questions

Will minification ever change how my CSS renders?

No — by construction. Only comments, redundant whitespace and final semicolons are removed; values, selectors and strings are untouched, and the inside of parentheses (calc, url, gradients) is never modified. There is nothing in that set that can alter rendering.

Why did my /*! comment survive?

Comments starting /*! are the convention for license headers that must legally ship with the code — every mainstream minifier preserves them, and so does this one. Regular comments are removed.

Why doesn't it shorten my colours or merge shorthands?

Deliberate restraint: value rewriting is where minifiers cause rendering bugs (shorthand merging changes cascade behaviour in edge cases). The extra bytes those tricks save are small once gzip has run; the bugs they risk are not.

How much does CSS minification actually save?

Typically 15–40% raw, depending on how comment- and indentation-heavy the source is. After gzip — which your server should be doing regardless — the marginal saving is a few percent. Worth having, not worth risking correctness for.