How QR Codes Actually Work
QR codes look like random noise, but they encode information in a precise, error-tolerant structure. Here's the full picture.
A QR code (Quick Response code) is a two-dimensional barcode that stores data as a pattern of black and white squares arranged on a grid. Unlike a traditional one-dimensional barcode that can only hold about 20 characters, a QR code can store up to 3,000 bytes of binary data or about 4,000 alphanumeric characters — enough for a full URL, a paragraph of text, contact information, or Wi-Fi credentials.
The structure of a QR code is carefully organized. The three large square patterns in the corners are called finder patterns — they tell the scanner where the code begins and what its orientation is, so the code can be read from any angle. A smaller alignment pattern (in larger QR codes) helps correct for perspective distortion when the code is photographed at an angle. Timing patterns — alternating black and white modules running between the finder patterns — establish the grid coordinates.
One of the most important features of QR codes is error correction. QR codes use Reed-Solomon error correction, the same algorithm used in CDs and DVDs, to allow the code to be read even if part of it is damaged, obscured, or dirty. There are four error correction levels: L (7% damage tolerance), M (15%), Q (25%), and H (30%). Higher error correction means the code can survive more damage but also requires more modules — making the code physically larger or denser.
When you scan a QR code with your phone, the camera captures the image and the QR decoding software locates the finder patterns, determines the grid size, reads each module as a 1 or 0, applies error correction to fix any damaged bits, and then decodes the binary data back into text. The entire process takes a fraction of a second. Modern smartphones can scan QR codes directly from the camera app without any additional software.