How Do QR Codes Work?

What a phone camera is actually doing in that half-second before it recognizes the code.

Build this QR code

A QR code is a two-dimensional barcode — a grid of black and white squares that encodes data directly in the pattern itself, rather than in a single line of varying-width bars the way a traditional barcode does. That two-dimensional layout is what lets it hold far more information in the same physical space.

Three of the four corners carry large square finder patterns — that's what a scanner's camera locks onto first, regardless of the angle or rotation the code is held at. A smaller alignment pattern helps correct for a code that's printed on a curved or uneven surface. Around the whole thing sits a plain white margin, the "quiet zone," which exists purely so the scanner can tell where the code ends and the rest of the world begins.

The data itself is built with deliberate redundancy — an error-correction scheme means a code can still scan correctly even if a meaningful portion of it is damaged, dirty, or obscured (a logo placed in the center, for instance). That's why a code with a brand logo embedded in the middle still works: the error correction accounts for exactly that kind of intentional gap.

Built-in error correction
A meaningfully damaged or partially obscured code can still scan correctly.
Reads at any rotation
The finder-pattern squares let a camera recognize the code no matter how it's angled or held.
More data than a barcode, same footprint
The two-dimensional grid holds far more than a single-line barcode in the same printed space.

Questions people actually ask

Why do QR codes need a white border around them?
That "quiet zone" gives the scanner a clear boundary to detect where the code starts and stops — without it, a scanner can struggle to isolate the code from whatever surrounds it.
Can a QR code still scan if part of it is damaged?
Yes, up to a point — built-in error correction allows a meaningful percentage of the code to be missing or obscured and still scan correctly, which is also what makes a logo embedded in the center possible.
Build yours above — it takes ten seconds
Open Trakelino