Guide

How to make a QR code that actually scans

Most QR code failures are not mysterious. They come down to four things: size, contrast, the quiet zone around the code, and whether the code was tested on a real phone before it was printed. This guide covers all four, plus what error correction costs you and when a dynamic code is worth the trade-off.

Last updated

What a QR code is

A QR (quick response) code is a two-dimensional barcode. Where a traditional barcode stores a number in a single row of bars, a QR code stores data in a square grid of black and white modules. That extra dimension is why a QR code can hold a URL, a Wi-Fi password or a whole contact card, while a barcode holds a dozen digits.

It was invented in 1994 by Denso Wave to track parts in car manufacturing, and the specification was published openly, which is why it became the standard rather than one company's format. Any camera phone can read one because the decoding rules are public.

How a QR code carries data

A QR code is not a random pattern. Every part of it has a job, and knowing which part does what explains most of the rules further down this page.

Diagram of a QR code showing its quiet zone, three finder patterns, timing patterns and data modules
Finder patterns — three of them, so a scanner can find the code and work out its rotation Timing patterns — tell the scanner how big each module is Data and error-correction modules Quiet zone — at least four empty modules on every side

Three features do the heavy lifting:

A QR code also has a version, from 1 (21×21 modules) to 40 (177×177). More data means a higher version, which means smaller modules for the same printed size — and smaller modules are exactly what makes a code fail to scan.

Error correction: the level you choose has a cost

Error correction is the reason a QR code survives a scratched surface or a logo dropped in the middle. The four levels trade capacity for resilience. Here is the same web address encoded at each level:

Low (L) ~7% recoverable
version 2 · 25×25
Medium (M) ~15% recoverable
version 3 · 29×29
Quartile (Q) ~25% recoverable
version 3 · 29×29
High (H) ~30% recoverable
version 4 · 33×33
The same web address encoded at all four levels. Nothing about the content changed, yet the code grows from 25×25 modules at level L to 33×33 at level H — and every extra module is a smaller square when printed at the same size.

The cost is density. Raising the level packs in more correction data, so the code needs more modules for the same payload. Two codes carrying the same URL at the same printed size are not equivalent: the level H one has smaller modules and is harder to scan. If you raise the error correction level, raise the printed size to match.

Level Recoverable damage Best for
L — Low About 7% Large, clean, controlled printing where you want the smallest possible code.
M — Medium About 15% The sensible default. Use this unless you have a reason not to.
Q — Quartile About 25% Small print, industrial settings, or surfaces that may get dirty.
H — High About 30% Overlaying a logo, or printing on something that will be handled and scuffed.

How much data fits in a QR code

Capacity depends on three things at once: the version, the error correction level, and whether the data is numeric, alphanumeric or raw bytes. The largest code allowed by the specification is version 40, and at the lowest error correction level it holds:

Data type Maximum at level L Characters allowed
Numeric only 7,089 digits 0-9
Alphanumeric 4,296 characters 0-9, A-Z, space and $%*+-./:
Bytes (UTF-8) 2,953 bytes Any text, including lowercase and accents

Those maxima are theoretical and you should not aim for them. A version 40 code at level L is a dense 177×177 grid that has to be printed large and scanned slowly. For anything a person is going to scan with a phone, keeping the payload short is far more effective than choosing a clever setting. If you need a long URL, shorten it first.

Size: the one-to-ten rule

The most useful rule in QR printing is a ratio: the code should be roughly one tenth of the scanning distance. A code read from 30 cm needs to be about 3 cm across; a poster read from 3 metres needs a code about 30 cm across. This is a starting point, not a law — more data in the code means you should go larger.

Typical scanning distance Minimum code size Where you see this
15 cm (6 in) 2 cm (0.8 in) Business cards, product packaging
30 cm (12 in) 3 cm (1.2 in) Flyers, table tents, menu cards
1 m (3 ft) 10 cm (4 in) Shop windows, shelf talkers
3 m (10 ft) 30 cm (12 in) Posters, small signage
6 m (20 ft) 60 cm (24 in) Large format signage, billboards at close range

Measure the code itself, not the sign it sits on, and measure across the flat edge — not the diagonal.

Contrast and colour

Scanners work by detecting the difference between light and dark. The specification expects dark modules on a light background for a reason: that is what the optical sensor and the decoding algorithm assume. So:

The quiet zone

A QR code needs a clear margin of at least four modules on every side. This is the quiet zone, and it is the pale border in the diagram further up this page. It looks like wasted space and it is routinely cropped by designers, and then the code will not scan — the scanner needs that emptiness to find the code's edges.

When you download from a generator, the margin is included. The mistake happens later, when the code is pasted into a layout and someone trims the white border to make it line up with the text.

Static vs dynamic QR codes

This is the decision with the longest consequences, so it is worth being clear about it.

Static Dynamic
What it holds Your content, encoded directly A short link to a redirect service
Works offline Yes — nothing has to be online No — every scan needs the provider
Lifetime Forever Until the provider or subscription ends
Edit the destination later? No Yes
Scan analytics None possible Counts, times and rough locations
Who sees the scans Nobody The redirect provider

If the destination is fixed and you do not need analytics, a static code is simpler and more durable. QR Studio generates static codes, so what you download keeps working independently of this site — see how the generator is built.

Common mistakes

Test before you print

A short checklist that catches almost everything:

  1. Scan the digital file from your screen, at 100% zoom.
  2. Print one proof copy on the real material, at the real size.
  3. Scan it with at least two different phones, including an older one.
  4. Scan it in the lighting it will actually live in — dim rooms included.
  5. Check what opens. A code that scans but leads to the wrong page is still broken.

Frequently asked questions

How big should a QR code be?

One unit of size for every ten units of scanning distance. From 30 cm, use at least 3 cm; from 3 m, at least 30 cm. Add size if the code holds a lot of data or uses a high error correction level.

Do QR codes expire?

Static codes that encode their content directly do not expire — there is no server in the loop. Dynamic codes pointing at a redirect URL stop working when the provider or subscription goes away.

What error correction level should I use?

Medium (M) as a default. Move to Quartile or High for small print, harsh environments, or when you want to overlay a logo — and increase the printed size to compensate for the extra density.

Can I invert the colours?

It is risky. The spec assumes dark on light and many scanners will not read an inverted code. If you must invert, test on several devices before committing to print.

How much white space does a code need?

Four modules on every side, minimum. That is the quiet zone, and cropping it is a common reason printed codes fail.

Should I use static or dynamic?

Static when the destination is permanent — it never breaks and it tracks nobody. Dynamic only when you need to edit the destination later or measure scans, and accept the dependency that comes with it.

Why does my code work on one phone but not another?

Usually the code sits at the edge of what a camera can resolve. Older phones have lower-resolution sensors and slower autofocus, so a code a new phone reads easily can fail on an older one. Print larger, raise the contrast, or drop to a lower error correction level to reduce density.

How many characters can a QR code hold?

At most 4,296 alphanumeric characters or 2,953 bytes, in a version 40 code at the lowest error correction level. Aim far below that: every extra character makes the code denser and harder to scan.

Ready to make one?

The generator handles all eight content types, with live preview and PNG or SVG downloads. Your first three codes are free.

Open the QR code generator