QR code error correction: L, M, Q and H explained
QR codes have four error correction levels, from L (about 7%) to H (about 30%). What each one means, what it costs in size, and which to use for logos.
The short answer
Error correction is spare information inside a QR code that lets a phone read it even when part of it is damaged or covered. There are four levels: L recovers about 7% of the data, M about 15%, Q about 25% and H about 30%. Higher levels make a code tougher but denser, so pick the lowest level that copes with how the code will be used.
How error correction works
A QR code stores its content as a series of codewords, each eight modules’ worth of data. Error correction adds extra codewords, calculated from the content with a method called Reed–Solomon coding. When a reader finds codewords it can’t read, or reads wrongly, it uses the extra ones to work out what they should have been.
The percentages are approximate and refer to codewords, not to the area of the code. They also have limits. If the damage hits the three corner squares or the format information, the phone may not find the code at all, no matter how much error correction it has.
The four levels
The level is recorded in the code’s format information, so a scanner knows which one it’s reading. You don’t choose anything when you scan, only when you make the code.
- L (low): about 7% recoverable. The smallest code for the content. Fine for clean screens and good prints.
- M (medium): about 15% recoverable. The usual default, and a sensible balance for most print.
- Q (quartile): about 25% recoverable. For codes that get handled, rubbed or exposed to the weather, and for light design changes.
- H (high): about 30% recoverable. For codes with a logo in the middle, and for rough conditions.
The trade-off: more protection, bigger code
Error correction takes up space in the grid. At a given version, a higher level leaves less room for content. To fit the same content at a higher level, the encoder often has to move up a version, which means more modules. At the same printed size, more modules means each one is smaller, and small modules are harder to read from a distance or with an older camera.
The official capacity tables show the cost clearly. The smallest code, version 1, holds 17 bytes at level L, 14 at M, 11 at Q and only 7 at H. The largest, version 40, holds 2,953 bytes at L and 1,273 at H.
Short content gives you room to choose. A dynamic code stores a short link, so it can use a high level and still stay simple. A long web address at level H can produce a dense code that needs to be printed large.
Which level should you use?
A few simple rules cover most cases:
- Codes shown on screens, like a slide or an app: L or M.
- Everyday print, like flyers, business cards and menus: M.
- Table cards, stickers, packaging and anything outdoors: Q.
- Any code with a logo or picture over part of it: H.
- Very long content that makes a dense code: keep the level low, or shorten the content with a dynamic code.
Why logos need a higher level
A logo in the middle of a QR code covers modules that hold real data. The code only scans because error correction rebuilds what’s hidden. At level L, there is very little spare, and even a small logo can break it. At H, there is room for a modest logo plus some ordinary wear.
Keep in mind that the logo uses up the same spare capacity that protects the code from scratches and glare. A code with a logo at the limit of what H can recover has nothing left for a smudge. That’s why it’s wise to keep logos small, centered and well away from the corner squares.
PikaQR’s design studio uses level Q for designed codes and switches to H automatically when you add a logo, so you don’t have to choose.
Test the real print
Error correction makes codes forgiving, but it doesn’t replace a test. Print the code at its real size, on the real material, and scan it with at least two phones in the light where it will be used. If it’s slow to scan, try a lower level with a smaller logo, or a larger print.
Questions
What is the best error correction level for a QR code?
There isn’t one best level. M suits most print, Q suits codes that will be handled or used outdoors, and H is the choice for codes with a logo. Use L only for clean, short-lived displays.
Does error correction affect scanning speed?
Not directly, but a higher level can make the code denser, and dense codes with small modules can take longer to read. A short link keeps codes simple at any level.
Can I change the error correction level of a printed code?
No. The level is part of the pattern. To change it you need to make a new image and print it again. With a dynamic code, the new image keeps the same short link, so old and new prints go to the same place.
How do I find out which level a QR code uses?
Phones don’t usually show it. A QR decoding tool or library can read the format information and tell you the level, along with the version and mask.
Related