CSS Minifier
Minify CSS safely — remove comments and whitespace to make stylesheets smaller.
Runs in your browser — your data never leaves your device.
About the CSS Minifier
Smaller stylesheets download faster. This minifier removes comments, line breaks and unnecessary spaces from CSS while protecting the parts that must not change: quoted strings, url() values, calc() expressions and selectors such as a :hover.
Licence comments starting with /*! can be kept.
How to use the CSS Minifier
- Paste your CSS.
- Copy the minified code or click Download to save
style.min.css. - The status line shows the original and new size.
How it works
Strings and url() values are set aside, comments are removed, runs of whitespace become one space, spaces around { } ; , > ~ and after : are removed, and the last semicolon in each block is dropped. Spaces inside calc() around + and − are kept because CSS requires them.
Examples
.a > .b { color : red ; }→.a>.b{color:red}width: calc( 100% - 20px );→width:calc(100% - 20px)
Frequently asked questions
Is my text sent to your server?
No. Everything runs in your browser, on your own device. Nothing you type or paste is uploaded or stored.
Should I keep my original CSS?
Yes. Edit the readable version and minify it again when you publish — minified CSS is hard to edit by hand.