Beautify minified CSS with clean indentation, selectors and media queries
CSS Minifier
Make a stylesheet smaller for production without breaking strings, url() values or calc() expressions.
Loading tool…
How to use css minifier
Paste CSS or open a .css file.
Choose whether to keep /*! licence comments, drop empty rules and shorten colours and decimals.
Check the size saving shown above the output.
Copy the result or download it as .min.css.
What this tool does
- Removes comments and every space the browser does not need, while keeping the spaces calc() and media queries require.
- Shortens #aabbcc to #abc and 0.5 to .5 inside values only, never inside selectors or strings.
- Drops the last semicolon in each block and, if you choose, rules that contain nothing.
- Keeps licence comments that start with /*! so attribution survives.
How the result is verified
The minified CSS is parsed again and its rules and declarations are counted; the numbers must match your input, apart from any empty rules you chose to remove, before download is allowed.
Frequently asked questions
How much smaller will my CSS get?
Hand-written CSS usually shrinks by 15 to 35 percent. Files that are already compact gain less. Your web server's gzip or Brotli compression saves more again on top.
Is it safe to minify CSS with data URIs inside?
Yes. Unquoted url(...) values are read as a single unit, so semicolons and slashes inside a data URI are never touched.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Remove whitespace and comments from HTML, keep pre and scripts safe
Live CSS editor with HTML to style, presets and phone width preview
Compare two texts line by line with changed words highlighted