all lessons

technology

did you know a damaged QR code can still know the answer?

some of those little squares carry a mathematical backup.

the idea at a glance

data + backup

extra structure makes recovery possible

the recovery information is mathematical redundancy, not a second copy of the whole message.

  1. encode data
  2. add redundancy
  3. recover damage

the idea

a QR code includes extra information that helps reconstruct damaged data. the squares do more than spell out a link: some encode mathematical relationships between pieces of that data.

how it works

higher error-correction levels dedicate more capacity to recovery. that leaves less room for the message at the same symbol size, or requires a larger symbol for the same message.

go deeper

how can missing information come back?

a QR code includes extra information that helps reconstruct damaged data. the squares do more than spell out a link: some encode mathematical relationships between pieces of that data.

imagine sending two numbers along with their sum. if one number disappears, the other number and the sum reveal it. QR codes use a much more powerful version of this idea, called Reed–Solomon error correction.

spend some space on resilience

higher error-correction levels dedicate more capacity to recovery. that leaves less room for the message at the same symbol size, or requires a larger symbol for the same message.

QR codes offer four standard correction levels, commonly described as approximately 7%, 15%, 25%, and 30% recovery of codewords. a codeword is a unit of encoded data, not simply an arbitrary patch of the picture.

why does redundancy help?

in a tiny analogy, a + b = s supplies a constraint. receiving a = 4 and s = 11 lets you recover b = 7. real correction codes add multiple constraints over a special arithmetic system.

missing value = known sum − surviving value; 11 − 4 = 7

can you cover any thirty percent?
  • no. the location and type of damage matter, including damage to the patterns a scanner uses to locate and align the symbol.
  • more redundancy improves recovery within limits. it does not make a code indestructible or guarantee that every phone can read it.
sources & further reading

concepts: error correction · redundancy · Reed–Solomon codes

2 minute read