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:
| Level | Name | Recovery | Data Overhead | Code Size Impact |
|---|---|---|---|---|
| L | Low | ~7% of codewords | Minimal | Smallest code |
| M | Medium | ~15% of codewords | Moderate | Slightly larger |
| Q | Quartile | ~25% of codewords | Significant | Noticeably larger |
| H | High | ~30% of codewords | Maximum | Largest code |
What is a codeword?
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.
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.
Redundancy generation
The polynomial is evaluated at additional points to generate error correction codewords. These are appended to the original data.
Damage detection
During decoding, all points are checked for consistency. If some don’t fit the expected polynomial, errors are detected.
Error reconstruction
Using the remaining correct points, the original polynomial is reconstructed, recovering damaged codewords.
Did You Know?
Choosing the Right Level
| Use Case | Recommended | Reasoning |
|---|---|---|
| Digital screens (websites, apps) | L | Clean display, no damage risk, smallest code |
| General print (flyers, cards) | M | Default balance of size and resilience |
| Product packaging | Q | May be scratched, bent, or partially obscured |
| Outdoor / industrial | Q or H | Exposed to weather, dirt, and wear |
| QR code with logo overlay | H (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.
Logo coverage is not equal to error correction percentage
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.