A QR code on a scratched ticket may scan without complaint. That does not mean the missing corner was unimportant. It means the code was designed to tolerate mistakes.

A QR code stores information in a square grid of dark and light modules. Unlike a traditional striped barcode, it uses both horizontal and vertical space. A phone camera captures the pattern, and software interprets the image as data.¹

First, find the square

The three conspicuous squares in the corners are position-detection patterns. They help the scanner locate the code and determine its orientation even if you hold the phone at an angle.² Other fixed patterns help the software understand the grid’s spacing and layout.

The remaining modules include the message itself plus information about how it was encoded. A code might contain a web address, a short piece of text or other data. The familiar black-and-white appearance is a visual form of stored bits, but not every square simply represents a letter.

Then, repair the errors

QR codes contain deliberate redundancy. The system adds Reed–Solomon error-correction data, a mathematical way to reconstruct missing or incorrect codewords. A codeword is a unit of eight bits. DENSO WAVE, which developed the QR code, describes four correction levels: L, M, Q and H. Their approximate restoration capacities are 7%, 15%, 25% and 30% of total codewords.³

Higher correction comes with a trade-off. More space is spent on recovery information, leaving less room for the payload at a given symbol size. A designer choosing a code for a clean indoor poster may use a different level from someone expecting grime on industrial labels.

The percentages are not a promise that you can cut away exactly that share of the visible picture. Damage location matters. A scratched patch may destroy a cluster of data modules; damage to positioning patterns can stop the scanner finding the grid at all. Glare, blur, low contrast and poor printing can also defeat an intact code.

This is why some QR codes accept a small logo in the middle while others do not. The logo covers modules, but a suitably sized code with a sufficiently high correction level may recover them. The logo does not have a magic exemption from the rules; it consumes some of the code’s error budget.

The difference between reading and trusting a code

Error correction helps a scanner recover what was printed. It does not tell you whether the message itself is safe or truthful. A perfectly readable QR code can lead to a misleading web page. The square pattern authenticates neither the destination nor the person who placed the sticker.

That distinction matters because damaged codes invite two opposite assumptions: that any readable code must be intact and reliable, or that a torn code must be useless. Neither follows. The scanner can reconstruct some data accurately, while the content of that data still deserves ordinary caution.

Why printing quality matters

The quiet margin around a QR code helps a reader distinguish it from its surroundings. If the code is printed too small, blurred, low contrast or curved round a surface, the camera may struggle to identify individual modules. Error correction can repair wrong or missing codewords, but it cannot always rescue a picture from which the grid cannot be found.

The square finder patterns are important for the same reason. They allow quick recognition at many angles.² A phone usually straightens the photographed square into a grid before decoding it. That software step feels invisible because it happens quickly, but it is one reason the code tolerates being held slightly askew.

QR codes also vary in size. More data needs more modules or denser packing. A short link can be printed in a simpler pattern than a long block of text, leaving more room to choose robust correction and legible modules.¹

The result is a design built around an imperfect world: cameras move, paper creases, labels get dirty and light falls unevenly. The code expects some of that trouble in advance. It succeeds when the remaining visual structure is enough to locate the grid and the remaining data plus correction code is enough to reconstruct the message.³

Damage has a budget

Imagine spending part of a code’s capacity on spare information. As more spare information is added, the reader can tolerate more errors, but less room remains for the original message. The four correction levels are different choices along that trade-off.³

The budget is also uneven in practice. A logo covering a small central patch might be recoverable; a scratch across a finder square can prevent the scanner from identifying the symbol at all. That is why successful scanning depends on both image recognition and mathematical repair. They are separate jobs, and each has limits.

A scanner also checks whether the reconstructed data make sense according to the code’s encoding rules. The error-correction mathematics can recover damaged codewords within its capacity, but once too much information is lost, decoding fails rather than producing a trustworthy partial sentence. That clean failure is part of the design’s usefulness.

The cleverness lies in two jobs happening together. Geometric markers help the camera see where the code is, while redundant data helps repair what it cannot see clearly. A partly damaged square can still deliver a complete message because the complete message was never entrusted to every square equally.