ExplainerTools

Original film · Codes

Why does a torn QR code still scan? Error correction, explained

Many of a QR code's squares are Reed–Solomon backup, up to about 30% of the code. Tear a chunk out and it still scans, but cover a corner finder square and most scanners give up.

Narrated · 70 seconds · captions includedDownload the film

Keep exploring

Up next

  1. InteractiveQR Repair LabChange the same thing yourself.Try it yourself
  2. 0:43Short · AnimalsWhy do deer freeze in your headlights?
  3. 0:33Short · CamerasWhy do propellers look bent on camera?

Transcript

Why does a torn QR code still scan? Because it was designed to survive damage. A QR code stores your link as a string of bytes. But many of those little squares aren't your link at all. They're error correction: extra bytes calculated from your data, using Reed-Solomon codes, the same kind of math that lets a scratched CD keep playing. Your phone reads every byte it can, then works out the ones that are missing or wrong. Now tear a chunk out. It still scans. There are four levels of protection. The lowest can restore about seven percent of the code. The highest, about thirty percent, which is why some codes can have a logo pasted right in the middle. In bigger codes, the bytes are also split into blocks and interleaved, so a tear usually costs several blocks a little, instead of wiping out one. But don't touch the three big squares in the corners. They aren't data. They tell the camera where the code is, and which way is up. Cover one, and most scanners give up. Try it yourself at Explainer Tools dot com.