Skip to main content
PocketToolz

CSS Minifier

Strip comments and whitespace from CSS, and shorten hex colours and zero units.

DeveloperRuns in your browserFree, no signup

About the CSS Minifier

Minifying strips comments, whitespace and the last semicolon in each block, and shortens what can be shortened without changing meaning — #ffffff to #fff, 0px to 0. Typical savings on hand-written CSS are 20 to 40 percent before gzip.

Gzip or Brotli, which every server should already apply, does most of the same job for repeated whitespace. Minifying still helps because it removes content rather than compressing it, and the two compound — but the gain from minifying already-compressed CSS is smaller than the raw percentage suggests.

Keep the readable source in version control and minify as a build step. A minified stylesheet is unreviewable in a diff, and editing one by hand is how a stray brace ends up breaking every rule after it.

How it works

  1. Paste your stylesheet.

  2. Comments and whitespace go, hex colours shorten to three digits where possible, and zero values lose their units.

  3. Copy or download the result, with the byte saving shown against the original.

Frequently asked questions

How much smaller will my CSS get?
Usually 20 to 40 percent for hand-written CSS with comments and generous formatting. Already-compact or framework-generated CSS gains less, because there is less whitespace and fewer comments to remove.
Does minifying CSS break anything?
It should not — only whitespace, comments and redundant syntax are removed. The one thing to watch is CSS hacks that depend on specific spacing or malformed syntax to target old browsers, which minification can normalise away.
Should I minify if my server already uses gzip?
Yes, though the gain is smaller than the raw percentage suggests. Gzip compresses repeated whitespace efficiently; minification removes content entirely, including comments, so the two compound rather than overlap completely.
Can I un-minify CSS?
You can reformat it with the CSS formatter, which restores readable indentation. Comments are gone for good, though — they are removed, not compressed.
Is my stylesheet uploaded?
No. Minification runs in your browser, so unreleased styles and anything containing internal class names or comments stay on your machine.

Privacy

Everything happens locally. Your files are read by your own browser, processed on your device, and never uploaded — closing the tab is all it takes to erase them.

Related Developer tools