A flyer smeared by rain, a tabletop POP sign at a restaurant with corners worn ragged from handling—yet a smartphone camera reads the QR code printed on it without hesitation. Even when a person would struggle to make out half-erased text on paper, why can a QR code with missing chunks of its black-and-white pattern still restore its information so effortlessly?
According to specifications published by Denso Wave and Keyence, QR codes have four levels of error correction, and at the highest level, "H," the original information can be recovered even if up to 30% of the code's data is lost. QR codes are fundamentally designed on the premise that "parts of them will get damaged," with a mechanism built in from the start to mathematically compensate for that damage.
Why information doesn't disappear even when 30% of the code data is missing
The error-correction capability of QR codes is defined across four levels in Denso Wave's official specifications. The recoverable proportion, measured against codewords (units into which data is divided), is 7% for Level L, 15% for Level M, 25% for Level Q, and 30% for the strongest, Level H. In other words, a QR code created at Level H can theoretically recover its original data even if the equivalent of 30% of its code data becomes unreadable due to dirt or tearing.
However, this is a theoretical upper limit. Whether recovery is actually possible depends not just on how much is damaged, but on where the damage occurs. A QR code begins reading by first locating the position-detection patterns (finder patterns) at three of its corners, and according to Keyence's explanation, if this particular area gets dirty, the code itself may become undetectable even if the damage falls within the theoretical correction range.
With a paper document or photograph, losing 30% of it naturally means losing that 30% of the information. Conventional one-dimensional barcodes (the striped codes used at supermarket checkouts) also often become unreadable once a significant portion of their lines is missing. QR codes are different. When data is recorded, "extra information" is added in advance, so that even if part of the code later becomes unreadable, the missing portion can be calculated backward using only the information that remains. The technology responsible for generating this extra information is an error-correction method called Reed-Solomon coding.
The same math used in music CDs restores damaged codes

Reed-Solomon coding was not developed specifically for QR codes. The same method is used in reading music CDs. The reason a CD can keep playing without skipping even when its surface has fine scratches is that this coding scheme is particularly good at correcting clustered errors that occur byte by byte (burst errors).
To explain the mechanism simply: the original data is treated as a mathematical expression called a polynomial, arranged byte by byte, and this is divided by another predetermined expression (the generator polynomial). QR codes perform this division using a special set of calculation rules that handles only 256 possible values. The remainder produced by that division is appended to the end of the original data as a dedicated error-correction codeword. On the reading side, the entire code is divided again by the same generator polynomial; if the remainder doesn't come out cleanly to zero, the system determines that "an error exists somewhere," then works backward to identify the location of the error and its correct value, subtracting out the discrepancy. The smartphone doing the reading simply performs this calculation in an instant to fill in the missing portion.
The burden of correction actually differs depending on whether paper has torn away along with the pattern printed on it, or whether dirt has caused black and white to be misread as flipped. In the former case, because the location of the missing portion is already known, fewer codewords are needed to fix it; in the latter, since the location itself must first be identified through calculation, correcting even a single error typically consumes twice as many codewords. QR codes are designed to handle both types of damage through calculation, but as mentioned above, if a part that serves as the starting point for reading—such as the finder pattern used for position detection—is damaged, the calculation never even begins.
The four levels are a tug-of-war between capacity and toughness

One might assume that higher correction capability is simply better, but in practice, not every QR code is created at Level H. The more codewords devoted to error correction, the less capacity remains to record the original data. Arranged from highest to lowest correction level—H, Q, M, L—the number of characters that can be stored decreases in that same order.
According to Keyence's specifications, the largest QR code size (Version 40, Level L) can hold 7,089 numeric characters. But if the same grid size is switched to Level H, the error-correction codewords take up a larger share of the space, significantly reducing the number of characters that can be recorded. Error correction is not free insurance—it is toughness purchased at the cost of data capacity.
This trade-off is precisely why different levels get chosen for different purposes. According to Denso Wave's explanation of its specifications, Level L may be chosen in environments where contamination is unlikely to be a concern, while Level Q or H may be chosen in settings where dirt and wear are unavoidable, such as factory production lines or outdoor signage. QR codes designed with a logo embedded in the center follow the same logic: because part of the code is deliberately obscured, a higher correction level is sometimes chosen to compensate for the hidden portion. That said, Denso Wave itself does not recommend overlaying illustrations or deforming the code, noting that even a small amount of additional dirt or missing area on top of that modification can render the code unreadable. Raising the correction level does not guarantee readability, depending on how much area is concealed.
A design built on the assumption of damage—born on a Japanese factory floor
The QR code was developed in 1994, led primarily by Masahiro Hara, who was then employed at Denso. The starting point for the development was a request from the factory floor to speed up barcode scanning for parts. A team of just two people, including Hara, spent about a year and a half creating a code that could hold more information than conventional barcodes while being read faster and more accurately—resulting in the QR code now used worldwide.
The image-processing expertise accumulated through the development of barcode scanners and OCR (optical character recognition) supported this effort. Because codes on factory production lines are exposed to daily dirt and wear, higher correction levels are often chosen in those settings.
The next time you spot a grimy QR code on a receipt or a storefront poster, remember why it can still be read. What lies behind it is a triumph of mathematically grounded design—one that anticipates damage and builds in redundant data from the start. The same mathematics is etched into the surface of music CDs as well, and much of the scanning technology around us is built on the premise that things will break. Even a single black-and-white pattern carries that design philosophy within it.
