CSS Minifier

Minify your CSS code to reduce file size and improve load times.

css
minify
compress
optimization
performance

About this tool

Strip every byte your browser doesn't need — comments, trailing semicolons, redundant whitespace, and the blank lines that make authored CSS readable but ship overhead. Useful when you're inlining critical CSS into a transactional email, packing styles into a one-file HTML snippet, hand-optimising an above-the-fold block that bypasses your bundler, or just seeing how much weight your stylesheet carries without its indentation. The tool preserves every declaration, selector, and cascade order exactly as authored — the rendered result is byte-for-byte identical to the original, just smaller. You'll see the compression ratio after each run so you can tell at a glance whether a stylesheet is already lean or still has a lot of redundancy. Everything runs locally: we never see your styles, which matters for unreleased product CSS.

Features

  • Minify CSS by removing whitespace and comments
  • Track compression ratio and file size savings
  • Preserve CSS functionality while reducing size
  • Copy minified output to clipboard

How to Use

  1. Paste your CSS code into the input field
  2. Click "Minify" to compress the CSS
  3. Review the compression ratio and size savings
  4. Copy the minified CSS for production use

Frequently Asked Questions

Do I still need to minify if my site is served with gzip or Brotli?

It still helps, but the gain is smaller. Gzip already compresses repeated whitespace and common tokens well, so minified + gzipped is typically 5–15% smaller than original + gzipped — worth it on critical path CSS, marginal on already-bundled stylesheets.

Will minifying break my CSS?

No — minification only removes insignificant whitespace and comments. Selectors, specificity, and cascade order are preserved exactly. The one thing to double-check is that you haven't relied on a comment as a feature flag; once minified, /* keep */ markers are gone.

How is this different from what my build tool does?

Webpack, esbuild, and Lightning CSS also minify in production builds. This tool is for the cases where you don't have that pipeline — email templates, one-off HTML files, quick copy-paste into a CMS, or inlining critical CSS into a head tag.

Will minifying a CSS file break source maps?

Yes — once whitespace and line breaks are gone, line-and-column references in an old source map point to nonsense. Regenerate the source map from the minification step, or do minification as part of your build pipeline so the map is emitted alongside.

Can I un-minify CSS I've lost the original source for?

Yes. Paste it into any formatter and it'll re-indent and add line breaks. You won't get the original comments or variable names back, but the rules, selectors, and specificity round-trip losslessly — minification is deterministic and reversible in that sense.