Free tool · Dev Utilities
CSS Minifier
Minify CSS correctly: strips comments and whitespace without breaking calc(), nesting, or custom properties.
Strip comments and unnecessary whitespace from CSS to produce a smaller file, without the bugs a naive find-and-replace minifier introduces. Whitespace inside a quoted string or url() is left untouched, and the space-sensitive + and - operators inside calc(), min(), max(), and clamp() are preserved exactly, since calc(100% - 10px) and calc(100%-10px) are not the same valid CSS. Modern nested rules and custom properties are handled correctly since the tool only tracks brace, string, and comment state, never tries to parse selectors.
- Files never leave your device
- Runs entirely in your browser
- Free, no account needed
How to use CSS Minifier
Two steps, and nothing to install.
Paste your CSS
Paste your stylesheet. It minifies automatically a moment after you stop typing.
Copy or download the result
See the exact before-and-after byte size and percentage saved, then copy the minified CSS or download it as a .css file.
More free tools
Free, private, and no sign-up on any of them.
How this works in your browser
This tool is a character-by-character state machine, not a regex-based find-and-replace, specifically to avoid the correctness bugs a naive minifier introduces: it tracks whether it is currently inside a quoted string, a comment, or a whitespace-sensitive function like calc(), and only strips or collapses whitespace when none of those apply. A "/*! ... */" banner comment, the standard convention for a license notice, is preserved rather than stripped like a normal comment.
CSS Minifier vs. upload-based online tools
| Feature | CSS Minifier (in-browser) | Upload-based online tools |
|---|---|---|
| File upload required | No - never leaves your device | Yes - file is sent to a server |
| Processing queue | None - starts instantly | Often, especially at peak times |
| Watermark on output | Never | Common on free plans |
| Usage limits | None - free, unlimited use | Often capped per day or file size |
| Works offline once loaded | Yes, for most tools | No - requires a live connection |
| Account required | No | Often, for anything beyond a trial |
Who uses CSS Minifier
Frontend developers shipping a build
Shrink a hand-written stylesheet before deploying, without a full build pipeline for a quick one-off file.
Anyone pasting CSS into a size-limited field
Fit a stylesheet into an email template, CMS custom-CSS box, or other field with a character limit.
Checking real byte savings
See the actual before-and-after size of your specific CSS, not a generic claimed percentage.
Frequently asked questions
What it can and cannot do, and what happens to your files.
Is this CSS minifier free?
Yes, completely free with no limit on how much CSS you minify.
Will this break calc() expressions?
No. The tool specifically preserves the spaces around + and - inside calc(), min(), max(), and clamp(), since removing them would produce invalid CSS.
Does it handle CSS custom properties (variables)?
Yes. Custom properties like --gap: 8px 16px; are treated like any other declaration, with meaningful spacing between values preserved.
Does it support modern nested CSS?
Yes. The tool tracks braces generically rather than trying to parse selectors, so nested rules pass through correctly.
What happens to comments?
Regular comments are stripped. A "/*! ... */" comment, the standard convention for a license or attribution banner, is kept.
Is my CSS uploaded anywhere?
No, minification happens entirely inside your browser.
Minify CSS - free, correct, instant.
Files never leave your device. No upload, no account, and free for unlimited use.