QR codes went from novelty to everyday infrastructure, appearing on menus, packaging, tickets, and payment screens. The black-and-white squares look arbitrary, but they follow a precise structure. Understanding how a QR code stores data — and what makes one scan reliably — helps you create codes that just work.
From barcode to QR code
A traditional barcode stores data along a single dimension, in the widths of parallel lines, which limits how much it can hold. A QR code — the QR stands for “quick response” — stores data across two dimensions, in a grid of light and dark cells. That second dimension multiplies capacity enormously, so where a barcode carries a short number, a QR code can carry a web address, contact details, or a paragraph of text.
What the patterns mean
The grid is not random. The three large squares in the corners are finder patterns; they let a scanner locate the code and work out its orientation, which is why a QR code reads from any angle. Smaller alignment patterns help the scanner correct for tilt and curvature. Around the data area, timing lines and format information tell the scanner how the code is laid out. The remaining cells hold the actual encoded data and its error-correction information.
Built-in error correction
One of the QR code’s cleverest features is that it keeps working when damaged. It stores redundant error-correction data, so even if part of the code is dirty, torn, or covered — or has a logo placed over the centre — the original information can still be reconstructed. Codes come in several error-correction levels; a higher level survives more damage but uses more of the grid for redundancy, leaving less room for data.
Capacity and density
How much a QR code holds depends on its version, which sets the grid size, and the type of data. More data means a denser grid of smaller cells. That density is the practical limit on reliability: a code crammed with a very long URL becomes a fine mesh that struggles to scan when printed small or shown on a low-resolution screen. Keeping the encoded content short — a tidy link rather than a sprawling one — keeps the grid coarse and easy to read.
Making codes that scan
Reliable scanning comes down to a few basics. Preserve the quiet zone, the empty margin around the code, which scanners need to find its edges. Keep strong contrast, classically dark cells on a light background, and avoid inverting it. Print or display the code large enough that individual cells are clearly resolved. If you add a logo, keep it small and central so error correction can absorb it. And always test the finished code with a real device before publishing it.
A note on safety
Because a QR code hides its destination behind a pattern, it can lead anywhere, and that anonymity is occasionally misused to point at harmful sites. As a reader, it is sensible to check where a code leads before acting on it, especially for anything involving payment or login. As a creator, using a clear, trustworthy destination — and where possible showing the address alongside the code — helps people scan with confidence.