Guide

QR Code Design & Best Practices

A QR code can be perfectly valid and still fail constantly in the real world. Contrast that looks fine on a monitor, a logo sized by eye, a margin tightened to fit a layout, or a code scaled to the space available rather than the distance it'll be read from — each produces a code that passes on a designer's desk and fails on a customer's phone. This guide covers the decisions that decide which of those you end up with.

The short version

  • Contrast is a threshold, not a preference. Scanners need a sharp brightness difference — colour that looks distinct to you can be invisible to a camera.
  • The quiet zone is part of the code. Four blank modules on every side, non-negotiable, and the most common single cause of failure.
  • Logos can cover far less than you've been told — about 15% of the code's area, not the 20–30% repeated everywhere. We measured it.
  • Never let anything touch the three corner finder patterns. That failure happens before error correction can help.
  • Size to viewing distance, not to available space — roughly one tenth of the distance it'll be scanned from.
  • Shortening the payload beats every other reliability lever, because it makes every module physically bigger.

Contrast and colour

A scanner doesn't see colour. It converts the image to brightness and looks for a threshold that separates dark modules from light ones. That single fact explains most colour-related failures: two colours can be obviously different to your eye and nearly identical in brightness, at which point the code simply isn't there as far as the camera is concerned.

Six real QR codes in different colour combinations with computed contrast ratios: black on white at 21 to 1, navy on white, indigo on a pale tint, mid grey on white with too little separation, red on green at 1 to 1 which also fails for colour blindness, and white on near black which is high contrast but inverted.
Contrast ratios here are computed from the actual colour values, not estimated. Red on green is the instructive one — visually loud, and a 1.0:1 brightness ratio.

Practical rules that follow from this:

  • Keep dark modules genuinely dark and the background genuinely light. Aim for a contrast ratio of at least 7:1; black on white gives you 21:1 and the widest margin for bad lighting and cheap print.
  • A branded colour is usually fine if it's dark. Navy, forest green, deep burgundy on white all work. Mid-tones — the greys, the pastels, anything you'd call "muted" — do not.
  • Never colour the background darker than the modules. That's an inverted code, and it's a separate problem from contrast.
Inverted codes deserve their own warning

Light modules on a dark background can have excellent numerical contrast and still scan unreliably, because most scanner software is tuned to expect dark-on-light and some won't attempt the inverse at all. A contrast checker will happily pass an inverted pair — including ours — because contrast ratio is polarity-blind by definition. If you use one of our dark-background templates, test it on several real devices before committing to print.

The full guide to QR code colours →

The quiet zone, and putting codes on artwork

The quiet zone is the blank margin around the code — at least four modules wide on every side. It is part of the specification, not a styling suggestion, and it is how a scanner works out where the code stops and the world begins.

Two identical QR codes side by side. The left keeps the required four-module blank margin and scans. The right has headline text and rules pushed against its edges, leaving no quiet zone.
The same code, twice. Nothing is wrong with the grid on the right — the margin is the whole problem.

This is where design pressure does the most damage, because tightening a margin is the obvious move when a layout is crowded. It shouldn't be. When space is tight, shrink the whole code rather than its quiet zone — a smaller code with a correct margin scans; a larger one without a margin may not scan at all.

Codes placed over photography

Putting a code straight onto an image fails twice over: there's no quiet zone, and there's no consistent brightness threshold, because the background changes underneath the modules.

Two QR codes on the same busy photographic background. The first sits directly on the image with no margin and no consistent contrast. The second sits on a solid white plate that restores both the quiet zone and the contrast.
The fix is a solid plate behind the code — not a lightened photo, not a semi-transparent panel.

Logos and branding

A logo in the centre of a code works, and it's the single most requested piece of QR branding. Error correction is what makes it possible — the covered modules are treated as damage and reconstructed. But the budget is much smaller than the internet says.

The same level H QR code shown three times with a centred logo covering 10 percent, 16 percent and 25 percent of its area. The first two still decode; the third does not.
Decoded with a real barcode detector rather than assumed. 25% coverage genuinely fails, despite being inside the range most guides recommend.

We swept coverage levels against a real scanner across several code versions at level H. The cliff sits between 16% and 20% of the code's area — and that's with a clean digital render and a perfect quiet zone, conditions kinder than any print run. Plan for 15% or less.

Placement matters as much as size:

Three level H QR codes: a logo covering 12 percent centred which scans safely, a logo of the same size overlapping a corner finder pattern which prevents the code being located at all, and a centred logo covering 50 percent which is beyond recovery.
Same logo, three placements. The middle one is the instructive failure — it's small, and it still kills the code completely.

The middle case is worth dwelling on. That logo covers only 12% of the code, well inside the safe budget, and the code is unreadable — because it sits on a finder pattern. The scanner uses those three corners to locate and orient the code before error correction is available, so damage there isn't damage the correction budget can spend against. It's structural.

