Basics
QR code error correction: how the L, M, Q and H levels work
Error correction is what lets a scratched, smudged or logo-covered QR code still scan. Choosing the right level is a balance between toughness and size.
Updated · 6 min read
QR codes have four error correction levels. Level L can restore about 7% of the data if the code is damaged, M about 15%, Q about 25% and H about 30%. Higher levels make a code more robust but add modules, so the pattern gets denser for the same content. M suits most printed codes, Q suits codes that face rough handling, and H is the right choice when a logo covers part of the code.
How does QR code error correction work?
QR code error correction works by storing extra recovery data alongside your content, so a scanner can rebuild parts that are missing or misread. A QR code stores data as a sequence of 8-bit blocks called codewords. Alongside your data, it stores extra codewords calculated with Reed-Solomon coding, the same family of error correction used on CDs and DVDs. If some codewords are missing or misread, a scanner can work out the original from the ones that remain.
The level decides how many of these extra codewords the code carries. More recovery data means more codewords in total, and more codewords mean more modules in the grid. The level is recorded in the code's format information, next to the corner squares, so a scanner always knows which level it is reading. You only choose a level when you make a code, never when you scan one.
What the percentages mean
Strictly, the percentages describe codewords, not area. In practice it is fair to think of them as the share of the code that can be dirty, scratched or covered and still scan. Two limits are worth knowing:
- The finder patterns are not protected. The three large squares in the corners tell the scanner where the code is and which way up it sits. Cover or damage one and the code can fail at any level.
- Where the damage falls matters. A tear through the format information, or a dense patch of damage, can do more harm than the same amount of small specks spread across the code.
The four levels compared
| Level | Recovers about | Density | Typical use |
|---|---|---|---|
| L (Low) | 7% | Lowest | Screens, large clean prints, very long content |
| M (Medium) | 15% | Moderate | Most printed codes: flyers, menus, business cards |
| Q (Quartile) | 25% | Higher | Outdoor signs, packaging, codes handled often |
| H (High) | 30% | Highest | Codes with a logo, harsh conditions |
M is a common default in QR software, and for good reason. It survives everyday wear without making the code much denser than L.
Does higher error correction make a QR code denser?
Yes. For the same content, a higher level means more modules, so the pattern gets denser. QR codes come in 40 versions, each with a fixed grid, from 21 x 21 modules at version 1 to 177 x 177 at version 40. Raising the error correction level gives more of that grid to recovery data and less to your content, so the same content can need a larger version.
Here is what happens to a typical 50-character web address at each level:
| Level | Version needed | Grid size |
|---|---|---|
| L | 3 | 29 x 29 modules |
| M | 4 | 33 x 33 modules |
| Q | 5 | 37 x 37 modules |
| H | 6 | 41 x 41 modules |
Printed at the same 3 cm width, each module at level H is about 30% smaller than at level L. Smaller modules need sharper printing, a steadier hand and a closer scan. So higher error correction is not free. It buys resilience by spending print size.
The capacity limits show the same pattern at the extreme. The largest code, version 40, holds up to 2,953 bytes at level L but only 1,273 at level H. Real codes are nowhere near those limits, but the ratio holds at every size.
If a code needs to be small, the best fix is shorter content, not a lower level. The print size guide covers minimum sizes and scanning distance.
Which error correction level should you use?
Use M for most print, Q for codes that take a beating, H whenever a logo covers part of the code, and L only for screens or very long content.
Level L
Use L when the code is shown on a screen, printed large somewhere clean, or must hold a lot of data in a fixed space. A code on a slide or a web page rarely gets scratched. L leaves almost no margin for damage, so avoid it for anything handled, outdoors or printed small.
Level M
Use M for most print: flyers, indoor posters, menus, business cards and labels. It copes with light smudges, small printing faults and a little glare.
Level Q
Use Q when the code will take a beating: outdoor signs, shipping labels, product packaging, stickers on equipment, or anything likely to get wet, scuffed or partly covered. Accept a slightly larger print in return.
Level H
Use H when part of the code will be covered on purpose, usually by a logo, or when conditions are harsh and the code can be printed large enough to absorb the extra density.
Logos and why they need level H
A logo in the middle of a QR code hides real modules. The scanner treats them as damage and rebuilds the missing data from the error correction codewords. That is why logos work at all, and why they need the highest level.
A logo also spends the recovery budget before the code has met any real-world wear. If the logo uses most of what level H can restore, there is little left for a scratch, a reflection or a slightly soft print. Follow a few rules:
- Keep the logo to around 20 to 25% of the code's area at most, and smaller where you can.
- Place it in the centre, well away from the three corner squares.
- Give it a light border so its edge does not blur into the modules around it.
- Keep the content short, so the grid stays coarse even at level H.
On the EndureQR generator, uploading a logo switches error correction to H automatically, so a logo can never be paired with a low level by mistake. For more on logos, colour and contrast, read our design best practices guide.
Setting the level in practice
Many generators pick a level for you and never show it. The EndureQR generator has an Advanced panel where you can choose L, M, Q or H yourself when there is no logo. The same panel sets the quiet zone, the blank margin around the code, from 2 to 8 modules. The standard recommends 4, which is the safe choice for print.
- Start with M for a plain printed code.
- Move to Q if the code will live outdoors or be handled often.
- Use H whenever you add a logo. EndureQR does this for you.
- Drop to L only for screens, or when the content is long and the space is fixed.
- If the code becomes too dense at the level you need, shorten the content. A dynamic code holds only a short redirect link, which keeps the grid simple even at H. See static vs dynamic QR codes.