CSS Minify

Minify CSS: remove comments, spaces and the last semicolon in each rule, while keeping strings, url() values and meaningful selector spaces intact. Runs in your browser.

Suggested tools

CSS Formatter

Beautify minified CSS into readable rules, or minify it.

CSS
Open Tool

JSON Minify

Minify / compact JSON.

JSON
Open Tool

XML Minify

Minify / compact XML.

XML
Open Tool

HTML Minify

Remove comments and extra whitespace from HTML safely.

HTML
Open Tool

Text Compare

Compare two texts and see the differences highlighted line by line and word by word.

TEXT
Open Tool

Compare Lists

Find items that are in both lists, only in the first, or only in the second.

TEXT
Open Tool

About CSS Minify

CSS Minifier makes stylesheets smaller by removing comments, line breaks and unnecessary spaces, and the last semicolon in each rule. Smaller CSS downloads faster, which helps page speed and Core Web Vitals.

It is careful about the places where spaces matter: text inside quotes, url(...) values and descendant selectors such as "div :first-child" are left intact, so the minified CSS behaves exactly like the original. Everything runs locally in your browser — the text you paste is never uploaded.

How to use CSS Minify

  1. Paste your CSS or upload a .css file.
  2. Press Minify.
  3. Copy the one-line result or download it, and use it in production.

Key features

  • Removes comments and redundant whitespace
  • Keeps strings and url() values untouched
  • Preserves meaningful spaces in selectors
  • Drops the final semicolon in each block

Example

Input
/* buttons */
.btn {
  color: #fff;
  margin: 0 auto;
}
Output
.btn{color:#fff;margin:0 auto}

When to use CSS Minify

  • Shrinking a stylesheet before uploading it to a website without a build tool.
  • Compacting CSS for inline <style> blocks in emails or landing pages.
  • Reducing CSS size to improve page-speed scores.

Tips and common problems

  • Minify a copy — comments are removed and cannot be recovered.
  • Enable gzip or brotli on your server too; it compresses minified CSS further.
  • Test the page after replacing the CSS, especially if it uses unusual hacks.

Frequently asked questions

Typically 15–30% for hand-written CSS, depending on how many comments and how much indentation it had. Gzip on your server then compresses it further.