Free tools, no sign-up — everything runs in your browser.
ToolHub 1000Free online tools

CSS Minifier Guide: What Gets Removed and What Stays

Learn how a basic CSS minifier strips comments and whitespace without touching quoted strings.

What is the CSS Minifier?

This tool removes CSS comments and collapses unnecessary whitespace, and it trims spaces around braces, colons, semicolons and commas. Quoted strings are protected first, so a URL or font name containing spaces is not broken by the stripping. It is a basic minifier: it does not rewrite selectors, merge rules or shorten colours, and very unusual CSS may need a full build tool instead.

How to use it

  1. Paste your CSS into the box.
  2. Click Minify CSS.
  3. Copy the compact result for use in a stylesheet.

Worked example

For the sample, the comment is removed and the rule becomes one compact line with spaces around braces and semicolons stripped, while the quoted image name stays intact.

Can minified CSS ever break a page?

Yes, if a minifier damages a string or a special value. Protecting quoted strings first avoids the most common breakage, but always test minified CSS before publishing it.

Frequently asked questions

Will it break strings with spaces?

No. Quoted strings are set aside before whitespace is stripped and restored afterwards, so spaces inside them survive.

Does it shorten colours or merge rules?

No. This is a basic whitespace and comment minifier only; it does not rewrite selectors, values or colours.

Try the CSS Minifier free · All guides