CSS Minifier

Shrink a stylesheet for production and see the percentage saved.

How CSS Minifier works

Strip comments and whitespace from CSS and see exactly how many bytes you saved. Everything happens inside this page: the tool reads your input, runs the calculation or conversion locally, and hands the result back to you. Nothing is transmitted, because there is no backend to transmit it to.

That design choice is deliberate. Most free tool sites upload your files to a server, process them there, and quietly keep a copy. Toolcin cannot do that — the site is a set of static files. If your connection dropped the moment the page finished loading, every tool would still work.

What gets removed

Comments, duplicate whitespace, and the space around braces, colons, semicolons, commas and combinators. Those spaces are optional in CSS, so removing them cannot change how the rule applies.

The result is a single-line file that is typically 20–40% smaller than hand-written CSS, and far smaller than CSS that was indented for reading.

What it will not do

It does not rename selectors, merge duplicate rules, drop unused declarations or rewrite shorthands. Those are optimisations that need to understand the whole stylesheet and the HTML that uses it — and they are exactly where automated minifiers break things.

It also does not restore formatting, apart from the optional pretty mode, which re-indents rather than reconstructing your original file.

TransformationSafe?
Remove commentsYes
Collapse whitespaceYes
Drop space around punctuationYes
Merge duplicate selectorsNot attempted
Remove unused rulesNot attempted

Minification and your server

If your host already serves gzip or brotli, the transfer saving from minifying is smaller than it looks — compressed whitespace takes very little space. Minify for parse time and file count, not for bandwidth alone.

Keep the readable source in version control and ship the minified file as a build artefact. Debugging a one-line stylesheet in production is a waste of an afternoon.

Good to know

  • Works offline once loaded, including on flights and in locked-down networks.
  • No file size limit beyond your device's own memory.
  • Free to use, with no account and no usage counter.
  • Results are produced locally, so they are not logged or shared with anyone.

Questions

Is the output safe?

It only removes comments and redundant whitespace; selectors and values are untouched.

Can I get readable output back?

Tick pretty output to re-indent the result.

Will a media query break?

No. The minifier removes optional whitespace only, and the space in `and (min-width: …)` is preserved where it is required.

Does it handle CSS variables?

Yes, they are left untouched.

Keep going

More developer tools