CSS Minifier — Minify CSS Online
Strip whitespace and comments, merge duplicate rules, shorten colors and units, and produce a tight production CSS bundle. Powered by CSSO — the same engine used by major build pipelines.
Strip the noise, keep the rules
Comments, redundant whitespace, repeated selectors, long color names — all gone, all without changing rendering.
/* Buttons */
.button {
background-color: #ff0000;
margin: 0px 0px 0px 0px;
padding: 10px 10px 10px 10px;
font-weight: bold;
}
.button:hover {
background-color: #ff0000;
opacity: 0.8;
}.button{background-color:red;margin:0;padding:10px;font-weight:700}.button:hover{background-color:red;opacity:.8}Where minified CSS pays for itself
Smaller CSS bundles, faster First Contentful Paint, lower bandwidth.
Performance budgets
30–60% smaller bundles directly improve First Contentful Paint and LCP scores.
Mobile networks
Every byte matters on cellular. Smaller stylesheets render faster on slow connections.
Bandwidth savings
For high-traffic sites, even 10 KB per request adds up to terabytes per month.
SEO & Core Web Vitals
Google factors page-load metrics into rankings; CSS minification is the simplest win.
How to minify CSS
Paste or drop your CSS
Paste source CSS into the left editor or drop a .css file onto the upload area.
Pick options
Default is restructure ON, media-merge OFF (safer), strip comments ON. Adjust if your build needs comments preserved.
Click Minify
CSSO runs locally in your browser. The right editor fills with the minified result; stats below show the size reduction.
Copy or download
Copy with one click, or download as minified.css.
Frequently asked questions
The process of removing unnecessary characters from a CSS file without changing rendering: whitespace, comments, redundant declarations, long color names like white → #fff, and so on. The output is functionally identical to the input but typically 30–60% smaller.
No, with one caveat: Merge media queries is off by default because reordering @media blocks can change cascade outcomes for edge cases (specificity ties resolved by source order). Leave it off unless you know your CSS is robust to reordering.
Toggle Strip comments off — the option becomes "exclamation" in CSSO, which preserves /*! … */ "important" license-header comments while still stripping ordinary ones.
All preserved. CSSO understands modern CSS — custom properties, calc(), container queries, @layer, color-mix, OKLCH, and so on. It only optimizes things it knows are safe.
No. CSSO is loaded as a static ES module from a CDN; everything runs in your browser.
About CSS minification
CSS minification is one of the cheapest performance wins in front-end development. The output is functionally identical to the input — just smaller. The savings flow through to download time, parse time, and (for cold caches) Largest Contentful Paint scores.
What this tool does
- Strips comments, whitespace, semicolons before
}, and other syntactic noise - Merges identical selectors
- Shortens colors (
#ffffff→#fff,rgb(255,0,0)→red) and units (0px→0,0.5em→.5em) - Restructures rules to use shorthand where possible
- Optionally merges
@mediaqueries (off by default — see the FAQ)
Powered by CSSO
The transformation engine is CSSO, the same library used by Yandex's frontend platform and many build tools. It understands modern CSS — custom properties, calc(), container queries, @layer, color functions — and only applies optimizations that are provably safe.
What it doesn't do
- PurgeCSS-style dead-code elimination. CSSO doesn't know which selectors your HTML uses. Pair with PurgeCSS or your framework's own pruner if you need that.
- Vendor-prefix management. Use Autoprefixer or PostCSS for that.
- Source maps. If you need debug-friendly minified CSS, run CSSO from your build pipeline with the
sourceMapoption.