Developer Tools

CSS Minifier

Compress CSS by removing comments and unneeded whitespace; see exactly how much you save.

Paste CSS and press Minify to see size savings.

What is a CSS minifier?

CSS minification shrinks a stylesheet by removing comments, collapsing whitespace, dropping the last semicolon in each rule, and shortening zero values — all without changing how the page looks. Smaller CSS downloads and parses faster, which improves page-load times and Core Web Vitals scores. This minifier is careful with quoted strings (font names, content values, URLs), extracting them before touching anything so their contents are never altered, and it shows the exact bytes saved.

How to use this tool

  1. Paste your CSS into the input box.
  2. Press Minify — comments are stripped, whitespace around braces, colons, and semicolons is removed, and zero units are shortened.
  3. Check the size-savings card for original vs minified bytes and the percentage saved.
  4. Copy the output or download it as a .css file, then verify your pages still render correctly.

Key features

Common use cases

Practical tips

Frequently Asked Questions

Will minified CSS look any different in the browser?
No. Every transformation — comment removal, whitespace collapsing, dropping the last semicolon — is defined to be visually identical. Always keep the original for editing and spot-check the minified file once.
Why are quoted strings protected?
Values like content: "a ; b" or font-family: "My Font" contain characters and spaces that are significant. The minifier extracts strings first so they are restored byte-identical.
Is calc() safe with this minifier?
Yes. Spaces around - and + inside calc() are required by CSS, and this minifier only removes whitespace around a fixed set of characters that never includes them.
How much smaller does CSS get?
Typically 20–40% for hand-written CSS with comments and indentation. The tool shows your exact before/after sizes.
Does it handle @media queries?
Yes. Media query structure is preserved, including the mandatory space in 'and (min-width: ...)'. Only genuinely redundant whitespace is removed.