Accueil CSS Minifier

CSS Minifier

Shrink your CSS by removing comments, whitespace and redundant characters — with live size stats, copy and download, 100% in your browser.

Input CSS

Output

Original
Minified
Saved

What is CSS minification?

CSS minification is the process of removing unnecessary characters from a stylesheet without changing how the browser interprets it. The minifier strips comments, whitespace, line breaks, trailing semicolons and other redundant bytes, producing a functionally identical file that is significantly smaller. A typical minified CSS file is 20–40% smaller than its original, well-formatted source.

Because browsers parse CSS exactly the same way before and after minification, the visual output is unchanged — only the file size and parse time improve. This makes minification a zero-risk optimisation that every production website should apply as part of its build process.

Why minify CSS?

Minifying CSS delivers three concrete benefits for production websites. First, smaller files download faster over the network, which is especially valuable on mobile connections and for users with limited data plans. Second, the browser parses the stylesheet more quickly, reducing the time before the page can render. Third, minified files compress better with gzip and Brotli, amplifying the savings at the transfer layer.

For a site with several large stylesheets, the combined savings can be substantial — shaving tens or hundreds of kilobytes from every page load. This improves Core Web Vitals scores such as Largest Contentful Paint and First Contentful Paint, which search engines use as ranking signals.

What gets removed during minification?

A thorough CSS minifier removes several categories of non-functional content while preserving the stylesheet's behaviour:

  • Comments/* ... */ blocks are stripped entirely, since they have no effect on rendering.
  • Whitespace — leading, trailing and multiple consecutive spaces are collapsed or removed.
  • Line breaks — newlines and tabs are removed, joining rules onto fewer lines.
  • Trailing semicolons — the last semicolon before a closing brace is unnecessary and is removed.
  • Units on zero values0px, 0em and similar become simply 0.
  • Redundant separators — spaces around {, }, : and ; are removed.

This converter applies a safe set of these transformations. It does not aggressively rewrite selectors or property values, so the output remains easy to verify and debug.

When to minify CSS

Minification belongs at the end of your build pipeline, applied to the files you ship to production. The typical workflow is to write clean, well-commented CSS during development, then run a minifier as part of the deploy step. Common moments to minify include:

  • Production builds. Run minification automatically through Webpack, Vite, Rollup or another bundler before publishing.
  • Quick one-off optimisation. Paste a hand-written stylesheet into this tool to get a smaller copy for a static site or email template.
  • Auditing third-party CSS. Minify a vendor stylesheet that ships unminified to reduce its footprint.
  • Email and embed templates. Inline CSS in HTML emails benefits from minification to stay under size limits.

Always keep the original, readable stylesheet as your source of truth — the minified version is a generated artefact, not something to edit by hand.

Minification vs compression

CSS minification and HTTP compression (gzip or Brotli) are complementary, not interchangeable. Minification removes redundant characters from the source text, while compression encodes the transferred bytes more efficiently. Applying both gives the smallest possible transfer size: minification first, then server-side compression on the response.

Even after gzip, a minified file is usually smaller than an unminified one, because minification removes patterns that compression cannot fully eliminate (such as comments and structural whitespace). For best results, enable minification in your build tool and gzip/Brotli on your web server or CDN.

Is this CSS minifier free?

Yes, completely free with no sign-up, no limits beyond your device's memory, and no upload — everything runs locally.

Will minification break my CSS?

No. This tool only removes characters that have no effect on how the browser interprets the stylesheet. The rendered output is identical.

Should I minify CSS during development?

No — keep readable CSS while developing so you can debug easily. Minify only when building for production.

Does this replace gzip/Brotli?

No. Minification and compression work together — minify first, then let your server compress the response for the smallest transfer size.

Are my stylesheets uploaded?

No. All processing is local. Your CSS never leaves your browser.