How QR Codes Work: The Science Behind the Squares

The Basic Structure of a QR Code
A QR code is a grid of black and white squares called "modules." Three larger squares in the corners (the "finder patterns") let a scanner instantly recognize the code's orientation, even if the photo is taken at an angle. Between them, the remaining modules encode your actual data using a binary pattern.
How Data Gets Encoded
Text, URLs, or other data get converted into binary (a series of 1s and 0s), which is then mapped onto the grid — black modules represent one binary value, white the other. The scanning app reverses this process: it reads the pattern, converts it back to binary, then back to readable text or a link.
What Error Correction Actually Does
QR codes include a feature called Reed-Solomon error correction, which adds redundant data to the code. This is why a QR code can still scan successfully even if part of it is dirty, scratched, or covered by a logo — the scanner can reconstruct the missing information from the redundancy, up to a certain percentage of damage depending on the error correction level chosen (Low, Medium, Quartile, or High).
Why Some QR Codes Fail to Scan
- Low contrast — the scanner can't reliably distinguish "dark" from "light" modules
- Too much damage or obstruction — exceeding the error correction level's tolerance
- Printed too small — modules become too fine for the camera to resolve at typical scanning distance
- Distorted shapes — decorative module shapes (hearts, stars) can confuse pattern recognition
- No quiet zone — insufficient white space margin around the code confuses the scanner about where the code starts and ends
Why This Matters When Designing Your QR Code
Understanding error correction explains why logo-embedded QR codes need higher error correction settings, and why decorative shapes are riskier for anything business-critical — you're intentionally spending some of that redundancy budget on aesthetics, so there's less margin left for real-world scanning conditions like glare, damage, or poor lighting.