CSS Minifier
Minify CSS code for production.
How to Use CSS Minifier
Paste your CSS into the minifier box, or load a compiled or hand-written stylesheet file.
Choose the optimisation level: safe whitespace stripping, or aggressive with colour and unit shortening.
Click the "Process" button to strip comments and rebuild the stylesheet in its smallest safe form.
Copy the minified CSS and drop it into your build step or a style block, then check the reported savings.
Features
Frequently Asked Questions
Related Tools
JSON Formatter
Format and beautify JSON data with proper indentation.
JSON Validator
Validate JSON data and find syntax errors.
JSON Minifier
Minify JSON by removing whitespace and formatting.
HTML Formatter
Format and beautify HTML code.
HTML Minifier
Minify HTML code to reduce file size.
CSS Formatter
Format and beautify CSS code.
About CSS Minifier
CSS compresses very well, but there is still a lot of redundant weight to remove before the compressor ever sees it. The CSS Minifier strips comments, collapses every run of whitespace down to a single space, removes the final semicolon in each block, and tightens spacing around punctuation in selectors.
An aggressive mode goes further and applies the safe shorthand rewrites that browsers understand: a six-digit hex colour becomes three, 0px becomes 0, and redundant units on zero values are dropped. Values inside quoted strings, URLs, and attribute selectors are left alone, because those bytes are data rather than formatting.
What it deliberately does not do is merge selectors, reorder rules, or rename classes. Merging is powerful but it is also where minifiers break specificity, and renaming requires a matching change in your HTML or JavaScript. The result here is byte-smaller while behaving exactly like the stylesheet you wrote, which makes it safe to drop into a live site.
When to Use This Tool
- Shrinking a critical CSS file that blocks first paint
- Compressing a WordPress or Shopify theme stylesheet for production
- Reducing bandwidth on a site with a large custom design system
- Comparing stylesheets by their minified size to spot bloat
- Minifying inline styles before pasting them into a CMS