CSS Minifier

Compress CSS by stripping whitespace, comments, and redundant syntax - free, no signup required.

Input CSS
Minified Output
Original: 0 B Minified: 0 B Saved: 0.0%

CSS Full Form

CSS stands for Cascading Style Sheets - the language browsers use to style HTML. CSS source files are written with generous whitespace, comments, and readable formatting. Browsers don't need any of that to apply your styles, so minification strips it all away to produce a smaller, faster-to-download stylesheet.

What this tool does

When you need a CSS minifier

How to use it

  1. Paste a stylesheet into Input CSS, click Upload File to open a .css file, or click Load Sample.
  2. The minified CSS appears on the right as you type. Click Minify if you want to run it again.
  3. Check the stats line for the original size, the new size and the percentage saved.
  4. Click Copy, or Download to save the result as minified.css.
  5. Click Beautify to expand compressed CSS into one declaration per line, which is handy for reading a third-party stylesheet.

A worked example

This 80-byte rule:

/* Buttons */ .btn { padding: 0px 16px; color: #ffffff; margin: 0 auto; }

(written over several lines in a real file) becomes .btn{padding:0 16px;color:#fff;margin:0 auto}, which is 45 bytes, a saving of about 44%. The comment is gone, 0px is now 0 because a zero length needs no unit, #ffffff is now #fff, and the last semicolon before the closing brace has been dropped. The space in 0 auto stays, because removing it would change the value.

Spaces it keeps on purpose

The minifier reads the stylesheet token by token, so it knows where strings, comments, url() values and selectors start and end. Some spaces look redundant but change the meaning, so they stay:

The result applies exactly the same rules as your original. The tool does not merge rules or reorder properties; for those extra savings use a build tool such as cssnano or Lightning CSS.

Privacy

Everything runs locally in your browser. Your CSS is never sent to our servers, not even for analytics. You can minify proprietary design tokens, unreleased themes, or internal enterprise styles without them leaving your machine.

Frequently Asked Questions

Will minifying break my styles?
No. This tool performs only safe transformations - it never reorders selectors, merges rules, or removes any declarations. The resulting stylesheet has identical cascading behaviour to the original. If you rely on comment-based preprocessor directives (SASS, LESS, PostCSS), minify the compiled output, not the source.
How much can I realistically save?
Hand-written stylesheets shrink by 15-35%; frameworks like Tailwind or Bootstrap (already compact) shrink by 5-10%. After gzip or brotli the wire savings are smaller but still real. For the biggest impact, minify and then let your CDN compress.
Does it preserve !important and vendor prefixes?
Yes, !important, vendor prefixes, var(), custom properties, @supports, @media and @keyframes are kept. Spaces that change meaning are kept too: around + and - inside calc(), min(), max() and clamp(), and before a pseudo-class as in .menu :hover.
Is my CSS uploaded anywhere?
No. All minification happens in your browser. Nothing is sent to our servers, logged, or cached anywhere except the current browser tab. Refresh and it is gone.
Can I reverse the minification?
Click Beautify to pretty-print CSS - minified or not - with indentation and one declaration per line. Comments that were stripped are not recoverable, but selector and declaration structure is fully restored.
Should I use this or a build tool?
For a quick one-off minify, this tool is fastest. For a regular build pipeline, use a tool like cssnano, lightningcss, or your bundler's built-in minifier - they can apply additional optimizations (rule merging, property reordering) that require AST parsing. This tool is for when you need a clean minify in seconds without installing anything.