CSS Minifier
Minify CSS by removing comments, whitespace, and trailing semicolons. Fast, private, browser-only.
Runs in your browser — nothing uploaded
CSS input—
Minified
Use this free CSS minifier to shrink stylesheets for faster page loads. It strips comments, collapses whitespace, and removes unnecessary punctuation — without touching the contents of quoted strings or url() values. The output is safe to drop straight into production.
Private by design — your data never leaves your device
How to use it
No account, no upload — it all happens on your device.
1
Paste your CSS into the input box.
2
The minified output appears instantly on the right.
3
Copy the result and ship it as part of your build artifact.
What gets removed
Every transformation the minifier applies.
| Change | Before | After |
|---|---|---|
| Comment | /* note */ body{} | body{} |
| Indent | .a { color: red; } | .a{color:red} |
| Space around punctuation | .a , .b { color : red ; } | .a,.b{color:red} |
| Trailing semicolon before } | .a{color:red;} | .a{color:red} |
| Whitespace inside selectors | ul > li + li | ul>li+li |
What gets preserved
A minifier that breaks valid stylesheets is worse than no minifier.
- Quoted strings.
content: " "keeps its inner space. url()values. Paths and data URIs are left untouched even if they contain whitespace.- Custom property values. Hex colors, function arguments, and
calc()expressions remain valid.
What this tool doesn't do (yet)
- Rule merging. Two adjacent selectors with the same declarations are not deduped.
- Vendor-prefix stripping. Older
-webkit-,-moz-prefixes are kept; if you no longer support those browsers, drop them by hand or in your build step. - Color shortening.
#ffffffis not shortened to#fff. (Some build tools do this; the bytes saved are usually trivial.)
The minifier prioritises producing valid output over squeezing every last byte. If you need maximum compression, run the output through a build-time tool like cssnano or lightningcss as well.
Frequently asked
What does this minifier change?
It removes comments, collapses whitespace, strips spaces around punctuation like {, }, :, ;, removes trailing semicolons before }, and tightens parentheses. Quoted strings and url() values are left intact.
Is my CSS uploaded anywhere?
No. The minifier runs entirely in your browser. Your stylesheet never leaves the page.
How much smaller will my CSS get?
Typical hand-written CSS shrinks 25–40% after minification. Designed CSS systems with lots of comments and whitespace can save more; already-built libraries save very little.