Home/Dev Tools/CSS Minifier

CSS Minifier

Minify

Minify CSS for production. Remove whitespace, comments and redundant rules.

Input
Loading editor…
Output
Loading editor…
✨ AI Code Explanation
Mode

What is a CSS Minifier?

A CSS minifier compresses stylesheets by removing whitespace, comments, and redundant characters — producing the smallest valid CSS that applies identically to the page. Minified CSS reduces HTTP response size and improves page load speed and Lighthouse / Core Web Vitals scores. CSS is render-blocking — the browser refuses to paint until your stylesheets are downloaded and parsed — so every byte saved directly affects how quickly users see your page.

CSS Minifier Online — What This Tool Does

This free CSS minifier strips comments, collapses whitespace, and removes redundant characters from your stylesheet — entirely in your browser. Shows exact byte savings and percentage reduction live. Built for production deploys, CDN uploads, and one-off stylesheet compression outside a build pipeline.

How to Minify CSS Online

  1. Paste your CSS into the Input pane, or click Upload to load a file.
  2. Click Minify — compressed output appears instantly in the right pane.
  3. The size badge shows Original, Minified, and % Saved.
  4. Enable ⚡ Live mode to auto-minify as you type (400 ms debounce).
  5. Use Copy or Download to save as minified.css.
  6. Click Explain with AI for a plain-English explanation of what the original CSS does.

What Gets Stripped?

  • Comments/* … */ blocks removed entirely.
  • Whitespace — spaces and newlines around selectors, properties, and values.
  • Redundant spaces — collapsed around {, }, :, ;, and ,.

How Much Can CSS Minification Save?

Typical CSS files see 20–40% size reduction from minification. Combined with gzip/Brotli server compression, total savings often exceed 80%. The size badge shows the exact byte saving for your stylesheet.

CSS Minifier vs. CSS Formatter

Use the CSS Formatter to make CSS readable for development, and the CSS Minifier to compress it for production deployment. The two operations are complementary — format in dev, minify in CI/CD.

Tips & Tricks

  • Minify per-component, not just bundle — Critical CSS extracted for above-the-fold content benefits most from minification (smaller inline CSS = faster paint).
  • Gzip / Brotli stack on top — server compression is gzip-friendly to whitespace, so post-gzip savings shrink (~10–15%). The bigger win is parse-time on the client.
  • Combine with formatter for refactoring — minify a stylesheet, then format the result. This normalises styles, making diffs cleaner.
  • Production-only — never serve minified CSS in development. Debugging unreadable CSS is painful and source maps help only so much.
  • Watch for legacy CSS hacks — some old CSS uses comment-based hacks (* /*\**/) that minification strips. If you support old browsers, audit the output.

Related Tools

Is My Code Sent to a Server?

No. CSS minification runs entirely in your browser. Your stylesheet — including any custom-property tokens, brand colours, or proprietary design system code — never leaves your machine. There is no upload, log, or analytics on the CSS you process.