CSS Minifier

Paste your CSS to remove comments and unnecessary whitespace, producing a compact single-line stylesheet. The tool shows how many bytes you save. Everything runs in your browser — your code is never uploaded.

Paste CSS, then press Minify CSS.

What minifying removes

Minifying CSS strips every character a browser does not need: comments, line breaks, indentation, and the spaces around braces, colons, semicolons and commas. The rules and values are untouched, so the page renders identically — it just downloads faster.

saved % = (original − minified) ÷ original × 100

Because CSS is whitespace-insensitive between tokens, removing it is safe. The minifier also drops the final semicolon before each closing brace, which the spec allows, shaving a few more bytes off large files.

Worked example

The rule on the left collapses to the compact form on the right:

Before: .card { color: #333; padding: 16px 20px; }
After: .card{color:#333;padding:16px 20px}
Saving: roughly a third of the bytes on typical hand-written CSS.

What it keeps safe

The minifier preserves strings, url() values and the meaningful single spaces inside multi-value properties like margin: 0 auto or font: 14px/1.5 sans-serif, where the space separates real values. It only collapses insignificant whitespace, so your styles behave exactly the same. Everything is processed locally, so proprietary stylesheets never leave your browser.

Tip: minifying scripts or markup too? Use the JS minifier and the HTML minifier.

Frequently asked questions

Does minifying change how my CSS works?

No. Only comments and insignificant whitespace are removed; every selector, property and value stays the same, so the rendered page is identical — it just loads faster.

How much smaller will my file be?

Hand-written, well-indented CSS typically shrinks 25–45%. Files that are already compact save less. The tool shows your exact percentage after minifying.

Are meaningful spaces preserved?

Yes. Spaces that separate real values — such as in margin: 0 auto or font shorthands — are kept. Only redundant whitespace around punctuation is collapsed.

Is my CSS uploaded?

No. The minifier runs in your browser with plain string processing. Nothing you paste is sent to a server.

MB
Mustafa Bilgic · Editor, Calcool
Removes comments and collapses insignificant whitespace per the CSS syntax rules; meaningful spaces in multi-value properties are preserved. Everything runs in your browser - nothing you enter is uploaded, logged or stored.

Related calculators