OpenQR

Research

QR code error correction, explained with measurements: what 30% actually means

By OpenQR · updated 21 November 2026

Every generator's EC dropdown comes with the same folklore: level H "recovers up to 30% damage", so cover a third of the code with your logo and it will still scan. We build a QR code generator, this advice governs what our users print, and we could not find a measurement of it anywhere. So we ran one: 58,048 decode attempts across four pinned open-source decoders, plus a codeword-level audit that takes a real version-4 code apart block by block and counts exactly what a logo destroys. The short version: the 30% is real, it is just not about area. It is a restoration rate over codewords, a 16%-area logo already consumes 87.5% of the level-H budget, and error correction buys you two specific things, neither of which is the thing most people think they are buying.

8 min read · Updated 21 November 2026

The rule everyone quotes, and where it breaks

The four levels and their headline numbers are L ~7%, M ~15%, Q ~25%, H ~30%. Denso Wave, which invented the QR code, defines those percentages precisely: they are data-restoration rates over the code's total codewords, the 8-bit units the data region is built from. Nowhere in the specification or the inventor's own documentation is there a claim about square area.

The folk reading skips that distinction: 30% of the code = 30% of the picture = a logo covering a third of the square. Three things break that chain, and each one is measurable:

  1. A codeword spans 8 modules. One flipped module spoils the whole codeword, the way one wrong digit spoils a phone number. Damage concentrated in one spot (a logo) corrupts codewords far faster than it covers area.
  2. Correction capacity binds per interleaved Reed-Solomon block, not in total. A decoder corrects up to t = floor(r/2) corrupted codewords per block, r being the parity codewords in that block. Overflow one block and the decode fails whatever the total budget says.
  3. Correction is downstream of detection. If the scanner cannot find or sample the grid, the parity is never consulted at all.

The audit: where a 30% budget actually runs out

We took the exact version-4, level-H symbol our benchmark encodes a 26-character URL into: 33x33 modules, 100 codewords in four interleaved blocks of 9 data + 16 parity each, t = 8 per block, total budget 32 of 100 codewords. Then we walked the symbol's module matrix through the ISO placement and block interleaving, painted a centred white logo pad over increasing fractions of the area, and counted corrupted codewords per block:

Centre logoModules changedCodewords corruptedPer-block (t=8)Verdict
8-9% of area3.8%13 of 100[4, 5, 1, 3]well within budget
16% of area7.7%28 of 100[7, 7, 7, 7]87.5% of budget, decodable
18% of area10.6%34 of 100[8, 8, 10, 8]one block overflows

The key number: a 16%-area logo already consumes 87.5% of the level-H correction budget (28 of 32 codewords, spread as [7, 7, 7, 7] against a per-block capacity of 8). Two points more of area and a block overflows.

Two readings of that table matter. First, the arithmetic gap: a 16%-area logo changes only 7.7% of the modules yet corrupts 28% of the codewords. Area understates codeword damage by roughly 2-3.5x at these versions, because a white pad only erases the dark modules under it, but every codeword whose 8 modules touch a changed one is spoiled whole. The mapping runs the other way from the folklore's intuition.

Second, the empirical confirmation: all four decoders in our benchmark decode the pristine, undegraded render at 16% occlusion and fail at 18%. The pristine ceiling is the per-block RS budget, exactly. Interleaving does its job almost perfectly, spreading the pad's damage as evenly as [7, 7, 7, 7], and the budget still runs out one step later. The nominal 30% is delivered as advertised; codeword granularity, the function-pattern share of the symbol and edge straddling just mean 30% of codewords is only 16-20% of area at versions 2-4.

What error correction actually buys

Two things, both measured:

Occlusion headroom, roughly doubling. Raise the level from M to H and the safe centre-logo ceiling goes from about 8% of area to about 16% for three of our four decoders (ZBar, ZXing, WeChat; OpenCV's detector stays the binding worst case at ~9%). The undegraded symbol-channel ceiling doubles the same way. If a logo or expected damage is in the design, H is the correct choice and this is the mechanism.

A lower resolution requirement for long payloads. For an 89-character URL, the 95%-success resolution threshold falls from 3.91 px/module at M to 3.50 at Q to 3.00 at H. Longer symbols mean more samples per symbol and more parity spread over them, and H converts that into real sampling tolerance. (At true level L the long payload never reached 95% within our swept range at all.)

What it never buys

Resolution, for short and medium payloads. The decode cliff sits at about 3 px/module, and it is essentially independent of EC level: for a 26-character URL the thresholds were 3.17 (M), 3.25 (Q), 3.25 (H); for a 20-character payload, 2.98 to 3.33 across levels, inside capture noise.

A detail from our own data calibrates that noise: our encoder's default boosting made the requested L and M symbols for the short payload literally identical, and the "two levels" still measured 3.33 and 2.98. Identical symbols, 0.35 px/module apart: that is how much of the apparent spread between levels is measurement noise.

The mechanism is simple and worth internalising: below the cliff the scanner cannot sample the grid at all, so the parity is never consulted. Error correction repairs misread codewords; it does nothing for a front end that cannot find the modules. If your code is failing because it is printed too small, changing L to H changes nothing.

The trade nobody prices in

At a fixed printed size, raising EC inflates the symbol version (more modules for the same data), so each module gets physically smaller, and small modules are exactly what cheap printers, curved surfaces and long scanning distances punish. More redundancy can buy you less real-world robustness.

Our benchmark holds pixels-per-module constant by construction, so we state this plainly: that fixed-print-size trade is a geometric prediction, and we did not measure it. The follow-up study does. What we can say from the version analysis: the same link encoded at L, M, Q, H grows the grid module count by tens of percent, and the resolution cliff does not move to compensate at matched px/module.

Which level should you actually pick

  • No logo, clean print, arm's-length scan: M. The default most generators ship is genuinely right here. H buys nothing you can use, and costs module size if your print size is fixed.
  • Logo, or damage expected (outdoor, packaging, wear): H. It roughly doubles your occlusion headroom, which is precisely the budget a logo spends.
  • Long payload (a long URL with tracking parameters): H. It measurably lowers the resolution requirement, 3.9 to 3.0 px/module in our sweep.
  • Never: H as a substitute for size or contrast. Below ~3 px/module or under inversion failures, EC changes nothing; fix the actual constraint.

One encoder footnote, because we got caught by it ourselves: some encoders (including the Python segno we used) silently boost a requested level-L code to M when capacity allows. Our requested L and M symbols were byte-for-byte identical. If you think you are testing L, check the encoder's effective level first; true level L went untested in our benchmark for exactly this reason, and we disclosed it in the paper.

Honest limits

These are measurements of a synthetic capture pipeline (resampling, blur, noise, JPEG, mild geometric jitter) against four pinned software decoders (ZBar, OpenCV QRCodeDetector, OpenCV WeChat, zxing-cpp), on three payload strings with one automatically selected mask each, at QR versions 2-4. Thresholds are stated as brackets over grid levels; the full uncertainty treatment, the per-block audit code and every number in this article are in the paper and its committed dataset. The benchmark paper (PDF and dataset on Zenodo, DOI 10.5281/zenodo.24352636) has all of it.

It recovers up to 30% of the codewords, which at the small versions most people print (2-4) maps to roughly 16-20% of the symbol's area for a centred logo, and about 9% if every decoder including OpenCV's must read it. The percentage was never an area figure.
Score a real codeThe Scannability Margin from this research runs on your code before you print it.

Related reading