What Is Error Correction in QR Codes?
The mathematics behind QR code resilience.
QR codes use Reed-Solomon error correction, a powerful mathematical algorithm originally developed for deep-space communication and later adopted by CDs, DVDs, and digital broadcast systems. When a QR code is generated, the encoder takes your raw data — a URL, a block of text, a WiFi credential — and computes a set of extra error correction codewords that are appended to the data stream before the final matrix of black and white modules is drawn.
These redundant codewords act as a safety net. When a scanner reads the QR code, the decoder runs the Reed-Solomon algorithm in reverse. If some modules are unreadable — because of a scratch, a coffee stain, ink bleeding, or even a logo placed over the center — the algorithm can reconstruct the missing data from the redundant codewords. The more redundancy you add, the more damage the code can tolerate, but the trade-off is a larger, denser QR code with more modules.
The QR code specification (ISO/IEC 18004) defines exactly four error correction levels, each offering a different percentage of recoverable data. The level is encoded in the QR code itself, so the scanner knows which recovery algorithm to apply. Choosing the right level is one of the most important decisions when generating a QR code — and it depends entirely on how and where the code will be used.
Interactive Error Correction Comparison
See the same data encoded at all four error correction levels. Enter your own data below to compare.
The Four Levels Explained
Each level serves a different purpose. Here is when and why to use each one.
L — Low (7% Recovery)
Level L adds the least amount of redundancy, producing the smallest and least dense QR code for a given data payload. Use Level L when you need to encode a large amount of data into the most compact code possible and the code will be displayed in a clean, controlled environment — such as a digital screen, a protected label inside packaging, or a high-quality print in an indoor setting where physical damage is unlikely. Level L is not recommended for outdoor use, printed materials that will be handled, or any situation where dirt, moisture, or wear is expected.
M — Medium (15% Recovery)
Level M is the default in QRMint and the right choice for the majority of use cases. It provides a good balance between code density and damage tolerance. A QR code at Level M can lose up to 15% of its modules and still scan correctly — enough to handle minor smudges, light scratches, and the natural wear that comes from being printed on paper. Use Level M for business cards, flyers, brochures, product packaging, and any standard print or digital application where no logo is embedded in the code.
Q — Quartile (25% Recovery)
Level Q offers strong error correction for printed materials that face a higher-than-average risk of damage. This is the practical choice for QR codes on outdoor signage, shipping labels, restaurant menus that get handled frequently, and any surface exposed to moisture, grease, or mechanical abrasion. The resulting code is noticeably denser than Level M, but the additional resilience significantly reduces scan failures in real-world conditions where partial obstruction is common.
H — High (30% Recovery)
Level H provides the maximum error correction available in the QR code specification. It is required when embedding a logo or graphic overlay in the center of the QR code, because the overlay physically covers modules that the scanner can no longer read. Level H compensates for this by encoding enough redundancy to reconstruct up to 30% of the pattern. The trade-off is the largest, densest code for any given payload — which means you may need a physically larger print size to maintain scannability. Always use Level H for branded QR codes.
How to Choose the Right Level
Match the error correction level to your deployment scenario.
Choosing the correct error correction level comes down to answering three questions: Will the QR code have a logo? How much physical damage or obstruction is likely? And how much data do you need to encode?
| Scenario | Recommended Level | Why |
|---|---|---|
| Digital screen, clean environment | L | No physical damage risk; smallest code |
| Business card, flyer, brochure | M | Handles minor wear; good balance |
| Outdoor signage, shipping label | Q | Tolerates moisture, dirt, abrasion |
| QR code with embedded logo | H | Logo covers modules; maximum redundancy |
| Industrial or warehouse label | Q or H | High exposure to damage and chemicals |
| Large data payload, minimal space | L | Keeps module count low for compact print |
When in doubt, Level M is the safest default. It works well in the vast majority of real-world situations without producing an unnecessarily large code. Only step down to Level L when space is genuinely constrained and the environment is pristine, and only step up to Q or H when the deployment conditions or a logo overlay demand it.
Impact on QR Code Size
Higher error correction means more modules, larger codes, and different print requirements.
Error correction codewords take up space inside the QR code matrix. The more redundancy you add, the more total codewords the encoder must fit into the grid, which increases the QR code version (the number of modules per side). For example, a short URL encoded at Level L might produce a Version 2 code (25×25 modules), while the same URL at Level H could require a Version 3 code (29×29 modules) or higher.
This matters because a denser code — one with more, smaller modules — needs a larger physical print size to remain scannable. Each individual module must be large enough for a phone camera to resolve it. If you increase the error correction level without increasing the print size, you risk making the individual modules too small, which defeats the purpose of the extra resilience.
The practical rule is straightforward: if you move from Level M to Level H, increase your minimum print size by roughly 15–20% to compensate for the additional modules. On digital screens, increase the pixel dimensions by the same factor. QRMint supports output up to 2048×2048 px PNG and infinite-resolution SVG, so you always have room to scale up when using higher error correction levels.
Error Correction FAQ
What is QR code error correction?
QR code error correction is a built-in data redundancy mechanism based on the Reed-Solomon algorithm. When a QR code is generated, extra error correction codewords are added to the data. These codewords allow a scanner to reconstruct the original data even if part of the QR code is damaged, dirty, or obscured. The QR specification defines four error correction levels (L, M, Q, H), each recovering a different percentage of the code.
Which error correction level should I use for a QR code with a logo?
Always use Level H (High, ~30% recovery) when embedding a logo or any graphic overlay in your QR code. The logo physically covers modules in the center of the pattern, making them unreadable to the scanner. Level H provides enough redundancy to compensate for this loss. Using a lower level with a logo will likely result in an unscannable code. QRMint automatically suggests Level H when you upload a logo.
Does higher error correction make the QR code bigger?
Yes. Higher error correction levels add more redundant codewords, which increases the total number of modules (the black and white squares) in the QR code. This may push the code to a higher QR version with a larger grid. For the same data, a Level H code will have more modules than a Level L code. This means you may need to print the code at a larger physical size to ensure each module remains large enough for cameras to resolve.
What is the default error correction level in QRMint?
QRMint defaults to Level M (Medium, ~15% recovery). This is the recommended level for the majority of use cases, including business cards, flyers, brochures, and digital screens. Level M provides a solid balance between code compactness and tolerance for minor physical damage like smudges and light scratches. You can change the level to L, Q, or H in the generator settings or via the API’s errorCorrectionLevel parameter.
Can a damaged QR code still be scanned?
Yes, up to the limit defined by the error correction level. A QR code at Level L can tolerate approximately 7% damage, Level M about 15%, Level Q about 25%, and Level H about 30%. “Damage” includes scratches, stains, fading, torn sections, or any obstruction that prevents the scanner from reading individual modules. If the damage exceeds the level’s capacity, the code becomes unscannable. For high-risk environments, choose Level Q or H to maximise resilience.