A QR code looks like random black-and-white speckle, but it is actually a neat little map. Each tiny square is a single bit of information: black means one, white means zero, and strung together those bits spell out a web address or a message. The three big square targets in the corners are called finder patterns — they shout to the camera, here I am, and this is which way up I sit, so the scanner can line the code up even if you hold your phone at an angle. The dotted line running between the corners is a ruler that helps the camera count the rows and columns. The really clever part is hidden: the code stores spare copies of its own information, woven through the pattern. So if you scribble over part of it, scratch it, or a coffee stain covers a chunk, the scanner can rebuild the missing bits from the spares. You can wreck nearly a third of a QR code and it will still work. Drag the damage slider and watch it fight back until it finally gives up.
Most people think a QR code stores its information like a picture, so any damage scrambles it. In fact it stores spare copies through error correction, so it can lose nearly a third of itself and still be read perfectly.
What's actually happening
In 1994 an engineer named Masahiro Hara, working for a Toyota subsidiary called Denso Wave, had a problem on the factory floor. Ordinary barcodes held very little and had to be scanned in one direction; tracking car parts needed something denser and quicker. The story goes that the grid layout came to him partly from watching the black-and-white stones on a game of Go. The result was the QR code, Quick Response code, a two-dimensional pattern that could hold hundreds of times more than a barcode and be read from any angle in a fraction of a second.
To pull that off, the code has to solve two problems at once: where is it, and what does it say. The where is handled by those three unmistakable square targets in the corners, the finder patterns. A scanner sweeps the image looking for their distinctive ratio of black and white, and the moment it finds three of them it knows it has a QR code, knows its size, and knows its orientation — which is why you can scan one upside down or skewed and it still works. Fine dotted lines called timing patterns run between the finders like a ruler, pinning down exactly where each row and column of modules sits. Only then does the scanner read the what: the field of small squares in the middle, each a one or a zero, decoded back into text or a link.
The most ingenious trick is the one you cannot see. Real QR codes live in the wild — printed on crumpled receipts, stuck to lamp posts, smudged, torn, partly hidden. So they are built with redundancy using a method called Reed–Solomon error correction, the same family of maths that protected data on CDs and on spacecraft transmissions. The code carries extra parity information alongside the real message, enough that the decoder can reconstruct missing or corrupted modules. At the strongest setting roughly 30 per cent of the code is given over to this safety net, which is why a QR code can lose almost a third of itself and still be read flawlessly — and it is exactly why companies can punch a logo into the middle of a QR code without breaking it. Drag the damage up in the simulator and you will watch the error correction quietly repair the gaps, right up to the cliff edge where too much is gone and it finally fails.
A QR code is a grid of bits with corner markers to orient it and built-in spare copies, so error correction lets it survive losing up to about a third.
- 1Find a printed QR code you are happy to mark — a leaflet or a free sample is ideal.
- 2Cover one corner finder square with your thumb and try to scan it; it usually fails, because the scanner can no longer locate the code.
- 3Now uncover the corners but scribble over a small patch of the middle instead, then scan again — it still reads, because the error correction rebuilds the damaged data modules.
Common questions
They are finder patterns. A scanner hunts for their distinctive black-and-white ratio to locate the code, work out its size, and figure out its orientation, so you can scan it from any angle.
QR codes use Reed–Solomon error correction, storing extra parity information alongside the real data. The decoder uses it to rebuild missing or corrupted modules, surviving up to roughly 30 per cent damage at the highest correction level.
Because the error correction holds spare copies of the data. The logo simply covers some modules that the scanner reconstructs from the redundancy, so the code still decodes.