Shorthand margin values
"margin: 0px 0px 10px 0px;" minifies to "margin:0 0 10px" — csso drops the redundant zero units and trailing zero.
Minify CSS online to cut file size and speed up your site — free CSS minifier and compressor.
About
Paste CSS and get it minified using csso, a structural minifier that understands the actual rule syntax — merging duplicate selectors and shortening values like turning margin: 0px 0px 10px 0px into margin:0 0 10px, rather than just stripping whitespace and comments.
csso does more than strip whitespace: it shortens colours like #ffffff to #fff, drops units from zero values, removes rules that end up empty and merges selectors whose declarations are identical. Comments are removed, except ones that start with /*!, which is the usual way to keep a licence header.
Examples
3 worked examples
"margin: 0px 0px 10px 0px;" minifies to "margin:0 0 10px" — csso drops the redundant zero units and trailing zero.
A 40 KB hand-written stylesheet with comments and whitespace typically minifies down to around 25-30 KB.
.a{color:red} .a{margin:0} is combined into .a{color:red;margin:0}, since both rules target the same selector.
FAQ
Quick answers to common questions about the CSS Minifier.
Paste your CSS code above, make sure CSS is selected, then click Minify. The minified output appears in the box below it — everything runs in your browser, using csso.
Yes. It's free, with no sign-up and no limit on how much code you minify.
Both — csso is a structural minifier, so beyond stripping whitespace and comments it also merges compatible rules and shortens values, like turning "margin: 0px 0px 10px 0px" into "margin:0 0 10px".
It shouldn't — csso only applies transformations that preserve the same computed styles. Always spot- check the result visually before shipping it, as with any build step.
No. Minification runs entirely in your browser after csso loads from this site — your code never leaves your device.
Yes — switch the language dropdown, or use the dedicated JavaScript minifier or HTML minifier page.
Regular comments are removed. Comments that start with /*! — the usual way to mark a licence or copyright notice — are kept, so those headers survive minification.
Yes — click Download to save it, or Copy to grab it. A small panel shows the original size, the minified size and the percentage saved.
No. csso only makes your CSS smaller; it doesn't add or remove prefixes like -webkit-. Use a tool such as Autoprefixer in your build for that.
Did CSS Minifier work for you?