CSS minifier
Paste your CSS and get the smallest version straight away, with the saving shown in characters and percent. Comments and unnecessary spaces go; your styles work exactly the same.
How it works
-
Paste your code
Paste the code in the left box or open a file. No code to hand? Click Example.
-
Instant result
The result appears as you type. If there is an error, you see the line and character.
-
Copy or download
Copy the result with one click or save it as a file for your editor or project.
What gets removed?
Comments, line breaks, indentation and the spaces around {, }, :, ; and ,. The last semicolon of every block goes too. Spaces that matter stay: inside strings, in url(), in calc(100% - 2rem) (where the spaces around - are required) and between the parts of a value such as margin: 0 auto.
Licence comments
Comments starting with /*! usually contain a licence that has to stay. Tick Keep /! … / comments and they remain in the output.
Why minify?
Smaller files load faster, especially on mobile connections. For a quick copy-and-paste job this tool is enough; in a build process you would normally use a bundler. To read minified CSS again, use the CSS beautifier.
Frequently asked questions
Is the CSS minifier free?
Yes. The CSS minifier is completely free, with no account, sign-up or usage limit.
Is my code stored?
No. Your code is processed in your browser and is not sent to a server or stored.
Does it work on my phone?
Yes. The tool works in any modern browser on a phone, tablet or computer.