Skip to content
FizzKit

CSS Minifier

Remove comments, whitespace and redundant syntax from CSS while preserving behavior: strings, url(), calc()/min()/max()/clamp() bodies, pseudo-selectors and /*! license comments stay intact. Shorten values (0px → 0, #ffffff → #fff), optionally merge rules with identical selectors, see real gzip sizes, and get precise errors for unbalanced braces.

Runs locally in your browser
For long CSS, open fullscreen for a wider view
CSS input
786 chars · 47 lines
Minified
/*! FizzKit landing page styles — license header is preserved */.hero{padding:80px 32px;background-color:#fff;color:#111827}.hero h1{font-size:48px;line-height:1.1;margin-bottom:24px;font-weight:600}.hero .cta{display:inline-flex;align-items:center;gap:8px;width:calc(100% - 2*16px);background:#6366f1 url("img/sparkle.png") no-repeat;color:#fff;padding:12px 24px;border-radius:8px;transition:all .15s ease-in-out}.hero .cta::after{content:"  →  "}.hero .cta:hover{background-color:#4f46e5;transform:translateY(-1px)}.hero{margin:0 auto}@media (prefers-color-scheme:dark){.hero{background-color:#0a0a0a;color:#fafafa}}
Input size
790 B
Output size
622 B
Saved
168 B
Compression
21.3%
Gzip (output)
—
Rules
7
License comments
1

Strings, url(), calc()/min()/max()/clamp() bodies and pseudo-selectors are preserved as written. Unbalanced braces are reported with the offending line. Need it pretty-printed? Use the HTML / CSS Prettifier's Beautify mode.

How to use CSS Minifier

  1. 1Paste or upload CSS — the minified output and the size savings appear immediately.
  2. 2Toggle value shortening and comment retention; /*! license */ comments are always kept.
  3. 3Enable duplicate-selector merging to combine repeated rules (also inside matching @media blocks), then check the output.
  4. 4Fix any unbalanced brace the tool points to by line number, then copy or download styles.min.css.

About CSS Minifier

Remove comments, whitespace and redundant syntax from CSS while preserving behavior: strings, url(), calc()/min()/max()/clamp() bodies, pseudo-selectors and /*! license comments stay intact. Shorten values (0px → 0, #ffffff → #fff), optionally merge rules with identical selectors, see real gzip sizes, and get precise errors for unbalanced braces.

CSS Minifier is part of FizzKit — a collection of focused developer and ad-tech tools. Because everything runs locally, it works offline once loaded and never exposes your data to a remote server.

Frequently asked questions

Yes with the default options. Only insignificant characters are removed; media queries, cascade order and specificity are preserved. Duplicate-selector merging is opt-in because it can reorder rules relative to other selectors.