CSS Minifier
Client-side CSS minification with real AST-level optimization. Live output.
How to use
Paste CSS into the input pane. The minified output appears on the right as you type (300ms debounce).
Toggle Restructure for aggressive optimization — merging duplicate selectors, hoisting common declarations, dropping unused rules. Turn it off if you need the output to preserve source order and structure.
Pick a Comments mode: None strips everything, Exclamation keeps /*! */ license banners, All preserves every comment.
Keyboard shortcuts
Two shortcuts:
| Cmd / Ctrl + K | Focus the input pane |
| Cmd / Ctrl + Enter | Copy output to clipboard |
When to use it
CSS minification saves bytes on production stylesheets, especially large frameworks or handwritten design systems.
- Shipping a hand-authored stylesheet to a CDN without a build pipeline.
- Checking how small a snippet becomes before wiring it into a bundler.
- Compressing inline critical CSS for above-the-fold rendering.
- Cleaning up copy-pasted CSS from a design tool.
When not to use: If you have a build pipeline (webpack, Vite, PostCSS), minify there — the output can then be integrated with source maps and hashed filenames.
Options
Restructure — enables csso's AST-level optimizations: merge duplicate selectors, hoist shared declarations, remove unused rules from selector groups, optimize shorthand properties. Turn off if you need output that mirrors source structure line-for-line.
Comments:
- None — strips every comment.
- Exclamation — keeps only
/*! ... */-style comments (used for license headers). Standard for open-source CSS. - All — preserves every comment.
Format-specific gotchas
Restructure can reorder rules. Merging duplicate selectors and hoisting common declarations changes source order. If your CSS relies on specific declaration order for the cascade (rare but possible), turn Restructure off.
CSS variables are preserved. --custom-prop definitions and var(...) references pass through unchanged.
Vendor prefixes are preserved. csso doesn't remove -webkit- or -moz- prefixes unless they're unambiguously redundant. Use autoprefixer's --remove upstream if you want them dropped.
Unknown at-rules pass through. Non-standard at-rules (some framework macros) are kept as-is.
csso loads on first use. First minify triggers the library download; subsequent runs are instant.
Privacy
Everything runs in your browser. Your CSS never leaves the page — no server, no logging, no analytics on the content.