Development & CodeLive🔒 Private

CSS Minifier

Minify CSS by removing whitespace and comments. Free online CSS minifier — reduce stylesheet size instantly. No signup, browser-based, 100% private.

Original: 0 chars | Minified: 0 chars

How it works

The CSS Minifier removes all whitespace, comments, and redundant syntax from CSS, producing the smallest valid stylesheet. Minified CSS loads and parses faster, directly improving page performance metrics.

CSS files are often 30–50KB for a typical web app. After minification, that becomes 20–35KB — a meaningful reduction for first-page load, especially on mobile networks. Most production web apps run CSS through a minifier as part of their build process (Webpack, Vite, Parcel all do this automatically), but this tool is useful when you need to minify a one-off stylesheet, a CMS-managed style block, or CSS from a legacy project without a build system.

How to use it: paste your CSS. The minifier removes all comments (/* ... */), collapses whitespace, removes spaces around selectors and property separators, shortens color values where safe (#ffffff → #fff), removes unnecessary semicolons before closing braces, and removes quotes from URL values where not required.

What is preserved: the semantic meaning of every rule. Minification never changes which elements are styled or how — it only removes non-semantic characters. Vendor-prefixed properties (-webkit-, -moz-) are preserved exactly as written.

Size measurement: the tool shows input size vs. output size in bytes and the percentage reduction, so you know exactly what was saved.

Frequently Asked Questions

Does it shorten color values?
Yes. Six-digit hex colors that have repeated pairs are shortened: #ffffff → #fff, #aabbcc → #abc. rgb() values for colors that have hex equivalents are converted to hex. Named colors are left as-is.
Is it safe to use in production?
For standard CSS, yes. The minifier applies safe transformations only — no shorthand property merging or value normalization that could change behavior. Test on your specific CSS to confirm.
What about CSS custom properties (variables)?
CSS custom properties (--color-primary: #ff5733) are preserved exactly. Whitespace around the colon in custom property declarations is normalized but values are not altered.
Does it process @import statements?
No. @import URLs and their content are not followed or inlined. The @import rule is kept as-is in the minified output.