CSS Minifier

Compress your stylesheet by stripping comments, whitespace and redundant syntax. Paste CSS below, minify it, and see exactly how many bytes you save.

css-minifier · runs locally

What this CSS minifier does

Every byte of CSS blocks rendering: the browser must download and parse your stylesheet before it paints the page. A CSS minifier shrinks that payload by deleting everything the parser does not need — comments, indentation, line breaks and redundant characters — while leaving the rules themselves untouched. Smaller CSS means a faster first paint, which users feel and search engines measure through Core Web Vitals.

This minifier also applies two safe micro-optimizations: it drops the semicolon before each closing brace and removes units from zero values, since 0px, 0em and plain 0 are equivalent.

How to minify CSS online

  1. Paste your stylesheet into the input box.
  2. Click Minify CSS.
  3. Check the before/after byte counts.
  4. Copy the compressed CSS into your page, theme or CMS.

Where minified CSS matters most

The biggest wins are places without a build pipeline: custom CSS fields in WordPress, Shopify or Webflow, inline styles in HTML emails, embedded widgets, and quick static pages. If you are also shipping JSON data with the page, pair this with the JSON Minifier to trim both payloads.

Frequently asked questions

What does a CSS minifier remove?

Comments, line breaks, indentation, spaces around braces and colons, the final semicolon in each rule, and units on zero values (0px becomes 0). The rendered result is identical — browsers ignore all of that whitespace anyway.

How much does minification shrink a stylesheet?

Typically 10–30% for hand-written CSS, depending on commenting and formatting style. Combined with gzip or Brotli compression on your server, the delivered size drops much further — the two techniques stack.

Can minified CSS break my site?

Whitespace and comment removal is safe for valid CSS. The one caution: if your stylesheet relies on CSS hacks involving comments or is already malformed, review the output. For production build pipelines, a full parser-based minifier like cssnano or Lightning CSS is the robust choice; this tool is ideal for quick one-off jobs.

Should I minify CSS during development?

No — keep source files readable and minify only what you ship. Most frameworks do this automatically at build time. This online tool is for the cases without a build step: quick landing pages, email templates, CMS custom-CSS boxes and code snippets.