CSS Minifier

CSS Minifier

Shrink CSS by stripping comments and whitespace safely, with strings and url() contents protected.

The CSS Minifier makes stylesheets smaller and faster to download by removing comments and collapsing whitespace, while carefully protecting the parts of CSS where spaces and characters are meaningful. A minified stylesheet loads quicker on every page view, and the saving multiplies across a whole site.

Safety comes first in how this tool works. Before minifying, it sets aside every quoted string and every url() value and restores them untouched afterwards, so a content string containing a semicolon or a data URI is never mangled by whitespace rules. It then strips comments, squeezes repeated whitespace, and removes the optional spaces around braces, colons, semicolons, and combinators, finishing with an exact byte count and percentage saved.

The output means exactly the same as the input to a browser; only the packaging shrinks. Everything runs in your browser, nothing is uploaded, and there are no accounts or limits.

How to use

  1. Paste your CSS into the box.
  2. Click Minify CSS.
  3. Check the size saving in the status line.
  4. Copy the minified CSS into your stylesheet or page.
  5. Keep your readable original as the version you edit later.

Frequently asked questions

Is minified CSS safe to use in production?

Yes, this style of minification is what production sites use. As always, test the page once after swapping the file, especially if your CSS uses unusual hacks.

Why protect strings and url() values?

Inside quotes and url(), characters like spaces and semicolons are data, not formatting. Removing them would change what the CSS says, so the tool holds those regions aside while it minifies everything else.

Does it shorten colours or values too?

No. This is a conservative minifier: whitespace and comments only. Rewriting values, like shortening hex colours, is left to build tools so the output stays predictable.

Is my CSS uploaded?

No. All processing happens locally in your browser.