Skip to content
ScanHatch

Technical Guides

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

By ScanHatch · Published · 4 min read

Every QR code carries extra data that lets a scanner repair damage: a scratch, a smudge, a bit of glare or a logo in the middle. How much extra is set by the error-correction level. Choosing it is a trade-off between robustness and size.

The four levels

QR code error-correction levels
LevelCan restore roughlyTypical use
L (Low)7% of the dataClean environments, screens, maximum data in a small code
M (Medium)15%The usual default for print
Q (Quartile)25%Industrial labels, outdoor use, rough surfaces
H (High)30%Codes with logos, or that may get damaged

The percentages refer to codewords, the 8-bit chunks the data is split into, not to a fraction of the printed area. That distinction matters and is covered below.

How error correction works

QR codes use Reed-Solomon codes, the same family used on CDs, DVDs and in deep-space communication. The encoder treats the data as a set of numbers and calculates extra error-correction codewords from them. Given enough of the combined codewords, the decoder can work out which ones are wrong and what they should have been.

Larger codes split their data into several blocks, each with its own error-correction codewords, and interleave the blocks across the symbol. A scratch across one area then damages a little of many blocks rather than all of one, so each block can repair its share.

The cost: bigger codes

Error-correction codewords take up space, so a higher level means fewer modules are left for data, and the generator may need a larger version to fit the same content.

The same content at different levels (generated with the ScanHatch engine)
ContentLMQH
https://example.com/menu (24 characters)25 × 2525 × 2529 × 2929 × 29
A 113-character link with tracking parameters41 × 4145 × 4553 × 5357 × 57

For short content the difference is small. For long content, H can make the code much denser. At the same printed size that means smaller modules and a harder scan, which can undo the benefit.

Why “30%” doesn't mean you can cover 30% of the code

  • The finder patterns, timing patterns and format information aren't protected by the data's error correction. Cover a finder pattern and the code usually won't be found at all.
  • Reed-Solomon can repair twice as many known-missing codewords as unknown errors. A clean blank area is easier to recover from than random smudges that make modules read wrongly.
  • A logo usually damages codewords partially, and several codewords at once, because each codeword's 8 modules are spread across a small region.
  • Real-world scanning also spends error correction on blur, glare and printing defects, and none of that shows in the file.

So treat the percentages as capacity to spend carefully, not a target to fill. In our own tests, a logo 22% of the code's width at level H left about half of the error-correction capacity unused. That's a healthy margin.

Which level should you use?

  • M for most printed codes without a logo. It balances size and robustness.
  • L for codes shown on screens, or when you need to fit a lot of data in a small space.
  • Q for labels that get handled, rubbed or exposed to weather.
  • H whenever there's a logo or artwork over the code. ScanHatch's generator switches to H automatically when you add a logo.

Measuring how much is used

You can't tell by eye how much error correction a logo or damage is using. The QR Validator decodes an image and reports the share of error correction still unused, alongside contrast and quiet-zone checks. If less than about half is left, a smaller logo or a cleaner print is worth considering.

Frequently asked questions

Does higher error correction make a code harder to scan?

It can, indirectly. It makes the code denser, so at the same printed size the modules are smaller. For short content the difference is minor.

Can I change the error-correction level of a printed code?

No. It's fixed when the code is generated. You'd need to create and print a new code.

Which level do phone cameras need?

Any level works. The level affects how much damage a code can survive, not which phones can read it.