CSS Minifier

Strip comments and whitespace from a stylesheet and see exactly how many bytes you saved.

Runs in your browser. Your image is never uploaded.

How to use CSS Minifier — Compress CSS Online Free

  1. 1Paste your CSS into the left-hand box.
  2. 2The minified version appears on the right, with the size saving shown.
  3. 3Copy it, or download it as a file.

About CSS Minifier

Minified CSS is what you want in production: the browser does not read your comments or your indentation, so every byte spent on them is a byte the visitor waits for. This strips all of it and reports the saving so you can judge whether it was worth doing.

It is worth knowing when the saving stops mattering. If your server sends CSS with gzip or brotli enabled, repeated whitespace compresses away almost completely, and minifying first saves far less than the raw byte counts suggest. Where it still helps is CSS inlined into a page, stored in a database, or served without compression.

The process is reversible: the formatter turns minified CSS back into readable, indented rules, so nothing is lost by minifying a stylesheet you may want to edit later.

Frequently asked questions

How much smaller will my CSS get?
Typically 20-35% for a hand-written, well-commented stylesheet, and much less for CSS that a build tool already processed. The exact figure for your file is shown next to the result.
Does minifying change how the page looks?
No. Only characters with no meaning to the CSS parser are removed. Selectors, properties and values come through untouched, so the rendered result is identical.
What exactly does it remove?
Comments, line breaks, indentation, spaces around braces, colons, semicolons and commas, and the redundant semicolon before a closing brace. It also shortens #aabbcc to #abc and 0.5em to .5em, both of which are exactly equivalent.
Is a comment inside a string safe?
Yes. The minifier tracks string literals, so content like "/* not a comment */" inside a content property survives intact — a common failure in regex-only minifiers.
Will it break my code?
For CSS and HTML, no. Only whitespace and comments are removed, and the contents of <pre>, <textarea>, <script> and <style> are preserved exactly as written. If the output ever differs from the input in any way that matters, that is a bug worth reporting.
Is it free?
Yes — unlimited use, no sign-up and no file-size cap beyond what your browser can hold in memory.