How Do QR Codes Work?
What a phone camera is actually doing in that half-second before it recognizes the 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.