CSS Minifier & Beautifier

Paste your CSS below to minify or beautify it. Everything runs in your browser.

Original: 0 B Output: 0 B Saved: 0 B (0%)
Copied!

About this tool

Minify CSS to strip comments, whitespace, and redundant syntax for the smallest possible file — or beautify compressed CSS back into readable, indented form. Both directions run locally in your browser; your stylesheets are never uploaded.

Minification is purely mechanical: the output is equivalent in effect, just smaller.

When to use it

Worked example

This rule: /* card layout */ .card { margin: 0 auto; padding: 16px; background-color: #ffffff; } minifies to .card{margin:0 auto;padding:16px;background-color:#fff} — a 57% reduction. The comment is gone, whitespace collapsed, #ffffff shortened to #fff, and the final semicolon dropped. The browser treats both identically.

Frequently asked questions

Does minification ever change how styles behave?

No — a correct minifier only removes characters the CSS parser ignores and applies safe equivalences like color shortening. If a stylesheet behaves differently after minification, the original almost certainly contained a syntax error that the transformation surfaced.

How much does minification actually save?

Typically 20–40% off the raw size for hand-written CSS, more if it's comment-heavy. Note that gzip/brotli compression (which your server should also do) captures much of the same redundancy — minify and compress together for the best result.

Can I recover my formatting after minifying?

Beautifying restores indentation and line breaks, but comments are gone forever — minification deletes them. Keep your source file; treat minified output as a build artifact, not a replacement.

Should I minify during development?

No — develop against readable CSS and minify only what you deploy. Debugging minified styles in the browser inspector is needless pain, and source files under version control should stay human-readable.