How Can a QR Code Still Work When Part of It Is Missing?

Scratched, torn or covered by a logo, many QR codes still scan. The reason is a mathematical spare tyre built into every code.

Short answer

A QR code stores your message plus extra error-correction data. If part of the code is dirty, torn or covered, the scanner uses that extra data to work out what’s missing. Depending on the level chosen when the code was made, roughly 7%, 15%, 25% or 30% of the data can be restored. Damage to the three large corner squares, or more damage than the level allows, can still stop it working.

In this article 6 sections
  1. The familiar observation
  2. What’s really going on
  3. Why some damage matters more than other damage
  4. See it for yourself
  5. Why it won’t always work
  6. Related guides
A weathered QR code sticker fixed to a wooden post outdoors, with trees in the background.
A QR code sticker exposed to sun and rain on a post in Spring Lake Park Reserve, Minnesota. Photo: Tony Webster / Wikimedia Commons, CC BY 2.0

The familiar observation

A crumpled flyer, a sticker with a corner peeled off, a code with a logo printed in its middle — and your phone still opens the link. That isn’t luck, and the phone isn’t guessing. QR codes were designed to survive damage.

The QR Code was developed in 1994 by DENSO WAVE, originally to track automotive parts on production lines — a setting full of grease, scratches and dust. It later became an international standard, ISO/IEC 18004.

What’s really going on

A QR code’s small black and white squares are called modules. They encode the message in chunks called codewords. When a code is created, the generator adds extra codewords calculated with Reed–Solomon error correction, a method also used for data on CDs and in communications.

Those extra codewords don’t repeat the message. They hold mathematical relationships between all the data codewords. When some codewords can’t be read, the scanner uses those relationships to work out what they must have been — a bit like solving for a missing number when you know what the totals should be.

Bar chart of the four QR error-correction levels: L restores about 7% of codewords, M about 15%, Q about 25% and H about 30%.
The four error-correction levels. The person or app creating the code chooses the level. Chart: ByteExplained, based on DENSO WAVE and ISO/IEC 18004 figures
QR error-correction levels
LevelApprox. data that can be restoredTypical use
L (Low)7%Clean environments; fits the most data
M (Medium)15%A common general-purpose choice
Q (Quartile)25%Codes likely to get dirty or worn
H (High)30%Harsh environments, or codes with a logo on top

There is a trade-off. More error-correction data means less room for the message, so for the same content a higher level needs a bigger, denser code.

A stylised QR-like pattern with three corner finder squares and a circular area marked “missing”, beside notes on finder squares, extra codewords and recovery of up to about 30%.
A code can still scan when part is missing, within limits. Stylised pattern — not a scannable code. Illustration: ByteExplained

Why some damage matters more than other damage

Not every part of a QR code is equal.

  • The three large squares in the corners are finder patterns. They tell the scanner that this is a QR code, where it is, and which way up it is. If one is badly damaged, the scanner may not recognise the code at all, even though the data area is intact.
  • Format information near the finder patterns tells the scanner which error-correction level and mask were used. It is stored twice for safety.
  • The data area — everything else — is where error correction does its work.

A logo in the centre of a code works because it sits in the data area and uses up part of the error-correction budget on purpose. That leaves less spare capacity for real-world damage.

A blue and black QR code with a large circular Freedom of Information Philippines emblem covering its centre.
A real code with an emblem printed over its centre. The emblem hides data modules, and error correction fills in what is covered. Image: Government of the Philippines / Wikimedia Commons, public domain

See it for yourself

Try this safely

Generate a QR code for a harmless address, such as your own website, using a generator that lets you choose the error-correction level. Make one at level L and one at level H. Print both and cover a growing area of each with a sticky note, away from the corner squares. The level H code should keep scanning with noticeably more of it covered. Results depend on your phone, the lighting and exactly what you cover.

Why it won’t always work

Error correction has limits:

  • Too much damage. Beyond the level’s capacity, the data can’t be rebuilt.
  • Damaged finder patterns or a missing quiet zone — the blank border around the code — can stop the scanner from locating the code at all.
  • Poor image quality: blur, glare, low contrast, a curved surface or a code printed too small for the distance.

A security footnote

Because a damaged code can still scan, a sticker placed over a genuine code can send you somewhere else entirely. Before entering passwords or payment details, check the address your phone shows after scanning.

Sources and further reading

  1. Information capacity and versions of QR Code — DENSO WAVE (inventor of the QR Code)Capacity by version and error-correction level.
  2. What is a QR code? Structure of QR codes — KEYENCE

Was this article helpful?

Comments

No comments yet. Questions and tips from readers are welcome.