Skip to main content

CSS Minifier

Runs locally

Compress CSS stylesheets while preserving calc() expressions and showing byte savings.

What is CSS Minifier?

Strip comments and unnecessary whitespace from CSS stylesheets while keeping calc() expressions, strings, and data URIs intact.

How to use CSS Minifier

  1. Step 1

    Paste CSS into the input editor.

  2. Step 2

    Inspect byte savings in the status bar.

  3. Step 3

    Copy or download the minified .min.css file.

Features

  • Preserves calc() operator spacing and quoted URLs
  • Strips block comments cleanly
  • Exact byte savings percentage indicator
  • Instant switch to Format, Sort, or Tailwind mode
  • 100% client-side execution

Example

Input

/* card */
.card {
  width: calc(100% - 2rem);
  padding: 1rem;
}

Output

.card{width:calc(100% - 2rem);padding:1rem}

Removes comments and whitespace without breaking calc() spacing.

Frequently asked questions

Will this break calc(100% - 20px)?

No. Spacing inside parentheses for math functions is preserved.

Are my CSS files uploaded?

No, everything runs locally in your browser.

Can I sort properties before minifying?

Yes, use the Sort mode or CSS Formatter options.

Does it support CSS variables?

Yes, custom properties (--var) and OKLCH colors are preserved cleanly.