QR Code Error Correction and Capacity: L, M, Q, H Explained
What error correction actually does
A QR code stores your data plus a set of redundancy blocks computed from it. When a scanner cannot read a part of the image, it uses the redundant data to reconstruct what is missing. The more redundancy you ask for, the more damage the code can survive — and the more space that redundancy takes up.
Four levels are defined in the standard:
| Level | Can be restored | Typical use |
|---|---|---|
| L (Low) | about 7% of the codewords | Clean digital display, short URLs |
| M (Medium) | about 15% | Default in most generators — a sensible balance |
| Q (Quartile) | about 25% | Printed posters, packaging, minor wear expected |
| H (High) | about 30% | Codes with a logo or image in the centre, industrial labels |
Note that the percentage is of codewords, not of the picture area — but as a rough guide, level H tolerates roughly a third of the code being obscured.
The trade-off nobody mentions
Higher correction is not free. More redundancy means more modules (the little squares) for the same message, which means:
- the code looks denser and each module becomes smaller;
- it needs to be printed or displayed larger to stay scannable;
- a low-resolution screen or a cheap printer may simply fail to resolve the individual modules.
Practical rule: pick the lowest level that still covers your risk. A code on a screen rarely needs more than M. A code printed on a flyer that will be folded, or one carrying a logo, should use Q or H.
Versions and how much actually fits
"Version" is simply the size of the grid. Version 1 is 21×21 modules; every step adds four modules per side, up to Version 40 at 177×177. Bigger version means more capacity.
| Content type | Most efficient | Why |
|---|---|---|
| Digits only | up to 7,089 characters (Version 40, level L) | Three digits are packed into ten bits |
| Uppercase letters, digits, a few symbols | up to 4,296 | Alphanumeric mode, two characters per 11 bits |
| Any text (UTF-8) | up to 2,953 bytes | Byte mode, one byte per eight bits |
| Chinese, Japanese, Arabic | fewer characters than Latin text | Each character costs 2–3 bytes in UTF-8 |
This is why a long URL pushes the version up quickly: every extra character adds modules, and every redundancy block from a higher error correction level adds more. Shorten the URL first if your code is getting dense.
Why a logo in the middle still scans
Putting a logo in the centre works precisely because of error correction — the covered modules are treated as damage and reconstructed. It is not a special feature, it is the redundancy doing its job. That also means:
- it only works reliably at level H (or Q at a push);
- the logo should stay well inside the area — roughly 20–25% of the width is the practical ceiling;
- you must test the finished code with a real phone before printing a thousand copies.
Design rules that keep a code scannable
- Keep the quiet zone. A margin of at least four modules on all four sides, in a light colour. Scanners use it to find the code's edges; without it, detection often fails outright.
- Do not invert the colours. Many scanners expect dark modules on a light background. A white-on-black code may fail on older readers.
- Keep contrast high. Dark navy on white is fine; light grey on white is not. Avoid gradients that cross the modules.
- Never distort it. Stretching a QR code non-uniformly breaks the module grid. Resize proportionally only.
- Mind the surface. Glossy reflections, fabric texture and curved surfaces all reduce effective contrast — raise the error correction level to compensate.
How big does a printed code need to be?
The practical limit is the scanning distance, not the printing press. A widely used rule of thumb is a ratio of about 10:1 — the scan distance should be roughly ten times the code's width:
| Scan distance | Minimum code width |
|---|---|
| Hand-held, ~10 cm | about 2 cm |
| Arm's length, ~30 cm | about 3 cm |
| Poster, ~1 m | about 10 cm |
| Shop window, ~3 m | about 30 cm |
Also give each module enough physical size: at 300 DPI printing, a module should be at least 3–4 pixels wide, which for a medium-density code means roughly 1 cm or more overall.