Which Parts of a QR Code Can Be Lost and Still Recovered

People often say a QR code still reads with 30% missing, but in practice the same missing area can succeed or fail depending on where it is and how it is spread. The reason lies in how the data is laid out and how error correction is computed per block. This article draws the line between damage that is recoverable and damage that is not.

Only the data region can be recovered

QR code error correction protects only the data codewords and the error correction codewords. The function patterns are not covered: the corner finder patterns, the timing patterns and the alignment patterns cannot be reconstructed by computation. Worse, if they are destroyed the reader never locates the symbol, so recovery never even starts.

In other words, "level H survives 30% loss" is a statement about the data region, not about the total area of the symbol. What each function pattern does, and what its damage looks like, is covered in What the Corner Squares of a QR Code Do.

Correction works on codewords, not on bits

This is the single most important fact when reasoning about recoverability. A QR code handles data in codewords of 8 modules (8 bits), and Reed-Solomon correction operates per codeword.

Several consequences follow:

The order in which data is laid out

Codewords are placed starting at the bottom-right corner, moving upward in two-module-wide columns; on reaching the top the placement shifts two columns to the left and moves downward, and so on in a boustrophedon zigzag. Modules occupied by function patterns are skipped, and column 6, which holds the vertical timing pattern, is skipped entirely.

Demo: the path codewords follow

A version 2 QR code is generated in your browser, with the placement path of the data and error correction codewords drawn as a red line. The grey and navy modules are reserved areas such as function patterns, which the path routes around. The orange and blue bands mark each codeword of 8 modules.

As the diagram shows, codewords that are adjacent in sequence are also adjacent physically. That is the straightforward arrangement, but on its own it is a weakness: a single concentrated blot would destroy a run of consecutive codewords.

Block splitting and interleaving

Block splitting and interleaving close that gap. From larger versions onward, the data codewords are divided into several blocks, and error correction codewords are computed independently for each block. When the codewords are placed in the symbol, one is taken from each block in turn and they are laid down alternately. That is interleaving.

The effect is that physically adjacent codewords belong to different blocks. Even a large blot over one part of the symbol spreads its damage thinly across several blocks, so each block is more likely to stay within its correction capacity. The design exists precisely to avoid concentrating damage in one block until that block becomes unrecoverable.

Version / levelBlocksData codewordsError correction codewords
1 / L1197
1 / M11610
1 / H1917
5 / Q46272
10 / M5216130
10 / H8122224
40 / L252,956750
40 / H811,2762,430

Version 1 has a single block at every error correction level. Small QR codes are fragile against damage concentrated in one spot precisely because there are no other blocks to spread it into. At the other extreme, version 40 at level H is divided into 81 blocks.

How much one block can absorb: when the positions of the errors are unknown, Reed-Solomon corrects up to about half of that block's error correction codewords. When the damaged positions are known (erasures), it corrects up to as many codewords as there are error correction codewords. Simply knowing where the damage is doubles the correction power. Note that in the smallest versions a few error correction codewords are reserved to guard against misdecoding, so the real figure is slightly below half.

Recoverability by where the damage is

Type of damageChance of recoveryWhy
One corner finder pattern destroyedClose to hopelessFunction patterns are not covered; detection itself fails
No quiet zone, code touching the backgroundLow (though adding margin in an image editor sometimes works)The ratio test breaks and the code is not detected
One concentrated blot over the data regionHighInterleaving spreads it across several blocks
Fine speckling all over the codeLower than the area suggestsCounting is per codeword, so little area consumes many codewords
A large area missing from the bottom right toward the centreModerateIt is data region, but a large loss can exceed each block's capacity
Inverted or washed-out coloursHighNo information is actually lost; binarization or inversion restores it

When attempting recovery from a real image, the fastest route is to first separate information that is genuinely lost from information that was merely captured badly. Bleeding, blur and low contrast are capture problems, and image processing has a good chance of undoing them. Only physical tearing or over-painting is a job for error correction.

Free Tool Try recovery with QR Code Photo Restore Enhance, binarize and deblur a photographed QR code, retrying automatically until it decodes. Free Tool Measure the limit with the QR Error Correction Tester Hide parts of a QR code and see for yourself how far each error correction level keeps decoding.

Summary

Frequently Asked Questions

How much of a QR code's area can be missing and still be recovered?

Area alone does not decide it. Error correction protects only the data region; function patterns such as the corner finder patterns are excluded. Reed-Solomon also corrects in units of one codeword of 8 modules, so for the same area, finely scattered damage consumes more codewords and is worse.

Why is a QR code resistant to one concentrated blot?

Because the data codewords are divided into several blocks and are laid down one from each block in turn, which is called interleaving. Physically adjacent codewords therefore belong to different blocks, so the damage from a concentrated blot is spread across several blocks.

How many codewords can one block correct?

When the positions of the errors are unknown, up to about half of that block's error correction codewords. When the damaged positions are known, which is called erasure, up to as many codewords as there are error correction codewords. In the smallest versions a few are reserved to guard against misdecoding, so the real figure is slightly below half.

What can be done if a corner finder pattern is missing?

Error correction cannot recover it. Function patterns are outside the scope of correction, and without them a reader cannot detect the symbol at all. Unless the corners can be redrawn in an image editor, obtaining the original QR code again is the reliable option.

← Back to Tech Blog