What is actually in a QR code
The pattern is far more structured than it looks. The three large squares in the corners are finder patterns, letting a scanner locate the code and work out its rotation from any angle. Smaller alignment patterns help it correct for distortion when the code sits on a curved surface or is photographed obliquely. The dotted lines running between the finder patterns are timing patterns, establishing how large a single module — the smallest black or white square — is. Everything else is your data plus its error correction.
Codes come in versions from 1 to 40, and the version sets the grid size. Version 1 is 21 modules square; version 40 is 177. The encoder picks the smallest version the content fits into, which is why a short URL yields a sparse, chunky code and a long one yields a dense field of tiny squares. Since a scanner has to resolve individual modules, a long URL printed at the same physical size is meaningfully harder to read. That is a practical argument for keeping encoded URLs short, and it has nothing to do with tracking: stripping unnecessary query parameters before generating a code genuinely makes it easier to scan.
Error correction, and the logo trade-off
QR codes use Reed–Solomon error correction, from the same family of maths that lets a scratched CD play. There are four levels: L recovers roughly 7% of the code, M about 15%, Q about 25% and H about 30%. That redundancy is why a code with a coffee ring across it still works.
It is also the mechanism behind every QR code with a logo in the middle. Nothing clever is going on: the logo simply covers data, and the error correction reconstructs what is underneath. This works right until it does not. Choose level H, keep the logo under about a quarter of the area, and there is margin to spare. Cover a third of a level-M code and it becomes unreadable — and the failure is abrupt rather than gradual, so a design that scans on your desk can fail consistently in a shop window.
Higher error correction also means more modules for the same content, pushing the version up and the module size down. There is a genuine trade-off between damage tolerance and how small you can usefully print.
The quiet zone: the most common printing failure
A QR code needs a blank margin around it four modules wide, called the quiet zone. It is part of the specification, not a design suggestion. Without it a scanner cannot reliably tell where the code ends and the surrounding artwork begins.
This is the single most common reason a code that worked on screen fails in print. A designer drops the image into a layout, crops it flush to the pattern or sets it against a busy photograph, and it becomes unreliable at exactly the moment it matters. If you take one practical thing from this page, make it this: leave clear space around the code.
Contrast matters for the same reason. Scanners expect dark modules on a light background, and while many now cope with inverted colours, plenty of older ones do not. A low-contrast pairing that looks elegant in a mockup — mid grey on light grey — can be effectively unscannable. Test at the final printed size, on the final material, with an ordinary phone camera rather than a dedicated scanning app: a code that scans from a monitor at 300% zoom tells you very little about one printed two centimetres wide on a matte flyer.