How QR Codes Actually Work (and How They Fail)
Web & Networking - 3 min read - Published 2026-09-06 - Updated 2026-10-19
QR (Quick Response) codes were invented in 1994 by Denso Wave, a Japanese company, to track car parts in factories. They needed something that held more data than a barcode and could be read quickly from any angle. Today they're on menus, tickets, payment terminals, packaging and posters, and every modern phone camera can read them.
What's inside the square
A QR code is a grid of black and white squares called modules. Three large squares in the corners are finder patterns: they let a scanner find the code, work out its size and rotation, and correct for viewing at an angle. Smaller alignment patterns help with codes printed on curved or slightly distorted surfaces, and thin striped timing patterns mark out the grid.
The rest of the grid holds the data plus error-correction information, along with small areas recording the format: which error-correction level is used and which mask pattern was applied. Masking flips modules in a fixed pattern to avoid large solid areas that would confuse scanners.
Sizes and capacity
There are 40 sizes, called versions. Version 1 is 21 × 21 modules and each version adds four modules per side, up to version 40 at 177 × 177. At the largest size with the lowest error correction, a QR code holds up to 7,089 digits, 4,296 characters of uppercase letters and numbers, or 2,953 bytes of general data.
More data means more, smaller modules, which are harder to scan. A short web address produces a small, easy code; a long address with tracking parameters produces a dense one. Using a short URL keeps codes simple.
Error correction
QR codes use Reed-Solomon error correction, the same family of codes used on CDs and in deep-space communication. Extra data is added so a damaged or partly hidden code can still be read. There are four levels: L recovers roughly 7% of the code, M about 15%, Q about 25% and H about 30%.
Higher levels make the code larger for the same content, so M is a sensible default. H is useful when a logo will be placed over the center, or when the code will be printed somewhere it may get scratched or dirty.
Why codes fail to scan
Low contrast: dark modules on a light background work best. Light-on-dark (inverted) codes and pale colors confuse some scanners. Missing quiet zone: the standard calls for a clear margin of four modules around the code; text or graphics crowding the edge often stop it being found.
Too small or too dense: a long URL squeezed into a tiny printed code gives modules too small for a camera to resolve. As a rough rule, the code should be at least a tenth as wide as the distance it will be scanned from, so a poster read from two meters away needs a code about 20 cm wide. Damage beyond the error-correction level, glare from glossy surfaces, and logos covering too much of the code are other common causes.
Always test-scan a printed code with a couple of different phones before printing in quantity.
Static vs dynamic codes
A static QR code contains the destination itself, such as a URL or Wi-Fi details. It works forever and needs no service, but can't be changed after printing. A dynamic code contains a short link to a redirect service, so the destination can be changed and scans counted - but if the service shuts down or the subscription lapses, every printed code stops working. For anything printed in large numbers, a static code pointing at your own domain is the safest choice.
Staying safe
Because you can't read a QR code by eye, criminals use them in scams, sometimes called quishing: stickers placed over real codes on parking meters or menus, or emails with a code leading to a fake login page. Before opening a link, check the address your phone shows in the preview. Be wary of codes that lead to a login or payment page, and of stickers that look stuck on top of something else. When paying, typing the official website address yourself is safer than scanning an unexpected code.