Why a QR Code Still Works When It's Half Covered
“You can stick a logo in the middle of a QR code, spill coffee on a corner, or crumple it — and it still scans. That's not luck. The code is deliberately built to survive damage, using a 200-year-old idea from mathematics.”
Here's something a barcode could never survive: cover a third of a QR code with a company logo, and it still scans perfectly. Spill coffee on a corner, crumple it, print it badly — and your phone reads it anyway. A barcode with a scratch through it often just fails. So what makes a QR code so tough?
The answer is that a QR code is designed to be damaged. Toughness isn't a happy accident — it's built in from the start.
Two Dimensions, Much More Room
A barcode is one-dimensional: a single row of stripes, read left to right. It can only hold so much — about a dozen digits.
A QR code is two-dimensional. Data runs in both directions across a grid of little black and white squares called modules. The simplest QR code is a 21×21 grid; larger versions go much bigger. That second dimension is a huge jump in capacity — enough to hold a full web address, a Wi-Fi password, or a paragraph of text, where a barcode could only hold an ID number.
Finding the Code: the Three Corner Squares
Before a phone can read a single bit of data, it has to find the code in the camera's view and work out which way up it is. You might be holding the phone at an angle, upside down, or off to one side.
That's the job of the three big squares you see in three corners of every QR code — the finder patterns. Because there are exactly three of them, sitting in three of the four corners, a camera can instantly tell the code's position and rotation: line up the three squares, and the whole grid snaps into place, even from a skewed photo. In the interactive above, those three corner squares can't be damaged — because if you destroyed them, the camera would have nothing to lock onto, and no amount of error correction could help.
The Real Magic: Planning for Damage
Now for the part that makes QR codes tough. When a QR code is created, it doesn't just store your data — it stores extra, redundant information calculated from that data. This is called error correction, and QR codes use a specific and beautiful piece of mathematics called Reed–Solomon codes.
The idea is like this: imagine you had to send a friend four numbers, but you knew the message might get smudged. So instead of sending four, you send eight — the original four plus four more, cleverly computed so that any four of the eight are enough to rebuild the original. Now a couple of numbers can be lost and your friend still recovers the message. That's the spirit of error correction: spend some space now so damage can be undone later.
QR codes let you choose how much protection to add:
| Level | Roughly survives | Trade-off | |-------|------------------|-----------| | L | ~7% damage | most data, least protection | | M | ~15% damage | balanced | | Q | ~25% damage | more protection | | H | ~30% damage | toughest, least data |
At the highest level, about 30% of the code can be missing and it still reads. That's the whole secret behind logos in the middle of QR codes: the logo covers modules the error correction was already prepared to lose.
Push the interactive until it breaks. You'll find you can knock out a surprising amount before the verdict flips from "still scannable" to "too damaged" — and that threshold is exactly the redundancy doing its job.
The Same Idea Is Everywhere
This trick — add redundant information in advance so that missing pieces can be rebuilt — is one of the most important ideas in all of computing. The very same Reed–Solomon maths that saves a scratched QR code also lets a scratched CD play music, corrects errors on hard drives, and rebuilds photos beamed across billions of kilometres from spacecraft like Voyager.
A barcode carries a number and hopes for the best. A QR code carries its data and a plan for its own repair — which is why a little coffee, a crease, or a logo can't stop it.
Ready to explore?
4 interactive activities waiting in the next tab.
Error correction isn't free — the redundant data takes up space that could have held more information. A QR code at the highest protection level (survives ~30% damage) holds noticeably less data than one at the lowest. If you were printing codes for outdoor signs that get rained on and faded, versus codes inside a clean app, how would you choose the level for each?
Reflect
The same idea that keeps a scratched QR code readable — adding redundant information so missing pieces can be rebuilt — also protects data sent from spacecraft, stored on CDs, and streamed over noisy connections. Why is 'plan for damage in advance' such a powerful strategy, and where else in life does it show up?