CSS Minifier
Minify CSS with advanced options. Remove comments, collapse whitespace, shorten hex colors, remove zero units — all locally in your browser.
Aggressive Minification
Strip comments, collapse whitespace, remove empty rules, and shorten redundant values. Every byte counts.
Smart Shortening
Shorten hex colors, font-weight keywords, zero units, and leading decimals. Preserve functionality while shrinking the file.
Private & Local
Everything runs in your browser. Your stylesheets — including proprietary selectors and design tokens — never leave your device.
Why minify CSS?
Minified CSS files are smaller and transfer faster over the network, improving page load times and Core Web Vitals. Every byte saved contributes to a faster, more responsive website — especially important for mobile users on slower connections.
What each option does
- Remove comments — strips all
/* … */comment blocks. - Collapse whitespace — removes extra spaces, tabs, and line breaks.
- Remove empty rules — deletes selectors with no declarations.
- Remove last semicolons — drops the final semicolon before each closing brace.
- Remove zero units — converts values like
0px,0emto just0. - Shorten hex colors — compresses 6-digit hex codes like
#ffffffto 3-digit#fff. - Shorten font-weight — replaces
normalwith400andboldwith700. - Remove quotes from url() — drops unnecessary quotes around URLs.
- Remove leading zeros — converts
0.5to.5.
When not to minify
Only minify the version you ship to production. Keep the original, un-minified file in version control and as your source of truth. If you work with CSS preprocessors like Sass or Less, minify the compiled output, not the source files.
Frequently asked questions
›What is a CSS minifier?
A CSS minifier removes unnecessary characters — like whitespace, comments, and redundant syntax — from a stylesheet without changing how the browser renders it. The result is a smaller file that downloads faster.
›Is this CSS minifier safe to use?
Yes. All processing happens entirely in your browser (client-side). Your CSS is never uploaded to a server, so it stays completely private and secure.
›What minification options does this tool offer?
You can toggle: remove comments, collapse whitespace, remove empty rules, remove trailing semicolons, remove zero units (0px → 0), shorten hex colors (#ffffff → #fff), shorten font-weight values (normal → 400), remove quotes from url(), and remove leading zeros (0.5 → .5).
›Will minifying CSS break my styles?
No. The minifier only removes characters that the browser ignores anyway — extra whitespace, comments, and redundant syntax. It does not alter actual property values or selectors in a way that changes rendering.
›How much smaller will my CSS get?
Typical savings range from 10% to 40%, depending on how verbose your original CSS is. The tool shows real-time byte count and percentage reduction so you can see the exact savings instantly.
›Can I upload a .css file?
Yes. Click the 'Upload .css' button to load a stylesheet directly from your computer. You can also download the minified result as a .css file.
›Does this tool minify CSS inside HTML <style> tags?
This tool is designed for pure CSS. If you have CSS embedded in HTML, you should first extract the CSS, minify it here, and then paste it back. For full HTML minification including inline CSS, use our HTML Minifier tool.
›Does it support CSS variables (custom properties)?
Yes. The minifier preserves CSS custom properties (--var-name) and their values correctly. It will not alter or remove CSS variables.
›Can I use this CSS minifier in my build pipeline?
This is a browser tool for quick, one-off minification. For production build pipelines, use dedicated tools like cssnano, clean-css, or esbuild which integrate with bundlers like Webpack, Vite, and Rollup.
More free developer tools
Part of our growing tool belt — all client-side, all free.
JSON Formatter & Beautifier
Format, beautify, minify and validate JSON with sort keys, ASCII escape, and tree view.
Open toolJSON Validator
Strict JSON validator with precise error location, lint hints, structure stats, and duplicate key detection.
Open toolJSON Viewer
Interactive JSON tree explorer with filter, copy-path, expand/collapse all, and colour-coded types.
Open tool