How does a QR code still scan when part of it is damaged?
A QR code carries Reed–Solomon error correction, which stores mathematically redundant data so that up to 30% of the symbol can be missing or wrong and the original message can still be reconstructed exactly.
Redundancy, not repetition
The obvious way to survive damage is to store everything twice, which doubles the size and still fails if the same part is damaged in both copies. Reed–Solomon does something cleverer: it treats the message as coefficients of a polynomial and stores extra evaluations of it. Any sufficient subset of those points reconstructs the polynomial, so it does not matter which parts are lost.
The four levels
QR defines four correction levels — L, M, Q and H — recovering roughly 7%, 15%, 25% and 30% of the codewords. Higher correction means more redundant data in the same symbol, so either the modules get smaller or the code holds less. That is the trade, and it is why a logo in the middle of a code requires level H.
What the fixed patterns do
The three large squares are finder patterns: they let a scanner locate the symbol and work out its rotation from any angle. The smaller alignment patterns correct for perspective distortion when the code is on a curved surface or photographed at an angle. Neither carries data.
Why masking exists
A code with large blank areas or long runs of one colour is hard to read, so the encoder XORs the data against one of eight mask patterns and picks whichever gives the most even distribution. The mask used is recorded in the format information, which is itself stored twice for redundancy.
The practical consequence
Damage tolerance is why a QR code on a wet, torn or partially covered surface still works — and why a code with a logo over its centre is not a hack but a designed-for use of level H.
Why the code is square and a barcode is not
A one-dimensional barcode encodes along a single axis, so its capacity grows only with width and a scanner needs a clean sweep across it. A QR code encodes in two dimensions, which is what allows both the capacity and the redundancy — a symbol a few centimetres square holds a few thousand characters with a third of it recoverable. That is the trade the second dimension buys: not merely more room, but room to be wrong in.
Sources
ISO/IEC 18004 — QR Code bar code symbology specification; Reed & Solomon, Polynomial Codes over Certain Finite Fields (1960). Every claim above is drawn from these; where a claim is contested or unsettled the article says so rather than picking a side.
How this article was made
Written by a person. Reviewed by Editorial review, Leumas on 2026-08-31. 401 words.
Questions
How does a QR code still scan when part of it is damaged?
A QR code carries Reed–Solomon error correction, which stores mathematically redundant data so that up to 30% of the symbol can be missing or wrong and the original message can still be reconstructed exactly.
How do I know this is right?
The sources are listed on the page and a person reviewed it on 2026-08-31. Where a question is genuinely open, the article says so instead of resolving it.