About CSS Minifier
Compact CSS for production. Drops comments, whitespace, last semicolons in rule blocks. Optional zero-unit cleanup (<code>0px</code> → <code>0</code>) and shorthand collapse (<code>margin: 1px 1px 1px 1px</code> → <code>margin: 1px</code>). Reports byte savings.
When to minify CSS
Your build tool likely already does it (Vite, Astro, Next, esbuild — all minify in production). Reach for this manually when:
- Optimizing a small inline
<style>block - Hand-optimizing a critical CSS extract
- Quickly seeing how much your CSS shrinks
- Compacting a third-party stylesheet for embed
Common workflows
Inline critical CSS. Minify the above-the-fold styles, embed in <head>. Saves a render-blocking request.
Audit gzip ratio. Minify → gzip mental model. Well-written CSS gzips to ~25% of source; minify shaves another 10% before gzip applies.
Compact a vendor stylesheet. Embedded CSS from a third-party widget often arrives unminified. Compact before embed.
Frequently asked questions
Will it break my CSS?
How much savings?
Will it sort or rename?
Custom properties?
--color-accent stays as --color-accent.For Tailwind output?
For SCSS / LESS?
Related tools
Last updated: 2025-01-15