Skip to content

CSS minifier

Shrink CSS with a real parser, not a find-and-replace.

Runs in your browser — nothing is sent anywhere.

What CSS minification removes

Comments, whitespace, the final semicolon in a block, and any declaration a later rule overrides. Beyond that, values are shortened where the meaning is identical: #ffffff becomes #fff, 0px becomes 0, and margin: 10px 10px 10px 10px becomes margin:10px.

Rules with identical bodies are merged and selectors are restructured, which is where most of the saving beyond simple whitespace comes from. Typical results are 20–35% on hand-written CSS and rather less on output that a framework already compressed.

It uses a parser, not a search and replace

This matters more than it sounds. The version of this tool that ran on the old site was a set of regular expressions, and it rewrote the contents of strings — turning content: "a; b: c" into content:"a;b:c" and quietly changing what the page displayed. It also stripped /*! */ licence comments that some libraries require you to keep.

A real parser builds the stylesheet's structure first, so it knows a semicolon inside a quoted string is not a separator. That is a distinction regular expressions cannot make.

What it does not do

Minification never removes rules that are merely unused — a minifier cannot know which selectors your HTML actually contains. Removing dead CSS needs a tool that reads your markup too.

Where the real win is

Honestly: gzip and brotli, which your server almost certainly already applies, recover most of what minification saves. Minifying first still helps, because the two compound — but if your CSS is not compressed in transit, fixing that is worth far more than this tool.

It runs in your browser

Nothing is uploaded, which matters for unreleased work.

01

Common questions

Will it break my code?

No. These are real parsers working on a syntax tree. The regex-based tool this replaces did break code, routinely.

Why did it reject my file?

A parser reports syntax errors rather than guessing. The message usually points straight at the problem.

How much smaller will it get?

Roughly 20–35% for CSS, 30–60% for JavaScript, 5–15% for HTML — before gzip.

Is minifying still worth it?

Somewhat. Compression recovers much of the same saving, though the two do compound.

Can it un-minify?

No. Variable names are gone for good — that is where most of the saving comes from.

Is my code uploaded?

No, it is processed in your browser.