People quote minification savings the way they quote fuel economy: one confident number, measured on someone else's file. A stylesheet is not a standard test, though. One file is dense hand-written rules with barely a comment; the next carries a paragraph of explanation above every section and generous indentation throughout. The same minifier, doing the same work, saves modestly on the first and dramatically on the second.
So the useful question is not what percentage minification saves in general. It is what it saves on your file, and why. This guide uses the free CSS Minifier on Ovatly to answer both with counted characters rather than folklore: the tool reports characters in, characters out and the percentage saved for every stylesheet you run through it.
Contents
- Quick answer
- Where the saved characters come from
- What is protected, so the count stays honest
- How to measure your own file, step by step
- Worked examples with counted characters
- Why two files save such different percentages
- What this minifier deliberately leaves on the table
- Common mistakes
- FAQs
- Conclusion
Quick answer
Paste your stylesheet into the CSS Minifier and press Minify CSS. The size report gives you the only answer that matters for your file: characters in, characters out and the percentage saved. As a calibration point, the tool's own example rule, body { margin: 0; padding: 0; }, is 31 characters in and 24 out, saving 7 characters or about 23 percent. A commented, well-spaced stylesheet will save more than that; a tight, comment-free one will save less. Expect a range, and measure rather than guess.
Where the saved characters come from
The minifier removes three things, and only three. Comments go first: every explanation you wrote for the next developer is pure cost to a browser. Whitespace is collapsed next, so the line breaks, tabs and runs of spaces that made the file readable shrink to the minimum the syntax allows. Finally, spaces around punctuation are dropped: the gaps after braces, colons and semicolons that padded out every declaration.
That list explains the variance in savings. A stylesheet's removable share is exactly its comments plus its layout. A file with a comment block above each section and deep indentation might carry a third of its characters as layout; a compact, comment-free file might carry almost none. The minifier's work is identical; the raw material is not. It also explains why real files usually save more than toy examples: they accumulate comments and indentation line after line, and every one of those characters is removable.
What is protected, so the count stays honest
A saving would be easy to inflate by removing spaces that actually matter, and then the number would be measuring breakage. This minifier protects the cases where whitespace carries meaning, which is why its figures can be trusted.
Descendant selectors keep their spaces: in .nav ul li, the gaps are the selector, and removing them would produce a broken rule. Spaces inside calc(), min(), max() and clamp() are preserved where the specification requires them, so calc(100% - 20px) keeps the spaces around its minus sign. Strings and url(...) values, including data URIs, are copied verbatim, because one altered character inside a data URI corrupts the asset it encodes.
The reported saving, then, comes only from changes that cannot alter what the stylesheet does. That is the only kind worth quoting.
How to measure your own file, step by step
- Keep your original stylesheet as the file you edit. The measurement, and the minified output, apply to a copy.
- Open the CSS Minifier and paste your CSS into the input box.
- Press Minify CSS.
- Read the size report: characters in, characters out and the percentage saved. Those three numbers are the answer for your file.
- Copy or download the minified CSS, and load your critical pages once to confirm everything renders as before, especially if the stylesheet uses unusual hacks.
Worked examples with counted characters
Start with the example the tool itself uses. The input rule is 31 characters:
body { margin: 0; padding: 0; }
The output is 24 characters:
body{margin:0;padding:0}
Seven characters removed, about 23 percent saved. Every one is accounted for: the spaces around the braces, after the colons and before the closing brace. Nothing else moved, and the rule means exactly what it meant.
The second example shows protection changing the arithmetic. .nav ul li { margin: 0 10px; } is 30 characters in and comes out as .nav ul li{margin:0 10px} at 25 characters, a saving of about 17 percent. The percentage is lower than the first example, and correctly so: the spaces between the selector parts and the space inside 0 10px are meaningful, so they stay, and fewer characters are removable.
Now a realistic block, with a comment and normal indentation:
/* Product card */
.card {
background: #ffffff;
border: 1px solid #dddddd;
padding: 16px;
}
.card h2 {
font-size: 20px;
margin: 0 0 8px;
}
That is 149 characters. Minified by the CSS Minifier, it comes out at 102 characters:
.card{background:#ffffff;border:1px solid #dddddd;padding:16px}.card h2{font-size:20px;margin:0 0 8px}
47 characters removed, about 32 percent saved. Note what survived: #ffffff is still six digits, because this tool does not rewrite values; the spaces inside 1px solid #dddddd and 0 0 8px remain, because they separate values; and .card h2 keeps its descendant space. The comment alone was 18 of the original characters: comments and indentation were nearly a third of the file.
Why two files save such different percentages
Three habits decide your number. Comment density is the biggest: a stylesheet documented section by section carries far more removable text than a terse one. Indentation style is next: deep indents and blank lines add up across thousands of lines. Rule shape matters too: many short rules have proportionally more braces, colons and line breaks per declaration than a few long ones, so they shed a larger share.
None of this makes one file better than another. A high saving usually means the source was written generously for human readers, a virtue in the file you maintain. The minified copy exists so the maintained file does not have to compromise.
What this minifier deliberately leaves on the table
This is a careful whitespace and comment minifier, and its own notes state the boundary plainly. It does not rename classes, merge rules or remove unused CSS, and it does not shorten colors or strip units from zero values. Savings are therefore smaller than a build pipeline like Lightning CSS would give, because a pipeline performs those riskier rewrites as part of a tested build.
That gap is the honest price of the tool's guarantee: every transformation it performs cannot change meaning, and it runs in your browser with nothing uploaded. If your project already runs a build pipeline, use it for production files. This tool earns its place for stylesheets outside a build system, and for a trustworthy measurement before you decide a file needs heavier treatment.
Common mistakes
- Quoting someone else's percentage. Savings depend on the source file's comments and layout. Measure your own stylesheet and quote your own size report.
- Expecting the tool to remove unused CSS. It does not detect dead rules. Deleting rules is a separate, riskier job that needs knowledge of your pages.
- Comparing against a pipeline and calling the tool weak. A full optimizer rewrites values and merges rules; this minifier deliberately does not. The smaller number reflects a narrower, safer job.
- Overwriting the readable source. The saving comes from removing what humans need. Keep the commented, indented file for editing and regenerate the minified copy when it changes.
- Skipping the render check. Ordinary stylesheets are safe, but one load of your critical pages catches the rare hack that depended on formatting.
FAQs
Is the minified CSS safe to deploy? For ordinary stylesheets, yes: comments and redundant whitespace have no effect on rendering. As with any minifier, test critical pages once after switching, especially if your CSS uses unusual hacks.
Why does it not shorten colors or remove zero units? This tool sticks to transformations that cannot change meaning. Value rewriting, like turning #ffffff into #fff, is a job for a full CSS optimizer in your build pipeline.
Does it handle SCSS or Less? No. It expects plain CSS. Nested rules from preprocessors will not be understood correctly, so compile to CSS first.
What does the minifier remove, and what does it protect? It removes comments, collapses whitespace and drops spaces around punctuation. Strings and url(...) values, including data URIs, are copied verbatim and never reshaped, and spaces inside calc(), min(), max() and clamp() are preserved where the CSS specification requires them.
How is the percentage saved worked out? From the size report the tool shows after minifying: characters in, characters out and the percentage saved, which is the characters removed divided by the characters you started with.
Conclusion
The right answer to how much smaller minification makes a file is a measurement, not a slogan, and the CSS Minifier hands you that measurement for your stylesheet: characters in, characters out, percentage saved. Run yours before believing anyone's number. If the markup side of the page is what needs rescuing first, the sibling guide on how to clean up HTML pasted from a CMS or word processor covers that cleanup, and the rest of the series lives in the Developer Tools guides archive.