Support
Dev Tools / Minify CSS Code

Browse by category

All categories

Minify CSS Code

Minify CSS code by removing whitespace, comments, and redundant rules to reduce file size. Paste production code, API keys, tokens.

1
Paste CSS
Paste your CSS code into the input area
2
Minify
The CSS is minified automatically with size reduction stats
3
Copy result
Copy the minified CSS or download as a file

CSS Input

CSS Output

Output will appear here...
  • Zero-units (0px, 0em) collapse to 0 during minify.
  • Comments and trailing semicolons are stripped. Use /*! … */ + the toggle to keep license headers.

Frequently Asked Questions

Are CSS custom properties (variables) preserved?

Yes. `--variable-name` declarations and `var(--x)` references pass through untouched. Minification only strips comments, collapses whitespace, merges shorthand properties, and removes redundant units on zero values.

Does it rewrite selectors or merge duplicate rules?

No. Selector rewriting and rule merging can change specificity or the order of property application — both have silent correctness risks. This minifier is intentionally conservative; the parsed output is semantically identical to the input.

Can I round-trip between minify and beautify?

Yes. Toggle to "beautify" mode to pretty-print minified CSS. Round-tripping minify → beautify → minify produces identical bytes. Original author comments (`/* ... */`) are stripped on minify and cannot be recovered by beautify.

This tool is free thanks to our sponsors. Support Loft Tools