CSS Minifier
Conservatively compact CSS whitespace while retaining quoted values, comments, and token separators. Runs entirely in your browser.
Why Minify CSS? — Faster Rendering and Better Page Performance
This tool performs conservative CSS whitespace compaction, not full production optimization. It reduces repeated whitespace outside protected tokens without rewriting selectors or values.
What This Tool Preserves
- Quoted strings, URLs, escapes, and comments are retained.
- Operator separators, units, and semicolons are not removed.
- No unused-rule removal, value rewriting, or browser compatibility analysis is performed.
CSS Minification Savings
Savings depend on repeated whitespace and may be small or zero. Comments and value syntax are deliberately retained. For stronger optimization, use a tested parser-based build tool and measure the compressed result.
CSS Performance Optimization Tips
- Minify in your build pipeline — Use cssnano, clean-css, or PostCSS in Webpack, Vite, or Gulp
- Critical CSS inlining — Inline above-the-fold CSS in
<style>tags and defer the rest - Remove unused CSS — Use PurgeCSS or UnCSS to eliminate selectors not used in your HTML
- Enable server compression — Gzip or Brotli on Nginx, Apache, CDNs for additional 60—70% reduction
- Use CSS custom properties — Reduce repetition and total CSS size with
var(--color-primary)
Frequently Asked Questions
This conservative compactor protects strings, comments, URLs, and escapes and retains token separators. It is not a full CSS parser or validator; test your stylesheet in its target browsers before using the output.
Review and test the result first. This lightweight compactor is not equivalent to cssnano or a parser-based production pipeline, and deliberately skips more aggressive optimizations.
The tool does not rewrite at-rules or custom-property values. It compacts unprotected whitespace and retains comments. It does not validate CSS syntax or guarantee support for every extension.
Input processing is local to this tool. Shared page features may make network requests, and enabled browser drafts may retain text locally. Avoid pasting credentials or confidential material.
This tool compacts source whitespace; gzip/Brotli encodes bytes for transfer. They can be combined, but savings depend on the input and server settings and are not guaranteed.