1001Ferramentas
📦 Dev

CSS Minifier

Minify CSS by removing comments, extra whitespace and line breaks. Reduces file size without changing behavior.

Antes: 0 bytes · Depois: 0 bytes · Economia: 0%

Fewer CSS bytes, right in the browser

You have a block of CSS full of comments and indentation and want the compact version to inline in a style tag, drop into an HTML email or fit into a size-limited field, without installing anything or setting up a build. Just paste it: the minified output updates as you type, with byte counts before and after and the percentage saved shown right above the result.

Under the hood this is regex-based minification, not a parser: the tool strips comments, collapses whitespace and line breaks, and removes spaces around braces, colons, semicolons, commas and combinators. It does not rewrite values, so #ffffff does not become #fff and 0px does not become 0. And because it has no notion of context, there is one real gotcha with calc(): spaces around the + sign get removed, and calc requires whitespace around + and -, so calc(100% + 20px) comes out invalid.

It works well for everyday stylesheets: selectors, properties, media queries. Before shipping the result, check two spots: calc() expressions with addition or subtraction, which need their spaces put back by hand, and strings in the content property, which can lose internal spaces around commas. For a production pipeline, a parser-based minifier like cssnano optimizes further without those risks. Nothing you paste ever leaves your browser.

Frequently asked questions

Can the minification break my CSS?
It can, in two known cases: calc() with + or - loses the mandatory spaces around the sign, and strings inside content may have spaces stripped. Beyond that the transformation is safe; double-check those spots in the output.
How much can I actually save?
It depends on how much commentary and indentation the file carries; the byte counts on screen show the exact gain for your case. If your server already serves gzip or brotli, the extra savings over the wire are smaller than the raw difference suggests.
Does the CSS I paste go to a server?
No. The minification happens entirely in your browser, in JavaScript; the pasted text is never sent anywhere.

Related Tools