Vexifa QR Code
Try the Generator →
Technical

QR Code Error Correction Explained: L, M, Q, H Levels

By Dave Rupe

Error correction is the feature that lets a QR code scan even when part of the pattern is damaged, obscured, or covered by a logo. Understanding the four levels (L, M, Q, and H) helps you make the right trade-off between code density and resilience for every use case.

How Error Correction Works: Reed-Solomon in Plain English

QR codes use a mathematical algorithm called Reed-Solomon error correction, the same technique used in CDs, DVDs, and data transmission over noisy channels. The principle is elegant: alongside the actual data encoded in the code, the QR standard adds a calculated set of redundant "check" codewords. These redundant codewords do not carry new information. They are derived from the data itself, and a scanner can use them to reconstruct any missing or corrupted portions of the original data.

Think of it like sending a message with enough redundancy built in that even if part of the message is lost, the recipient can work out what it said. Reed-Solomon can both detect errors and correct them, which is why a QR code with a coffee stain across a corner, a scratch through the middle, or a logo overlaid on the center can still scan successfully.

The more redundancy you add, the more damage the code can survive. The trade-off is that the code becomes larger and more complex, because those extra check codewords have to live somewhere in the pattern.

The Four Error Correction Levels

Level Name Data Recovery Capacity Code Density
L Low Up to 7% of codewords Smallest / simplest
M Medium Up to 15% of codewords Moderately dense
Q Quartile Up to 25% of codewords Dense
H High Up to 30% of codewords Most dense / complex

Level L: Low (7%)

Level L offers the minimum error correction. Up to 7% of the code's codewords can be damaged or missing and the scanner can still recover the data. In exchange, the code is as simple and compact as possible: the pattern has the fewest modules and is easiest to scan at small sizes.

Level L is appropriate when the QR code will be displayed in a clean, controlled environment: on a screen, in a digital document, or in a print context where the code will not be exposed to physical wear, dirt, or logo overlays. A QR code embedded in a PDF sent by email, a code on a digital invoice, or a code displayed on a screen are all good candidates for Level L. The smaller pattern also reduces the chance of the scanner struggling at very small print sizes.

Level M: Medium (15%)

Level M is the most commonly recommended default for general use. It tolerates up to 15% codeword loss, which covers typical real-world damage: minor scratches on a sticker, slight ink imperfections in a printed piece, a small smudge. The increase in code density compared to Level L is modest and rarely causes practical problems at normal print sizes.

If you are generating a QR code and are unsure which level to choose, M is the right answer for most use cases: URL codes on marketing materials, product labels, restaurant menus, event tickets, and similar applications.

Level Q: Quartile (25%)

Level Q offers substantial error correction, recovering up to a quarter of damaged codewords. This level is worth considering for codes that will be exposed to outdoor environments, such as a code on a weathered sign, a sticker on outdoor equipment, or a code printed on packaging that might get wet or abraded during transit. It is also a reasonable choice when you want to overlay a small logo but prefer not to use Level H.

The code is noticeably denser than L or M, so ensure your print size is adequate (20 mm+ for close-range scanning) and test before finalising your design.

Level H: High (30%)

Level H is the maximum. Up to 30% of the code's codewords can be lost and the scanner can still reconstruct the full data. The code at Level H is the most complex and dense, containing the most modules of any level for the same amount of encoded data.

Level H is the correct choice when:

The Logo + Level H Connection

The most visible application of Level H is in branded QR codes: codes with a company logo placed in the center. This is one of the most common requests in QR code design, and it works because of error correction.

When you place a logo over the center of a QR code, you are intentionally obscuring a portion of the pattern. The scanner cannot read those modules, because they are covered. But because the code was generated at Level H, up to 30% of the codewords can be absent and the scanner can still recover the full data from the remaining portions of the pattern.

This is not a trick or a workaround. It is exactly what error correction was designed for. The QR standard anticipated that real-world codes would be damaged or obscured, and built in the redundancy to compensate.

There is, however, an important constraint: the logo must not cover more than approximately 30% of the code area. If the logo is too large, it obscures more data than error correction can recover, and the code fails to scan. A common guideline is to keep the logo within 20-25% of the total code area, leaving a buffer below the 30% theoretical maximum. Always test the finished code with multiple devices before printing.

It is also worth noting that the center of the QR code is generally the safest area for logo placement. The corners of the code contain the three large position-detection patterns (the square-within-square markers) which are critical for the scanner to orient the code. These must never be obscured.

How Error Correction Level Affects Code Size

Here is a concrete example of how the level affects complexity. Take the URL https://vexifa.com/qr-code-generator. Generating this at Level L produces a version 3 code (29×29 modules). Generating the same URL at Level H produces a version 5 code (37×37 modules). The pattern is physically larger and contains more individual squares, which means at the same print size, each individual module is smaller and the code is harder to scan.

This is the fundamental trade-off: more error correction = more resilience = more complex pattern = needs to be printed larger to scan reliably. For most use cases, the difference between L and M is small enough to ignore. The jump from M to H is more significant. If you are using Level H at a small print size, ensure you have tested the code thoroughly before committing to a print run.

Which Level Should You Choose?

Frequently Asked Questions

Does a higher error correction level make the QR code scan slower?

In practice, no. Not on any modern smartphone. The decoding process is fast enough that the difference between Level L and Level H is imperceptible to the user. The more meaningful factor is the size of the printed code relative to scanning distance: a well-sized Level H code scans as quickly as a well-sized Level L code.

Can I add a logo to a QR code generated at Level M?

Technically the code may still scan if the logo is very small, but it is not recommended. Level M can only recover 15% of damaged codewords, and a logo covering even 15-20% of the code area pushes right to the theoretical limit and leaves no margin for additional imperfections in printing or scanning. Always use Level H for logo overlays.

Does the error correction level affect whether the code expires or stops working?

No. Error correction level has no bearing on whether a code works over time. A static QR code at any error correction level remains valid indefinitely. See our article on dynamic vs static QR codes for a full explanation of why codes can appear to "expire."

If I use Level H, do I need to make the code bigger?

For the same encoded data, a Level H code will have more modules than a Level L code, meaning each module is physically smaller at the same printed size. If you are printing at a size that was already marginal for Level L, moving to Level H may require you to increase the print size by 20-30% to maintain the same scan reliability. The safest approach is always to test the specific code at the intended print size.

What happens if I use Level L on a code that gets scratched or damaged?

If the damage is within the 7% recovery capacity, the code will still scan. If the damage exceeds that threshold, the code will fail. For any print asset that might sustain wear (stickers, cards people carry in wallets, outdoor signage), Level M or Q is a safer choice even without a logo.

Create Your QR Code Free

No sign-up. No watermarks. Download in seconds.

Open Generator →

Related Articles