QR Code Best Practice: Size, Error Correction and Redirects
Whether a code scans depends on physics, not content: size, contrast, quiet zone and error tolerance. From generation to print, redirects to measurement.
Whether a code scans depends on physics, not content: size, contrast, quiet zone and error tolerance. From generation to print, redirects to measurement.
A QR code looks like something a phone camera should resolve from across the room, yet the number of codes that fail in the field is remarkable. The cause is almost never the payload; it is size, contrast, quiet zone and print quality. A square that will not scan is worse than no square at all, because it makes a promise and breaks it. This article gathers the decisions that actually determine the outcome, from generation through to paper.
Generation and verification belong together: the QR code generator makes the square and the QR code reader proves it scans before anything gets printed. To see where the address behind it really leads, the redirect checker walks the chain, and the URL encoder and decoder makes the parameters readable.
A camera needs three things to resolve the square: enough pixels, enough contrast and enough empty space around it. Miss any one of them and the scan fails no matter how short the payload is.
A rough rule holds up well: the printed side length should be about a tenth of the distance it will be read from. A code on a handheld leaflet, read from 30 centimetres, works at 3 centimetres. A code in a shop window read from two metres needs to be 20 centimetres across. The 1.5-centimetre squares that come off desktop printers are technically valid and fail regularly in practice.
The square needs a clear border on all four sides, four modules wide. In a crowded layout that margin is the first thing a designer sacrifices, and the scan rate drops accordingly. The contrast rule is simpler still: dark pattern on a light background. Inverting it does not work on many readers. If you must use brand colours, keep a large brightness gap between pattern and background; two tones that a human eye separates easily can still be indistinguishable to a camera.
The square carries redundant data so it still resolves when part of it is damaged. That redundancy comes in four grades, and the denser the grade, the busier the pattern.
| Level | Recoverable area | Pattern density | Typical use |
|---|---|---|---|
| L | Around 7% | Sparsest | On-screen display |
| M | Around 15% | Balanced | General print work |
| Q | Around 25% | Dense | Codes with a centre logo |
| H | Around 30% | Densest | Outdoors, surfaces that wear |
Placing a logo in the middle requires level Q at minimum, because the logo already consumes part of the recoverable area. Keep it under a tenth of the square.
The more data the square carries, the finer its pattern and the larger it has to be printed. Shortening the payload therefore buys readability directly.
If you do route through an intermediate address, verify the chain is healthy. The redirect checker follows up to 10 hops, waits 10 seconds per request and accepts addresses up to 2048 characters. Running the chain once before going to print costs far less than discovering a broken link mid-campaign.
Seeing the square on a monitor proves nothing. A real test has four parts and all of them take minutes.
Set against the cost of discovering a fault after the campaign has started, that is nothing. On runs of thousands of copies, skipping the proof is the most expensive saving available.
A square that looks perfect on screen degrades on paper for three reasons: ink spread, insufficient resolution and the wrong surface. Supplying the artwork as a vector keeps the edges crisp at any scale. When only a raster will do, export it at the real print dimensions and a high density; enlarging a small screen-sized file smears the modules together. The image resizer is enough to set the output dimensions.
Two placement rules earn their keep. Do not put the square on a surface that curves, folds or reflects, and always add a few words telling people what it does. Something as small as “scan for the menu” lifts the scan rate noticeably. For accessibility, leave a second route to the same destination: printing the address in readable text keeps visitors without a usable camera in the loop.
These squares do not belong everywhere. On a screen, the visitor is already at a device and would need a second one to scan. Putting a plain link on a web page beats printing a square on it, with one exception: helping someone move a session from desktop to phone.
The second poor fit is anything in motion. A square on a passing vehicle will not be read. The third is anything on screen briefly; nobody catches a square that appears for two seconds in a video. In those cases a short, memorable address does far more work.
Then there is trust. A visitor cannot read where a square leads. As the habit of refusing unknown squares spreads, putting a line of explanatory text beside one stops being a courtesy and becomes a decision that moves the conversion rate.
Not if you raise the error correction level and keep the logo small. Past that threshold, the square scans on some devices and not others, which is the worst outcome because your own test will pass. Test any logo-bearing square on at least three different phones.
Not if it encodes the destination directly. That is why print work almost always deserves an intermediate address you control: the destination can move and the paper stays valid.
Yes, provided the dark-pattern-on-light-background relationship survives. If your brand colour is a light tone, recolour the background rather than the pattern, and avoid gradients or textured backdrops entirely.
Adding a distinguishing marker to the destination address is enough to separate that traffic. The marker lengthens the payload slightly, so keep it short. If you route through an intermediate address, the measurement is already collected there.
For preparing structured payloads before they go into a square, see working with JSON data; when the square is placed on a web page as an image, the alt text rules in image optimization for SEO apply.