CSS Minifier

Remove comments and whitespace from CSS to produce a compact stylesheet. Quoted strings and url() values, including data URIs, are left exactly as they are.

Use the tool

Why this tool exists

Stylesheets are often the biggest render-blocking resource on a page, and the comments and indentation you wrote for yourself are of no use to the browser. Minifying is one of the cheapest ways to send fewer bytes.

The tool strips comments, collapses spaces around selectors, colons and braces, and keeps !important and the rules inside @media blocks intact. Strings and url() contents are protected, so base64 images and content values with spaces survive. It does not merge rules, shorten colours or reorder anything, which keeps the output predictable and easy to diff. For large production builds you might use your bundler, but this is ideal for a quick snippet or a single file. Nothing is uploaded.

How to use it

  1. Paste your CSS into the input box.
  2. Read the compact stylesheet in the output.
  3. Copy it into your page, template or build output.
  4. Test the page to confirm styling is unchanged.

Frequently asked questions

What exactly is removed?

Comments and unnecessary whitespace, such as indentation, line breaks and spaces around braces, colons and commas. Rules, values and their order are not changed.

Will data URIs and strings survive?

Yes. Anything inside quotes or url() is preserved untouched, including spaces in content values and long base64 data.

Does it optimise values, like shortening colours?

No. It does not rewrite colours, merge duplicate rules or drop unused CSS. That keeps it safe, but bundler tools can save more.

How can I read the minified result again?

Paste it into the CSS Formatter in this collection. It restores indentation and puts one declaration on each line, although removed comments cannot be brought back.