CSS minifier
Minify your CSS by removing all the unnecessary characters.
About this tool
The CSS minifier makes stylesheets smaller without changing how they work. It removes comments, spaces and line breaks, and shortens values where it safely can, then shows how much it saved.
How to use the CSS minifier
- Paste your CSS.
- Press Minify.
- Copy the minified CSS into your site, or into a .min.css file.
What minifying does
- Removes comments and all the whitespace that’s only there for people to read.
- Drops the last semicolon in each rule and other characters CSS doesn’t need.
- Shortens values: #ffffff becomes #fff, and 0px becomes 0.
For safety, it never fetches files: @import rules and url() references are left as they are, not pulled into the result.
Why it matters
CSS blocks the page from showing until it has downloaded, so a smaller stylesheet means the page appears sooner, which helps visitors and Core Web Vitals. Keep your readable CSS as the original, and minify a copy for the live site. If the minifier reports an error, the CSS has a syntax problem, often a missing brace or quote, worth fixing anyway.
Similar tools
JS minifier
Minify your JavaScript by removing all the unnecessary characters.
JSON validator & beautifier
Validate JSON content and make it look good.
SQL formatter/beautifier
Format & beautify your SQL code with ease.
HTML entity converter
Encode or decode HTML entities for any given input.
BBCode to HTML
Convert forum style BBCode snippets to raw HTML code.
Markdown to HTML
Convert Markdown snippets to raw HTML code.