CSS Minifier
Minify CSS to reduce file size. Preserves specificity and semantics.
MinifyCompressClient-sideUnlimited
0 / 500,000
How to use
- Paste your CSS. Any valid CSS.
- Copy the minified output. Smaller payload, same styles.
Common use cases
- Shrinking stylesheets for production
- Inlining critical CSS
- Reducing CDN bandwidth
- Embedding small CSS snippets in style attributes or single-file HTML emails
Frequently asked questions
- How much smaller does minified CSS get?
- Typical savings are 15% to 30% off the unminified size, more for hand-written CSS that has lots of whitespace and comments. Pre-built frameworks (Tailwind, Bootstrap) are usually already close to minified.
- Will minification change how my CSS renders?
- No. The clean-css library preserves selector specificity, property order, and the cascade. Only whitespace, comments, and redundant characters (like trailing semicolons) are removed.
- Are CSS Custom Properties and at-rules safe?
- Yes. --variable definitions, @media queries, @keyframes, @supports, @layer, and other at-rules are preserved with their internal structure intact.
- Will it merge or shorten color values?
- Common shortenings are applied (#FFFFFF \u2192 #FFF) but the minifier does not aggressively merge selectors or rewrite property values, so the result is byte-for-byte equivalent in behavior to the input.
- Are CSS comments removed?
- Yes. Block comments (/* \u2026 */) are stripped. Use the CSS Formatter to add comments back during development; minify only for production.
- Does minification happen in the browser?
- Yes. The clean-css library runs locally; CSS never leaves your machine.
Related tools
How to use
- Paste your CSS. Any valid CSS.
- Copy the minified output. Smaller payload, same styles.
Common use cases
- Shrinking stylesheets for production
- Inlining critical CSS
- Reducing CDN bandwidth
- Embedding small CSS snippets in style attributes or single-file HTML emails
Frequently asked questions
- How much smaller does minified CSS get?
- Typical savings are 15% to 30% off the unminified size, more for hand-written CSS that has lots of whitespace and comments. Pre-built frameworks (Tailwind, Bootstrap) are usually already close to minified.
- Will minification change how my CSS renders?
- No. The clean-css library preserves selector specificity, property order, and the cascade. Only whitespace, comments, and redundant characters (like trailing semicolons) are removed.
- Are CSS Custom Properties and at-rules safe?
- Yes. --variable definitions, @media queries, @keyframes, @supports, @layer, and other at-rules are preserved with their internal structure intact.
- Will it merge or shorten color values?
- Common shortenings are applied (#FFFFFF \u2192 #FFF) but the minifier does not aggressively merge selectors or rewrite property values, so the result is byte-for-byte equivalent in behavior to the input.
- Are CSS comments removed?
- Yes. Block comments (/* \u2026 */) are stripped. Use the CSS Formatter to add comments back during development; minify only for production.
- Does minification happen in the browser?
- Yes. The clean-css library runs locally; CSS never leaves your machine.