How can a QR code still work when part of it is missing?
Scratch it, smudge it, stick a logo in the middle: up to 30% of a QR code can be ruined and your phone still reads it.
▶ Start the storyA QR code keeps working when part of it is missing because it stores extra, cleverly calculated data on purpose. Alongside your message, it carries error-correction bytes computed with a mathematical recipe called Reed–Solomon coding. When some squares are smudged, torn or covered, the reader uses those extra bytes to work out what the missing parts must have been.
How much damage it can take is a choice. QR codes come with four levels of protection: L can recover about 7% of the code, M about 15%, Q about 25% and H about 30%. There is a trade-off: the more protection you add, the less room is left for the message. Denso Wave, the company that created the code, suggests Q or H for dirty factory floors, L for clean places with lots of data, and notes that M is the most common choice.
How much of a QR code can be recovered
%
| Recoverable share | |
|---|---|
| L | 7% |
| M | 15% |
| Q | 25% |
| H | 30% |
This is also why so many QR codes have a logo stuck in the middle. The reader simply treats the logo as damage and repairs around it.
The code was invented in 1994 by Masahiro Hara at Denso Wave to label car parts. His square pattern was inspired by the black and white stones of the board game Go, and the three big squares in the corners use a black-white rhythm chosen because it is rare on printed paper, so a camera can find them instantly. The same Reed–Solomon maths had already been used by the Voyager space program and on music CDs.
Quiz me
0/3
Recap
More error correction means more damage tolerated but less room for data: L 7%, M 15%, Q 25%, H 30%.
Surprising fact · The logo in the middle of many QR codes is read as damage, and the error correction simply repairs around it.
Sources (5)
No source, no claim. Every fact in this lesson (16 claims) cites at least one of these.