The complete guide to adding a logo →

Density: the lever most people miss

When a code won't scan reliably, the instinct is to raise the error correction level. That's usually the wrong move — it adds modules, and at a fixed printed size more modules means every module gets smaller. The lever that actually helps is shortening what you encode.

Two real QR codes drawn at the same printed width. The one encoding a short redirect URL has comfortably large modules. The one encoding a long tracking URL needs a much larger grid, dropping each module below the 0.4 millimetre print floor at a 2 centimetre printed size.
Identical printed size. The only difference is how much text is encoded — and it decides whether the code is printable at 2 cm.

This is the strongest practical argument for dynamic codes on printed material: the code encodes a short redirect regardless of how long the real destination and its tracking parameters are, so the grid stays sparse and every module stays large.

When a code has to survive difficult conditions, work the levers in this order: shorten the payload, then increase the physical size, then raise the correction level. That ordering reflects how much reliability each one actually buys.

Size, distance and print resolution

Code size is a function of scanning distance, not of how much room the layout has. The working rule is one tenth: minimum printed width ≈ scanning distance ÷ 10.

A diagram showing a QR code's minimum printed width as roughly one tenth of its scanning distance, with a table of placements from a table tent at 12 inches needing 1.2 inches up to a billboard at 50 feet needing 5 feet.
Treat these as floors, not targets — add headroom for bad light and older cameras.

Underneath that rule is the real constraint: the size of one module. Keep modules at 0.4 mm or larger in print. Below that, ordinary ink spread starts merging adjacent modules into each other, and no amount of source-file quality prevents it.

The same QR code at three module sizes with increasing blur standing in for ink spread: 0.8 millimetres stays crisp, 0.4 millimetres is at the practical floor, and 0.2 millimetres merges adjacent modules together.
The blur here stands in for ordinary ink spread on paper. This failure mode is invisible in your design file.

Full sizing guide for print and screen →

Where codes actually fail

Almost every "this code just won't scan" complaint lands in one of a small set of causes. Ranked roughly by how often they're the culprit:

CauseWhy it happensFix
No quiet zoneMargin tightened to fit a layoutFour modules minimum; shrink the code instead
Low contrastBrand colour chosen by eye, not brightnessDark modules on a light background, ≥7:1
Too small for the distanceSized to available spaceDistance ÷ 10
Payload too longFull tracking URL encoded directlyShort link or a dynamic code
Logo too large or misplacedFollowing the common 20–30% advice≤15% of area, never on a corner
Placed over imageryDesign preferenceSolid plate behind the code
GlareGloss lamination or a screenMatte stock; raise screen brightness
Inverted polarityLight-on-dark stylingTest widely, or don't

Every failure mode in detail →

Frequently asked questions

Can a QR code be any colour?

Technically yes — colour has no effect on the encoded data. Practically, the dark modules need to stay genuinely dark and the background genuinely light, because a scanner works from brightness rather than hue. Dark brand colours on white are fine; mid-tones, pastels and light-on-dark are where problems start. Two colours can look completely distinct and still have nearly identical brightness, which makes the code invisible to a camera.

How much of a QR code can a logo cover?

About 15% of its area at error correction level H — meaningfully less than the 20–30% most guides quote. We tested this by decoding a sweep of coverage levels with a real barcode detector across several code versions, and codes started failing between 16% and 20% under conditions better than any print job. Because this is area rather than width, 15% of area is roughly 38% of the code's width. The logo must also never touch the three corner finder patterns, regardless of size.

Why does my QR code work on my phone but not on customers' phones?

That's the signature of a code sitting right at a limit rather than comfortably inside one — usually a logo slightly too big, contrast slightly too low, or a size slightly too small. Cameras, decoding libraries and lighting vary enough that a marginal code passes on the device you happen to test with and fails elsewhere. Treat inconsistent scanning as a failure, not a partial success, and test across several devices before printing.

Do rounded or dot-style modules break scanning?

Not on their own — the grid positions haven't changed, only how each module is drawn, and modern scanners handle styled modules well. Risk comes from aggressive stylisation: very small dots with large gaps reduce the effective dark area, and heavy rounding softens the boundary between adjacent modules. Both get worse at small print sizes. Style moderately, and test the actual styled code rather than assuming a plain one's behaviour carries over.

Should I use a higher error correction level to be safe?

Only if something is covering the code. Otherwise a higher level adds modules, and at a fixed printed size that makes every module smaller — which is itself a scanning risk. For a clean code with nothing on top of it, level M gives plenty of real-world tolerance while keeping modules comfortably large. Defaulting everything to H is a common habit that can make codes slightly worse.

Go deeper: the full Design series