← Back to home
Home › Image Guides › QR Code Basics

QR Code Error Correction and Capacity: L, M, Q, H Explained

A QR code can be dirty, torn, half-covered by a logo and still scan perfectly. That is not luck — it is error correction, and it is the single setting that decides whether your code survives the real world. Here is what the four levels mean and how to choose one.

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:

LevelCan be restoredTypical use
L (Low)about 7% of the codewordsClean 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 typeMost efficientWhy
Digits onlyup to 7,089 characters (Version 40, level L)Three digits are packed into ten bits
Uppercase letters, digits, a few symbolsup to 4,296Alphanumeric mode, two characters per 11 bits
Any text (UTF-8)up to 2,953 bytesByte mode, one byte per eight bits
Chinese, Japanese, Arabicfewer characters than Latin textEach 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 distanceMinimum code width
Hand-held, ~10 cmabout 2 cm
Arm's length, ~30 cmabout 3 cm
Poster, ~1 mabout 10 cm
Shop window, ~3 mabout 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.

Frequently asked questions

Which error correction level should I use?
M is a safe default for digital display. Move to Q for anything printed that may get scuffed, and to H if you are placing a logo or image over part of the code.
Why did my QR code turn into a dense mess of tiny squares?
Because the data plus the redundancy needed more modules than the current version holds, so the generator moved to a higher version. Shorten the URL or lower the error correction level.
Can I put my logo in the middle?
Yes, if you use level H and keep the logo to roughly 20–25% of the code width. Always test the finished design with a real phone before printing.
Why does my QR code not scan on some phones?
Most often it is low contrast, a missing quiet zone, an inverted colour scheme, or the code being too small for the distance it is scanned from. Check those four first.
Does a QR code ever expire?
No — a static QR code is just an encoded string and works forever. Only codes generated by a service that redirects through its own short link can stop working if that service shuts down.