Skip to content
NewKitApp

Search tools

Jump to any tool by name

CSS Minifier

Strip comments and whitespace from CSS to shrink file size.

What is CSS Minifier?

CSS Minifier strips comments and unnecessary whitespace from a CSS file to shrink it down for production, entirely in your browser. It removes `/* ... */` comments, collapses every run of spaces, tabs, and newlines outside of quoted string values, and drops the redundant trailing semicolon right before a closing brace — all while carefully leaving quoted string values (like a `content` property's text) completely untouched, so nothing inside an actual string gets collapsed or altered. It shows you exactly how many bytes and what percentage you saved, so you can see the real impact before shipping the result.

How to Use CSS Minifier

  1. Paste your CSS into the input box.
  2. The minified result appears instantly below, along with the bytes and percentage saved.
  3. Copy the minified CSS with the copy button.

Examples

A commented, indented rule

Input: .a { /* accent color */ color: red; }

Output: .a{color:red}

Multiple declarations

Input: .a { color: red; background: #fff; }

Output: .a{color:red;background:#fff}

Common Mistakes

  • Minifying CSS as your only working copy — always keep a formatted, commented source file and minify a copy of it, not the other way around.
  • Expecting selector or property-level optimization (deduplication, shorthand merging) — this tool only removes whitespace and comments, not semantic redundancy.
  • Forgetting that minified CSS is much harder to debug in browser devtools — map back to source, or keep the beautified version handy.
  • Assuming a small file always means faster load — for most sites, gzip/Brotli compression already removes most of the benefit of manual whitespace stripping; this is still worth doing but isn't a silver bullet.

Why Use This Tool

  • Processes entirely client-side — your CSS never leaves your browser.
  • String literal contents are protected from whitespace collapsing.
  • Shows exactly how many bytes and what percentage were saved.
  • Instant, live minification with no submit button.

Frequently Asked Questions