CSS Minifier

Remove comments and spaces from CSS to make the file smaller.

How to Use CSS Minifier

  1. Paste your CSS.
  2. Click Minify CSS.
  3. Check the original size, minified size and percentage saved.
  4. Copy the result or Download it as a .min.css file.

What gets removed

Comments are deleted, runs of whitespace become single spaces, spaces around braces, semicolons, commas and after colons are removed, and the last semicolon in each rule is dropped. That's typically a 15 to 30% saving on a hand-written stylesheet, before gzip.

Two things are deliberately left alone. Text inside quotes, such as content: "a b" or font names, is never changed. And a space before a colon is kept, because in a selector like div :first-child it means 'any descendant', which is different from div:first-child.

Limits

This is a whitespace-and-comment minifier. It doesn't merge rules, shorten colours or remove unused CSS, which build tools like cssnano or Lightning CSS can do. Keep your original, readable file for editing and only publish the minified copy.

Key Features & Practical Use Cases

  • Making a stylesheet smaller before putting it on a live site.
  • Compressing CSS for an email template or inline style block.
  • Quickly checking how much a stylesheet can shrink.

Frequently Asked Questions

Will minifying break my CSS?

It shouldn't. Strings are untouched and selector spacing that changes meaning is kept. As always, test the page after changing a stylesheet.

Are license comments kept?

No, all comments are removed. Add a license comment back by hand if your project requires one.

Does it support SCSS or LESS?

Plain CSS only. Compile SCSS or LESS to CSS first.

Is my code uploaded?

No. It's minified in your browser.

About OneClickly

OneClickly is a set of 119 free tools for PDFs, images, text, everyday math and code. They run in your browser, so the files and text you work with stay on your device.

Related Tools

  • JavaScript Minifier - Minify JavaScript with terser: removes whitespace and comments and shortens local names.
  • Base64 Encoder/Decoder - Encode text to Base64 or decode it back, with UTF-8 and URL-safe support.
  • URL Encoder/Decoder - Encode special characters in URLs (percent-encoding) or decode them.
  • HTML Encoder/Decoder - Escape special characters as HTML entities, or decode entities back to plain text.
  • JWT Decoder - Read the header, payload and expiry of a JSON Web Token in your browser.
  • Cron Expression Generator - Build cron schedule expressions and see what they mean in plain English.