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.
Three features do the heavy lifting:
- Finder patterns. The three large squares in the corners tell a scanner where the code is and how it is rotated. This is why a scanner can read a code held at an angle or upside down. There are three rather than four so the scanner can also work out which way is up.
- Timing patterns. The alternating line of modules running between the finder patterns tells the scanner how wide a single module is, which is how it copes with being read from different distances.
- Error correction. Extra Reed-Solomon data is woven in so the code can still be read when part of it is missing or damaged.
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:
version 2 · 25×25
version 3 · 29×29
version 3 · 29×29
version 4 · 33×33
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:
- Keep dark-on-light. Black on white is the safest. A dark colour on white or a very pale background is usually fine.
- Avoid light-on-dark. Inverted codes work on many modern phones and fail on plenty of other readers. If you invert, test on several devices first.
- Watch the luminance, not the hue. Red on green looks like strong contrast to the eye but can be nearly identical in luminance, and the scanner sees luminance.
- Do not let the background show through. A code over a photo or a busy pattern is unreliable no matter how good the contrast is in theory.
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
- Printing too small. The single most common cause of failure. Check the one-to-ten rule, then add margin for error.
- Trimming the quiet zone. Four clear modules on every side, always.
- Stretching the code. Keep it square. Scaling proportionally is fine; squashing it to fit a layout distorts the module grid.
- Putting it on a curved or reflective surface. A glossy sticker on a bottle reflects light straight back into the camera.
- Using a low-resolution export for print. Use the SVG, or a large PNG. A 200 px PNG stretched across a poster is a blur.
- Cramming in a long URL. Every character raises the version and shrinks the modules. Shorten the link before you encode it.
- Never testing it. Scan the final artwork, on the final material, in the final lighting, on more than one phone.
Test before you print
A short checklist that catches almost everything:
- Scan the digital file from your screen, at 100% zoom.
- Print one proof copy on the real material, at the real size.
- Scan it with at least two different phones, including an older one.
- Scan it in the lighting it will actually live in — dim rooms included.
- 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.