Skip to content

Guide

QR Code Standards: Versions, Error Correction, and Best Practices

Same square, very different payloads — the spec gives you a lot of room to make codes that fail to scan.

By Published

QR codes feel like a solved problem until you print 5,000 business cards and a third of them fail to scan. The standard gives you a lot of room to make valid codes that nevertheless do not work in the real world. This guide covers the parts of ISO/IEC 18004 that matter for design and integration, and the practical rules that the spec does not state but every QR code in production obeys.

The standard: ISO/IEC 18004

QR codes were invented by Denso Wave in 1994 for tracking automotive parts. The format was opened in 1999 and standardised as ISO/IEC 18004, currently at the 2015 revision. Anyone can generate or decode QR codes without licensing fees; the trademark on the term “QR Code” remains with Denso Wave but is freely licensed for use.

You can generate any of the codes described below with our QR code generator, which produces SVG output suitable for both screens and print — vector means the finder patterns stay crisp at any size, from a 2 cm sticker to a billboard.

Versions 1 through 40

A QR code's version determines its physical size — measured in modules, not pixels. Version 1 is 21×21 modules; each subsequent version adds 4 modules per side, so Version 40 is 177×177. The version you need depends on payload length, encoding mode, and error-correction level. A generator normally picks the smallest version that fits.

Approximate capacity at error-correction level M (15% recovery), the most common choice:

  • Version 1 (21×21): 14 alphanumeric or 20 numeric characters.
  • Version 5 (37×37): 122 alphanumeric or 202 numeric characters — enough for a typical URL.
  • Version 10 (57×57): 395 alphanumeric or 652 numeric.
  • Version 25 (117×117): 1,853 alphanumeric or 3,057 numeric.
  • Version 40 (177×177): 4,296 alphanumeric or 7,089 numeric — the absolute maximum.

Capacity falls off significantly at higher error-correction levels. At level H (30%) the same Version 40 code holds only about 1,852 alphanumeric characters. Pick the lowest version you can — every step up multiplies the number of modules and forces the scanner to focus on a tighter grid.

The four error-correction levels

QR codes use Reed–Solomon error correction, the same algorithm used in CDs, DVDs, and deep-space communication. The codewords are interleaved so that local damage (a coffee stain, a fingerprint, a sticker) destroys a small fraction of each block rather than wiping out a contiguous run of data.

  • L (Low) — recovers ~7%. Maximum data density. Use only for clean, large, on-screen codes.
  • M (Medium) — recovers ~15%. The default for almost everything. Print, screens, packaging.
  • Q (Quartile) — recovers ~25%. Small print, mildly contaminated environments, laminated cards.
  • H (High) — recovers ~30%. Required when overlaying a logo; recommended for outdoor signage, food packaging, equipment labels in dirty environments.

The recovery percentage refers to codewords, not modules — but in practice the two are close enough that designing for the percentage is a reasonable approximation.

Encoding modes

QR codes have four data-encoding modes, and the generator switches between them based on content:

  1. Numeric (0–9). 3.33 bits per digit. The most compact mode; useful for serial numbers, phone numbers, and tracking IDs.
  2. Alphanumeric. 5.5 bits per character. Covers 0–9, A–Z (uppercase only), space, and the punctuation $ % * + - . / :. URLs fit if you uppercase them; some scanners normalise back before opening the link.
  3. Byte (8-bit). 8 bits per byte. The fallback for anything outside the alphanumeric set; almost always UTF-8 text in modern codes.
  4. Kanji. 13 bits per character for Shift-JIS Kanji. Denser than Byte mode for Japanese text, but only supported if both the encoder and the scanner agree on Shift-JIS. Most modern Japanese codes use UTF-8 in Byte mode for safety.

A single QR code can switch modes mid-payload, so a serial number plus a URL can pack tighter than either alone. Good generators do this automatically.

Structured append

For payloads longer than Version 40 supports, the spec allows a single message to be split across up to 16 codes usingstructured append. Each piece carries a header identifying its position in the sequence and a parity byte for verifying the whole message. Scanner support is limited to industrial readers; consumer phone cameras almost universally treat each code as independent. Do not rely on structured append for anything reaching the public.

Micro QR

Micro QR codes (versions M1–M4) shrink the format for space-constrained labelling. M1 is 11×11 modules and holds only 5 numeric characters; M4 is 17×17 and holds up to 35 numeric, 21 alphanumeric, or 15 bytes. They are useful for small printed circuit board labels and integrated-circuit markings; consumer phone scanners support them, but desktop webcam libraries do not always.

Design rules that decide whether it scans

