What is CSS Minifier?
CSS Minifier strips whitespace, comments, and unnecessary characters from CSS to produce the smallest valid stylesheet. Smaller CSS means faster downloads, faster rendering, and better Core Web Vitals scores.
Every kilobyte of CSS is render-blocking — the browser can’t paint anything until it’s downloaded and parsed. Minification is one of the easiest performance wins you can make.
What Gets Removed
Whitespace
Spaces, tabs, and newlines between tokens. The biggest savings — CSS source is often 30% whitespace.
Comments
Everything inside /* ... */ blocks. Comments are for humans; the browser ignores them.
Trailing semicolons
The last property in a rule block doesn't need a semicolon. Minifiers remove it safely.
Redundant zeros
'0px' becomes '0', '0.5em' becomes '.5em' — tiny savings that add up across large files.
How to Use CSS Minifier
Paste your CSS
Paste the full content of your .css file into the input panel.
Click Minify
The minified output appears instantly — one long line of compressed CSS.
Check the savings
The size reduction (bytes and %) is shown above the output panel.
Copy and deploy
Copy the minified CSS and paste it into your production stylesheet or build pipeline.
Before and After
| Metric | Before | After |
|---|---|---|
| File size | 12.4 KB | 8.1 KB |
| Reduction | — | 35% |
| Comments | 24 blocks | 0 |
| Line breaks | 480 | 1 |
| Spaces | ~3,200 | ~0 |
Tips & Common Mistakes
Always minify at build time, not manually. Tools like Vite, Webpack, and PostCSS minify automatically on npm run build. Use this tool for quick one-off compressions or for checking sizes.
Keep a source copy. Never overwrite your original .css file with the minified output. You won’t be able to edit it. Minified CSS is for deployment only.
Minification ≠ optimization. Minifying doesn’t remove unused selectors, consolidate duplicate rules, or improve specificity. For deeper optimization, use PurgeCSS or UnCSS alongside minification.
Related Tools
- CSS Beautifier — reverse the process — expand minified CSS back to readable form
- JSON Formatter — format JSON config files in the same workflow