Free CSS Minifier & Beautifier
Compress CSS by stripping comments and whitespace, or re-indent it for readability. Preserves strings, URLs and important comments β all in your browser.
Input CSS
url() contents and /*! */ comments are always preserved.Output
What Is CSS Minification?
CSS minification removes every byte that CSS doesn't need: comments, redundant whitespace, trailing semicolons, and unnecessary units. The output renders identically to the input, but weighs significantly less. Typical savings range from 20% to 40% of the original file size.
Because CSS is render-blocking β the browser must download and parse it before painting anything β even small size reductions improve page performance.
Minify vs Beautify
| Mode | Purpose | When to use |
|---|---|---|
| Minify | Remove whitespace, comments and unneeded characters | Production deployment |
| Beautify | Re-indent rules for readability | Editing, debugging, code review |
What gets removed
- Comments β
/* ... */blocks are stripped, unless they begin with/*!(the licence-comment convention). - Whitespace β spaces, tabs and newlines collapse to the minimum required to keep tokens separate.
- Trailing semicolons β the last declaration in a block doesn't need a
;. - Zero units β
0px,0em,0%all become0. - Leading zeros β
0.5becomes.5. - Colour values β
#ffffffbecomes#fff.
What is preserved
- Strings β
content: "a;b"keeps the semicolon inside the string. - URLs β
url(https://β¦/img.png)passes through untouched. - Important comments β
/*! Copyright 2026 */survives minification. - Spaces inside calc() β
calc(1px + 2px)must keep spaces around+.
Common use cases
Production Deploy
Ship the smallest possible CSS to every visitor.
Improve Page Speed
CSS is render-blocking β smaller means faster first paint.
Cleaner Diffs
Beautify before committing so Git diffs show real changes.
Learn CSS Structure
Beautify minified CSS to understand what a site is doing.
Reduce Bandwidth
Save meaningful KB on every page view across millions of hits.
Inline Critical CSS
Minify before inlining above-the-fold CSS in the HTML head.
Mobile Performance
Smaller CSS loads faster on slow mobile networks.
Quick Validation
Paste CSS to spot malformed braces or stray characters.
Privacy and security
This CSS minifier runs entirely in your browser. A custom tokenizer walks the input, strips unneeded characters and re-emits the result β all in local JavaScript. Your CSS never leaves your device, safe for internal stylesheets, proprietary designs and unreleased work.
Frequently Asked Questions
What does a CSS minifier do?
Will minifying break my CSS?
Does it remove my licence comment?
/*! marker. Comments beginning with /*! are preserved by default so your licence header stays in the file.What about calc() expressions?
calc() are preserved because CSS requires whitespace around + and - operators. We never touch content inside calc(), var(), or any other function with string arguments.