Three things matter more than anything else in the spec:

  1. Contrast. Dark modules on a light background. The contrast ratio between foreground and background should be at least 4:1; sample the swatches in our color picker to confirm before printing. Inverted (light on dark) codes are allowed by the spec but rejected by many scanners, especially older Android camera apps.
  2. Quiet zone. A 4-module margin of background colour on every side. Skipping this — usually because a designer wanted to tuck the code into a tight layout — is the single most common cause of scan failure on professionally produced material.
  3. Module size.At normal phone-camera distance (15–30 cm), modules must be at least 0.4 mm wide to scan reliably. For posters meant to be scanned from across a room, use the rule “distance ÷ 10 = minimum code width.” A code intended to be scanned from 2 m away needs to be at least 20 cm square.

Colour customisation is allowed within those constraints. A dark blue or dark green on cream is fine. A pastel on white is not — the contrast falls below the detection threshold.

Payload formats consumer scanners understand

  • URL. Just paste the URL. Include thehttps:// scheme; some scanners refuse codes without one. Keep URLs short to fit a lower version — use our URL tool to verify encoding.
  • Wi-Fi. Format: WIFI:T:WPA;S:NetworkName;P:Password;H:false;;. Recognised by both iOS and Android camera apps. Set H:true for hidden networks.
  • vCard contact. Standard vCard 3.0 or 4.0 payload between BEGIN:VCARD and END:VCARD. Phones offer to add the contact directly.
  • SMS / tel / mailto. Standard URI schemes (sms:+15551234?body=Hello, tel:+15551234, mailto:[email protected]?subject=Hi). Universally supported.
  • Geo. geo:37.7749,-122.4194 opens the default maps app. iOS may require the Apple-specific http://maps.apple.com/?ll=… fallback on older versions.

Tracking and shortened URLs

Many marketing codes use a shortened URL not to save characters but to track scans and to give the printer an escape hatch if the destination URL changes. The trade-off: the user lands on the redirect before reaching your site, which adds latency and reveals the shortener domain in the preview. If you control the destination, prefer your own short domain over a public shortener — the redirect is faster and the preview reads as your brand.

The honest takeaway

Pick error-correction level M unless you have a specific reason to go higher. Keep the URL short so the version stays low. Respect the quiet zone. Test on at least two phones — ideally one older Android — under realistic light before the code goes to print. Most QR failures are not generator bugs; they are quiet-zone, contrast, or module-size violations that looked fine on the design proof and fell apart in the wild.

Frequently asked questions

Which error-correction level should I pick?
Level M (15%) is a sensible default for screens and clean print. Step up to Q (25%) if the code will be printed at small size, laminated under reflective film, or might pick up dirt — restaurant menus, outdoor signage, equipment labels. Level H (30%) is required when you want to overlay a logo in the centre. Level L (7%) only makes sense when you need maximum data density and the code will be scanned under ideal conditions.
What is the smallest QR code I can print?
The practical minimum is a module size of around 0.4 mm at standard scanning distance. For a Version 3 code (29×29 modules) that puts the printed size near 12 mm square. Below that, camera autofocus starts to struggle. If you need smaller, use a Micro QR code (versions M1–M4) — they top out at 35 numeric characters but scan reliably down to about 8 mm.
Why does my code with a logo still scan?
Reed–Solomon error correction. The code stores enough redundant data to reconstruct missing modules; at level H, up to 30% of the code can be unreadable and the scanner still recovers the payload. Logos must stay inside the central area and never cover any of the three large position-detection squares in the corners.
What is the quiet zone and how big should it be?
The quiet zone is the empty margin around the code that lets the scanner find the boundary. The spec requires 4 modules of empty space on every side. Skipping it is the single most common reason an otherwise valid code fails to scan — the camera sees the surrounding image as part of the pattern and the detector aborts.
Can a QR code be rectangular?
Not a standard QR code — those are always square. Denso Wave's rMQR (Rectangular Micro QR) is a separate ISO standard (ISO/IEC 23941) for rectangular codes, but scanner support is thin outside of industrial inventory contexts. If you need a non-square barcode, look at PDF417 or Data Matrix instead.
What payload formats are recognised by phone cameras?
URL is universal. Beyond that: `WIFI:` joins a network, `mailto:` opens an email draft, `tel:` and `sms:` open the dialer or messages app, `geo:` opens maps, and a vCard payload (`BEGIN:VCARD…END:VCARD`) adds a contact. iOS and Android both recognise these without an app. Avoid custom prefixes — they require a dedicated reader.

Sources & references

Authoritative references cited by this piece. Verified by Buğra Sözeri on the dates shown and re-checked at every deploy.

Related

Published May 31, 2026