How QR Codes Work
A QR code looks like a glitchy chessboard, but it's an engineered grid that can survive coffee stains, sun glare, and a 30-degree tilt.
A QR code is a 2D barcode β but instead of a single row of lines, it's a grid of black and white squares that pack up to 300Γ more data than a regular barcode. Designed in 1994 for tracking car parts, it now runs menus, payments, tickets, and packaging worldwide.
The finder patterns
The three big squares in the corners. These are the "look here" anchors β the unique pattern a scanner searches for to locate the code and figure out its orientation. They're why a QR code can be scanned upside down, sideways, or even from an angle.
The alignment patterns
Smaller squares scattered through the grid. They help the scanner map the code's geometry if it's printed on a curved surface (a cup, a bottle, a bent flyer). The bigger the code, the more alignment squares.
The timing pattern
A dashed line of alternating squares connecting finder patterns. It tells the scanner the grid spacing β how wide each module is β so the code can be read at any size, from a billboard to a business card.
The format & version data
Hidden strips near the finders carry error-correction settings and (for larger codes) the version size. The scanner reads this before it decodes anything else.
The data zone
All the rest of the squares β thousands of them β encode the actual payload: URLs, text, contact cards, Wi-Fi credentials. The bits snake through the grid in a specific zigzag path, weaving around the finder and timing patterns.
The error correction
This is the superpower. QR codes use Reed-Solomon error correction, the same math that makes CDs scratch-resistant. At its highest level, a QR code can lose up to 30% of its data and still be read perfectly. That's why a coffee stain, a torn corner, or a logo in the middle doesn't kill it.
The quiet zone
The blank margin around the whole code β at least four modules wide. Without it, the scanner can't tell where the code begins.
What the scanner does
- Finds the three finder squares.
- Works out orientation and size.
- Reads the format/version data.
- Walks the zigzag, decoding bits.
- Applies error correction to patch any damage.
- Decodes the message β usually in well under 50 milliseconds.
A QR code is not random noise. It's a tiny, redundant, self-locating data fortress β engineered to be read by a phone in a hurry, in bad light, at the wrong angle, half-destroyed.
Written with π by Waela Β· Back to The Side Quest
Built with π by Waela
Keep going down the rabbit hole
How Noise-Canceling Headphones Work
They don't block sound β they fight it. Inside each earcup, a microphone listens and broadcasts the exact opposite of what it hears.
How Tap-To-Pay Works
You tap, you beep, you leave. Behind that half-second is a handshake, a cryptography trick, and a one-time-use number.
How Elevators Decide Where To Go
In a busy building, the elevator you're waiting for isn't the one closest to you β it's the one a computer thinks should come.
How A Microwave Heats Food
A microwave doesn't cook from the outside in. It shakes water molecules directly β which is why a hot dog steams in 30 seconds and your bowl stays cold.