QR Code Error Correction: Why Damaged QR Codes Still Work
How QR codes survive scratches, logos, and dirt. A deep dive into L, M, Q, and H error correction levels.
You've seen QR codes with company logos slapped right in the middle. Part of the code is literally covered up. And yet, when you scan it, it works perfectly.
That's not luck. That's error correction doing its job.
How QR Codes Handle Damage
QR codes use Reed-Solomon error correction, the same math used in CDs, DVDs, and deep-space communication. The idea: store extra redundant data so the original message can be reconstructed even if parts are missing or damaged.
When a QR code is generated, the data is encoded along with error correction codewords. These codewords contain enough information to recover the original data even when a portion of the code is unreadable.
The Four Error Correction Levels
Every QR code uses one of four error correction levels:
| Level | Recovery Capacity | Best For | |-------|------------------|----------| | L (Low) | ~7% damage | Digital screens, clean environments | | M (Medium) | ~15% damage | General purpose, default choice | | Q (Quartile) | ~25% damage | Printed materials, moderate wear | | H (High) | ~30% damage | Harsh environments, logos overlaid |
"Damage" here means the percentage of codewords that can be unreadable while the code still scans successfully.
The Trade-Off: Correction vs Size
More error correction means more redundant data. More data means a more complex (larger) QR code. Here's what that looks like in practice:
For the same content, a QR code with Level H error correction will have noticeably more modules (the tiny squares) than one with Level L. The code becomes denser and harder to scan from a distance.
Level L: Smallest, simplest QR code. Easiest to scan from far away. Least protection.
Level M: Good balance. The default for most generators. Handles typical wear and tear.
Level Q: Significantly more dense. Good for printed materials that might get folded, smudged, or partially covered.
Level H: Maximum density. Can survive serious damage. Required if you want to put a logo in the center.
Why Logos in QR Codes Work
When you place a logo in the center of a QR code, you're effectively "damaging" the code -- making those modules unreadable. The error correction algorithm treats the logo as damaged data and reconstructs the missing information from the remaining modules.
This only works reliably with Level H (or sometimes Q) error correction. At Level L, covering even 8% of the code could make it unscannable.
Some guidelines for logo placement:
- Use Level H error correction
- Keep the logo to roughly 15-20% of the QR code area
- Center the logo (QR codes have important positioning patterns at the corners)
- Use a simple, high-contrast logo
- Always test the final code with multiple scanners
Which Level Should You Use?
Digital displays (websites, apps, screens): Level L or M. The code won't get physically damaged, and smaller codes are easier to scan.
Business cards and flyers: Level M. Standard protection against minor wear.
Product packaging: Level Q. Products get handled, scratched, and exposed to elements.
Outdoor signs and harsh environments: Level H. Maximum resilience against weather, dirt, and physical damage.
QR codes with logos: Level H. No question. You need the extra redundancy to compensate for the covered area.
Quiet Zone Matters Too
Error correction handles damage to the code itself, but QR codes also need a "quiet zone" -- a blank margin around the code. Without it, scanners can't find where the code starts and ends.
The standard requires a 4-module-wide quiet zone. Skipping this is the most common reason QR codes fail, and no amount of error correction can fix it.
Error correction is what makes QR codes practical in the real world. Choose the right level for your use case -- Level M for most situations, Level H when you need logos or maximum durability -- and always test with real scanners before printing.