Why Error Correction Matters

In the real world, QR codes face abuse: they get scratched on product packaging, smudged by fingerprints, faded by sunlight, or partially hidden by stickers.

Error correction ensures the code remains scannable despite these imperfections. QR codes use Reed-Solomon error correction, the same algorithm used in CDs, Blu-ray discs, digital television, and deep-space communication.

It works by adding redundant data — essentially encoding the message multiple times in different mathematical forms — so that even if some data is lost, the original can be reconstructed.

The Four Levels

The QR code standard (ISO/IEC 18004) defines four error correction levels. Each trades data capacity for resilience:

LevelNameRecoveryData OverheadCode Size Impact
LLow~7% of codewordsMinimalSmallest code
MMedium~15% of codewordsModerateSlightly larger
QQuartile~25% of codewordsSignificantNoticeably larger
HHigh~30% of codewordsMaximumLargest code

What is a codeword?

A codeword is an 8-bit (1 byte) unit of data in the QR code. The total number of codewords depends on the QR version (size) and error correction level. Error correction percentages refer to the proportion of codewords that can be reconstructed if damaged.

How Reed-Solomon Works (Simplified)

Reed-Solomon error correction treats data as points on a polynomial curve. The key insight: if you know enough points on a curve, you can reconstruct missing points.

1

Polynomial construction

The data codewords are treated as coefficients of a polynomial. For example, data [3, 1, 4, 1, 5] becomes 3x⁴ + x³ + 4x² + x + 5.

2

Redundancy generation

The polynomial is evaluated at additional points to generate error correction codewords. These are appended to the original data.

3

Damage detection

During decoding, all points are checked for consistency. If some don’t fit the expected polynomial, errors are detected.

4

Error reconstruction

Using the remaining correct points, the original polynomial is reconstructed, recovering damaged codewords.

Did You Know?

Reed-Solomon codes were invented in 1960 by Irving Reed and Gustave Solomon at MIT Lincoln Laboratory. The same math that protects your QR code from coffee stains also protects data from NASA's deep-space probes across billions of miles of signal degradation.

Choosing the Right Level

Use CaseRecommendedReasoning
Digital screens (websites, apps)LClean display, no damage risk, smallest code
General print (flyers, cards)MDefault balance of size and resilience
Product packagingQMay be scratched, bent, or partially obscured
Outdoor / industrialQ or HExposed to weather, dirt, and wear
QR code with logo overlayH (required)Logo obscures ~20% of modules

Logo Overlay Compatibility

Adding a logo to a QR code physically destroys the modules underneath it. The QR code survives because error correction rebuilds the lost data.

L (7%)
Safe logo coverage: ~5% logo area
Not recommended for logos
M (15%)
Safe logo coverage: ~10% logo area
Very small logos only
Q (25%)
Safe logo coverage: ~18% logo area
Medium logos with testing
H (30%)
Safe logo coverage: ~22–25% logo area
Recommended for logos

Logo coverage is not equal to error correction percentage

A 30% error correction level does not mean you can cover 30% of the QR code with a logo. Error correction also handles noise, printing imperfections, and scanner errors. The safe logo area is roughly 70–80% of the theoretical maximum.

The Size Trade-Off

Higher error correction means more redundant data, which requires more modules:

  • Level L to Level H can increase the QR version by 1–3 levels (each version adds 4 modules per side).
  • A URL that fits in a Version 2 (25×25) code at Level L might require Version 4 (33×33) at Level H.
  • This means the QR code is physically larger and each module is smaller at the same print size, potentially making it harder to scan at very small sizes.

The takeaway: do not blindly use Level H for everything. Use the lowest level that meets your needs.

Frequently Asked Questions

What error correction level should I use for a QR code with a logo?

Use error correction level H (High) which can recover up to 30% of damaged data. This provides enough redundancy to remain scannable even with a logo covering up to 20–25% of the code area.

Does higher error correction make the QR code bigger?

Yes. Higher error correction adds more redundant data, requiring more modules. A Level H code is approximately 20–25% larger (more modules) than the same data encoded with Level L.

Test error correction in practice

Generate QR codes with different error correction levels and compare scannability.