Quick answer
QR codes include built-in redundancy called error correction. Depending on the level chosen when the code was created (L, M, Q, or H), a scanner can reconstruct the full message even when 7% to 30% of the code is scratched, torn, covered, or dirty. That's why a QR code with a logo in the middle still scans perfectly.
Why QR codes need error correction
QR codes live in the real world: printed on receipts that get crumpled, stickers that fade in the sun, posters that get scribbled on, and menus that collect stains. A barcode format that failed the moment one pixel was unreadable would be useless in practice.
So the QR standard (ISO/IEC 18004) builds recovery data directly into every code. When your scanner reads a damaged code, it isn't guessing — it's mathematically reconstructing the missing pieces from redundant data stored elsewhere in the pattern.
The four error correction levels
Every QR code is generated at one of four levels. The creator picks the level; the scanner detects it automatically.
- Level L (Low) — recovers up to about 7% damage. Maximizes data capacity, best for clean digital screens.
- Level M (Medium) — recovers up to about 15% damage. The most common default.
- Level Q (Quartile) — recovers up to about 25% damage. Good for print in rough conditions.
- Level H (High) — recovers up to about 30% damage. Used for codes with logos, or harsh environments.
There's a trade-off: higher correction levels store more redundancy, so the same data needs a physically denser code. A Level H code holds roughly half the data of a Level L code of the same size.
How the math works (in plain language)
QR codes use Reed-Solomon error correction, the same family of math that lets scratched CDs and DVDs keep playing and that protects data sent from space probes.
The idea, simplified: instead of storing your message once, the generator runs it through polynomial math that produces extra check codewords. These are spread across the grid alongside the data. When some modules (the little squares) are unreadable, the scanner treats them as unknowns and solves for them using the surviving codewords — like solving a sudoku where the remaining clues still pin down every missing cell.
This is also why logo-in-the-middle QR codes work: the logo deliberately destroys part of the code, and a Level H setting ensures the destroyed part stays within the recoverable budget.
What error correction cannot fix
Error correction recovers damaged data modules, but some parts of a QR code are structural. If these are destroyed, no level can save the scan:
- The three large corner squares (finder patterns) — the scanner uses them to locate and orient the code.
- The timing patterns — the alternating lines connecting the corners, used to measure the grid.
- Severe blur or low resolution — if modules smear together, the scanner can't read a grid at all. That's an image-quality problem, not a damage problem.
This is why a code with a torn corner often fails while a code with a hole in the middle scans fine.
Practical tips for scanning damaged codes
- Capture the code flat and straight-on to help the scanner find the corner patterns.
- Use even lighting — glare and shadows read as damage and eat into the recovery budget.
- Get more resolution: move closer or crop the image tightly around the code.
- For screenshots, zoom in before capturing so each module is several pixels wide.
- Try an image upload instead of live camera — a still photo is often sharper than a video frame.
ScanQR runs two decoders (ZXing and jsQR) on every image, which helps with borderline cases: try it at /image-qr-scanner
Choosing a level when creating your own codes
If you're generating codes, match the level to the destination:
- Digital use (screens, emails): Level L or M — screens don't get scratched.
- Standard print (flyers, cards): Level M or Q.
- Outdoor, industrial, or logo-branded codes: Level H.
You can create codes with our free generator: /qr-code-generator
FAQ
Can a QR code be repaired if it's too damaged to scan?
Sometimes. If the finder patterns are intact, photo editing (increasing contrast, painting over stains) can push a code back inside the recoverable range. If a corner square is gone, recovery is generally impossible.
Does higher error correction make codes more secure?
No — error correction is about physical durability, not security. Anyone can read any QR code. For link safety, decode first and check the domain before opening: /secure-qr-scanner
Do all scanners support error correction?
Yes. It's part of the QR specification itself, not an optional feature — any standards-compliant decoder performs the same reconstruction.
Scan any QR code, damaged or not
Upload a photo or screenshot and ScanQR will decode it locally in your browser — no app, no uploads: /image-qr-scanner