QR code error correction: L, M, Q and H explained

By · · Updated · 5 min read
QR code error correction levels L, M, Q and H
In short: QR code error correction uses Reed-Solomon codes to rebuild missing data. Level L recovers about 7% of the code, M about 15%, Q about 25% and H about 30%. Higher levels make the code denser. Use M for clean prints and screens, Q for outdoor or rough surfaces, and H when you add a logo.

One of the reasons QR codes are so robust is built into the standard: QR code error correction. It lets a phone read a code that is scratched, partly dirty, slightly torn or covered by a logo. But it is not free: every bit of protection takes space that could have stored data. Choosing the right level is a small decision that has a big effect on how reliably your codes scan.

What is QR code error correction?

Error correction is extra, redundant data added to the code so that missing or misread parts can be reconstructed. QR codes use Reed-Solomon error correction, the same family of algorithms used on CDs, DVDs and in deep-space communication. The QR code standard, ISO/IEC 18004, defines four levels, chosen when the code is generated and stored in the code's format information so that every scanner knows how to decode it.

The four levels: L, M, Q and H

LevelApprox. data recoveryDensityBest for
L (Low)about 7%LowestScreens, very clean prints, maximum data
M (Medium)about 15%ModerateMost printed materials (good default)
Q (Quartile)about 25%HigherOutdoor signs, stickers, textured surfaces
H (High)about 30%HighestCodes with a logo, harsh environments

The percentages describe roughly how much of the code's data codewords can be damaged or missing and still be recovered. They are approximations: where the damage falls matters too.

What does error correction cost?

Redundancy takes room. For the same content, a higher level forces the generator to use a larger version (more modules). At version 40, for example, a code holds 2,953 bytes at level L but only 1,273 bytes at level H. In everyday use, that means:

  • a short URL at level H may need a grid of 29 × 29 or 33 × 33 modules instead of 25 × 25 at level L;
  • printed at the same size, each module is smaller and needs a closer or better camera;
  • to keep the same readability, you must print the code a little bigger.

See QR code data capacity for the full picture of how versions and levels interact.

QR code error correction: a logo is safe at level H
With level H, a modest central logo hides modules the scanner can rebuild.

Which error correction level should you choose?

  1. Start with M. It suits flyers, menus, business cards, packaging and screens, and keeps the code compact.
  2. Move to Q for tough conditions: outdoor posters, window stickers, floor graphics, textured paper, fabric or anything that may get dirty or scratched.
  3. Use H for logos. A logo hides modules in the center; level H gives the margin needed to rebuild them. On the QRCode.boats generator, adding a logo switches the code to H automatically.
  4. Use L only for screens or when you must fit as much data as possible into a small code and the print quality is excellent.

Error correction and logos: the rules

A logo is intentional damage. To keep it safe:

  • Keep the logo in the center and small; it should cover clearly less than the recovery capacity.
  • Never cover the three large position squares in the corners, the smaller alignment pattern or the timing lines between corners.
  • Do not cover the format information next to the corner squares.
  • Prefer a logo with a plain background box so the edge between logo and modules is clean.
  • Always test with two phones; reduce the logo if scanning slows down.

How does the scanner use error correction?

When a phone reads a QR code, it first locates the three corner squares, works out the grid, and reads the format information that tells it the error correction level and the mask pattern used. It then reads every module as a dark or light bit and groups them into codewords. If some codewords are wrong because of a scratch, a stain or a logo, the Reed-Solomon decoder uses the redundant codewords to calculate the correct values. As long as the number of damaged codewords stays within the capacity of the chosen level, the original data comes out intact. Beyond that limit, the scanner simply fails rather than returning wrong data, which is why a damaged QR code either works or does not, with no "almost right" result.

What error correction cannot fix

Error correction recovers missing data, not structural problems. It will not save a code that:

  • is too small for the scanning distance;
  • has insufficient contrast, such as light gray on white;
  • has no quiet zone around it;
  • is blurred, stretched or printed with spreading ink;
  • has damaged corner position markers, which the scanner needs to locate the code.

For those cases, our guide on why a QR code is not scanning lists the fixes.

How to test whether your level is right

  1. Generate the code with the level you chose and download it.
  2. Print a proof at the final size on the final material.
  3. Cover a small part of the code with a finger or a piece of paper (not the corners) and scan again.
  4. Scan from the real distance and in the real light with an older phone.
  5. If it fails, either print bigger, shorten the content, or raise the level one step.

You can also upload the file to the online QR code scanner to confirm that the digital version decodes correctly before printing.

Does error correction matter for barcodes too?

Classic 1D barcodes such as EAN-13 or Code 128 have only a check digit or checksum: they can detect an error but not repair it. That is one reason why 2D codes are preferred on surfaces that get damaged. If you also print product barcodes, the barcode generator calculates check digits automatically.

Practical examples

  • Restaurant table tent, laminated: level M, or Q if the lamination is glossy and tables get wiped constantly.
  • Business card with a vCard: level M to keep the code compact; keep the vCard short.
  • Shop window sticker facing the sun: level Q, UV-resistant print.
  • Event poster with your brand logo in the middle: level H, printed at least 10 cm wide for a 1-2 m distance.
  • Code displayed in a slide presentation: level L or M is enough; make it large on screen.

Key takeaways

  • L, M, Q and H recover roughly 7%, 15%, 25% and 30% of the code.
  • Higher levels mean denser codes that need to be printed larger.
  • M is the best default; Q for outdoors; H for logos.
  • Error correction does not fix small size, low contrast or missing margins.

The QR code inventor, Denso Wave, explains the principle on its error correction page. Ready to create a code with the right level? Start with the URL QR code generator.

Create a QR code with the right error correction level, logo included.

QR code generator with logo and error correctionTest your QR code online

Frequently asked questions

What is the default error correction level for QR codes?

There is no universal default; each generator chooses one. Level M is the most common choice because it balances robustness and compactness. On QRCode.boats you can adjust the level in the advanced options, and the generator switches to level H automatically when you add a logo.

Is a higher error correction level always better?

No. Higher levels make the code denser, so modules are smaller at the same print size and the code can become harder to scan from a distance. Use the lowest level that matches the risks: M for clean prints, Q for outdoor or rough surfaces, H only when a logo or heavy wear requires it.

How much of a QR code can be covered by a logo?

At level H, the code can recover about 30% of its data, but you should stay well below that limit, because damage in some areas matters more than in others. A logo covering a small central area, clearly less than a quarter of the code, is a safe starting point. Always test the final print.

Can a torn or scratched QR code still be scanned?

Often yes, if the damage is limited and the three corner squares are intact. The scanner uses error correction to rebuild the missing parts. Codes generated at level Q or H tolerate more damage. If the corners are damaged or the tear is large, the code will not be readable.

QRCode.boats Editorial Team — QR code & barcode tool makers. Written by the team that builds and maintains the free QR code and barcode generators on QRCode.boats.

Related guides