Reed-Solomon Error Correction in QR Codes: The Mathematics Behind 30% Data Recovery
The four error-correction levels, what they actually do, the density cost of each, and how to use them for logos, packaging, and outdoor signage.
Updated September 2026
Error correction is the feature that lets a QR code survive dirt, damage, and even a logo placed on top of it. It works by storing extra mathematical backup data alongside the real payload, using Reed-Solomon error-correcting codes.
The four levels
| Level | Name | Recoverable | Use when |
|---|---|---|---|
| L | Low | ~7% | Clean environments, short data, maximum density |
| M | Medium | ~15% | General default — good balance |
| Q | Quartile | ~25% | Codes that may get dirty or worn |
| H | High | ~30% | Outdoor signage, packaging, codes with a logo overlay |
What "30% recoverable" actually means
The percentage refers to codewords — the small data blocks the payload is split into — not literally to the picture area. In practice the two track closely: a code at level H survives a coffee ring, a torn corner, or a centred logo covering roughly a quarter of its area. But the recovery assumes the damage is scattered; a single solid obstruction over one position marker (a corner square) can still kill the scan, because the scanner needs those markers to find the code at all. Protect the corners first, always.
The density cost, in numbers
Error correction is not free: the backup data occupies modules that could hold payload. The same 50-character URL at different levels:
| Level | Backup data | Grid for a 50-character URL | Print size for 1 m scanning |
|---|---|---|---|
| L | ~7% | 29×29 | ~14 cm |
| M | ~15% | 33×33 | ~16 cm |
| Q | ~25% | 37×37 | ~18 cm |
| H | ~30% | 41×41 | ~20 cm |
Notice the pattern: more correction, more modules, bigger print for the same scanning distance. That is the trade-off in one table.
Putting a logo in the centre
Because high error correction can recover up to 30% of the code, you can safely cover the centre of an H-level code with a small logo. Keep the logo to roughly 10–15% of the code area, leave the position markers (the three corner squares) untouched, and always test the result by scanning it.
The geometry: a centred circle is the safest logo shape, because it spreads the obstruction evenly across the data region instead of wiping out one contiguous run of codewords. A 10% area budget means a circle with a diameter of about 36% of the code width — for a 10 cm code, a logo circle up to ~3.6 cm across. Beyond 15% area you are spending the entire correction budget on decoration, and any additional smudge pushes the code over the edge.
Choosing by environment
- •Business card, clean desk, short URL: level M — plenty of margin, keeps the code small.
- •Shipping box, scuffed and rained on: level H, printed larger — correction budget spent on real damage.
- •Table tent behind laminate: level Q — the laminate does the protecting, correction handles glare and wear.
- •Code with a centred logo: level H, always — the logo consumes the budget before the environment adds its own damage.
The Reed-Solomon mathematics, in brief
QR error correction is built on Reed-Solomon codes, a family of block error-correcting codes defined over the finite field GF(256). The encoder treats the payload as a sequence of 8-bit symbols and appends a calculated set of parity symbols computed by polynomial division over that field. The number of parity symbols is fixed by the error-correction level: roughly 7 codewords of redundancy per 50 codewords at level L, rising to about 30 per 50 at level H. The standard specifies the generator polynomials and the interleaving pattern, so every compliant encoder produces identical parity for identical input.
The decoder works by treating the received symbols as a polynomial and looking for the error-locator polynomial whose roots identify which symbols are wrong and by how much — the Berlekamp-Massey algorithm. The key result is that a code with 2t parity symbols can correct up to t symbol errors, or equivalently locate up to 2t erasures (errors whose position is known). This is why scattered damage is recoverable but a contiguous block over a finder pattern is not: the algorithm corrects symbol values, it cannot reconstruct a structure the scanner never located in the first place.
Interleaving: why scattered damage survives but streaks do not
The standard does not lay codewords out in order — it interleaves them across the grid in a defined block pattern, so that a physically contiguous region of damage hits many different codewords a few symbols at a time rather than wiping out one codeword entirely. This is the mathematical reason a coffee ring (scattered) is recoverable while a fold line across the data region (a streak that destroys whole codewords) can exceed the per-codeword correction budget even at level H. When you design for a harsh environment, the goal is not just more correction but spreading risk: avoid fold lines through the data region, keep scratches diagonal rather than straight across the grid, and protect the corners absolutely.
Why the corners are sacred
Error correction can rebuild missing data, but it cannot rebuild the finder patterns — the three large squares in the corners that tell a scanner where the code begins and how it is rotated. If a logo, a sticker, or a fold covers even part of a corner, the scanner may never find the code in the first place, and no amount of Reed-Solomon mathematics can help. This is why the rule for logos is always the same: centre the logo, keep it small, and leave the corners untouched.
The same logic explains why a torn corner kills a code more reliably than a coffee ring in the middle. Scattered damage across the data region is exactly what error correction is built to recover; concentrated damage on a finder pattern defeats the scanner before correction ever runs. When you design a code for a harsh environment, protect the corners first — behind glass, inside a frame, away from fold lines on packaging.
Error correction vs. error prevention
It is tempting to set every code to High and assume the problem is solved. That works, but it costs modules: a High-level code is visibly denser than a Medium code holding the same data, which means each module is smaller at the same print size, which means the code is harder to scan from a distance. Error correction is a safety net, not a substitute for good sizing, contrast, and placement. The best practice is to match the level to the real risk: Medium for a clean business card, High for a shipping box, and never rely on correction to rescue a code that is simply too small.
| Risk to the code | Recommended level | Also do this |
|---|---|---|
| None — clean desk, short URL | L or M | Keep it small and simple |
| Occasional handling | M | Standard default |
| Dirt, splashes, laminate glare | Q | Matte laminate, larger print |
| Outdoor weather, scuffing | H | Print larger; protect corners |
| Centred logo overlay | H | Logo ≤15% of area, corners clear |
For a short URL on a clean business card, Medium is plenty. For a code on a shipping box that will be scuffed and rained on, use High and print it larger.