CSS Minifier
Shrink a stylesheet for production and see the percentage saved.
How CSS Minifier works
Strip comments and whitespace from CSS and see exactly how many bytes you saved. Everything happens inside this page: the tool reads your input, runs the calculation or conversion locally, and hands the result back to you. Nothing is transmitted, because there is no backend to transmit it to.
That design choice is deliberate. Most free tool sites upload your files to a server, process them there, and quietly keep a copy. Toolcin cannot do that — the site is a set of static files. If your connection dropped the moment the page finished loading, every tool would still work.
What gets removed
Comments, duplicate whitespace, and the space around braces, colons, semicolons, commas and combinators. Those spaces are optional in CSS, so removing them cannot change how the rule applies.
The result is a single-line file that is typically 20–40% smaller than hand-written CSS, and far smaller than CSS that was indented for reading.
What it will not do
It does not rename selectors, merge duplicate rules, drop unused declarations or rewrite shorthands. Those are optimisations that need to understand the whole stylesheet and the HTML that uses it — and they are exactly where automated minifiers break things.
It also does not restore formatting, apart from the optional pretty mode, which re-indents rather than reconstructing your original file.
| Transformation | Safe? |
|---|---|
| Remove comments | Yes |
| Collapse whitespace | Yes |
| Drop space around punctuation | Yes |
| Merge duplicate selectors | Not attempted |
| Remove unused rules | Not attempted |
Minification and your server
If your host already serves gzip or brotli, the transfer saving from minifying is smaller than it looks — compressed whitespace takes very little space. Minify for parse time and file count, not for bandwidth alone.
Keep the readable source in version control and ship the minified file as a build artefact. Debugging a one-line stylesheet in production is a waste of an afternoon.
Good to know
- Works offline once loaded, including on flights and in locked-down networks.
- No file size limit beyond your device's own memory.
- Free to use, with no account and no usage counter.
- Results are produced locally, so they are not logged or shared with anyone.
Questions
Is the output safe?
It only removes comments and redundant whitespace; selectors and values are untouched.
Can I get readable output back?
Tick pretty output to re-indent the result.
Will a media query break?
No. The minifier removes optional whitespace only, and the space in `and (min-width: …)` is preserved where it is required.
Does it handle CSS variables?
Yes, they are left untouched.
Keep going
More developer tools
JSON Array to Text
Flatten a JSON array into one value per line. Objects inside the array are written as compact JSON on their own line.
Open toolJSON Minifier
Compress JSON by removing every unnecessary space and newline. Whitespace is insignificant in JSON, so minifying never changes meaning — the size saving is shown.
Open toolCSS Formatter
Re-indent minified CSS into readable rules and declarations. Each selector gets its own block and each declaration its own line.
Open toolgitignore Generator
Build a .gitignore from Node, Python, PHP, WordPress, macOS and VS Code presets. Pick your stack and download a .gitignore that already covers the usual junk.
Open toolJSON Formatter
Format, validate and minify JSON with precise error messages. Everything runs locally in your browser.
Open toolRegex Tester
Test regular expressions live with highlighted matches, capture groups and a replace preview.
Open tool