QR Code error correction explained: levels L, M, Q and H
Error correction is extra data added to a QR Code so a scanner can rebuild a code that is dirty, blurred or partly covered. There are four levels (L, M, Q, H); each higher level repairs more damage but makes the code denser. Level M is the usual choice, and higher is not automatically better.
Every QR Code has a setting most people never touch: the error correction level. It decides how much of the code can be damaged before it stops working, and it also decides how big and dense the code is. This article explains what the four levels mean, what the percentages really measure, what they cost, and how to pick one for a job. It also deals with the most common misunderstanding, which is the relationship between error correction and logos.
What error correction is
A QR Code is a grid of dark and light squares called modules. Your text or link is turned into bytes, and the bytes are written into the grid as groups of eight modules called codewords. The generator then calculates additional codewords from your data and writes those into the grid as well. These extra codewords carry no new information. They exist so that, when some modules are read wrongly or cannot be read at all, the original data can be worked out from what remains.
The method is Reed-Solomon error correction, the same family of codes used elsewhere in digital storage and transmission. You do not need the mathematics to use it. The idea is simple: the data is stored with enough redundancy that a limited number of wrong or missing codewords can be detected and repaired. If more codewords are damaged than the redundancy can handle, the scan fails; there is no partial result.
This is why a QR Code with a coffee ring on one corner often still works, and why one with a crease through the middle sometimes does not. What counts is how many codewords were lost, not how bad the damage looks to you.
The four levels
DENSO WAVE, the company that created the QR Code, describes four levels, L, M, Q and H, each able to restore a different share of the code's total codewords. Its page lists M (15%) as the most frequently selected level and Q as a 25% correction rate. The figures usually quoted for the other two are 7% for L and 30% for H; we label those as commonly quoted because the page we checked states the M and Q numbers explicitly.
| Level | Share of codewords it can restore | Typical use |
|---|---|---|
| L (Low) | about 7% (commonly quoted) | Clean screens, short-lived codes, very long data where size matters most |
| M (Medium) | 15% | The everyday default; most printed and on-screen codes |
| Q (Quartile) | 25% | Codes exposed to wear, dirt or rough printing |
| H (High) | about 30% (commonly quoted) | Harsh environments, and codes with a center logo |
The column headed “share of codewords” is worded carefully, because it is the number people most often misread. We come back to that below.
The level is chosen when the code is generated and is stored inside the code itself, so any scanner knows how to decode it. Changing the level changes the pattern of dots, even though the link is the same.
What the percentage does and does not mean
Read plainly, “level Q restores 25%” sounds like “you can destroy a quarter of the picture.” That is not what it says. The figure is a share of codewords, and codewords are scattered through the grid in a way that is not a simple picture of the square.
- Codewords are not a tidy patch. The modules belonging to one codeword, and the codewords belonging to one error-correction block, are spread across the symbol. A single blob of damage hits several of them partly.
- A codeword is lost if even one of its eight modules is read wrongly. Scattered speckle can therefore damage far more codewords than its area suggests.
- A scanner generally has to find damaged codewords on its own. Repairing mistakes at unknown positions needs more redundancy than filling gaps whose positions are known, so the share that can be repaired in practice is lower than the headline figure suggests.
- Some parts of the symbol are not protected by this mechanism at all. The three large corner squares (finder patterns) and the timing lines must be intact enough for the scanner to find and align the code in the first place.
So treat the percentage as a ranking of levels (H tolerates more than Q, Q more than M) rather than as a measurement of how much picture you can cover.
The cost: more data, bigger code
Error correction is not free. The extra codewords take up space in the grid. DENSO WAVE puts it this way: the higher the level, the more data the code holds in error correction rather than in your content, so for the same data a higher level means a larger code. For a fixed code size, a higher level means room for less data.
We measured this with StyloQR's own encoder (QRRender.buildMatrix) on the link https://www.styloqr.com/menu?table=12, 37 characters. The side length is in modules, not counting the blank margin:
| Level | Grid size | Total modules |
|---|---|---|
| L | 29 × 29 | 841 |
| M | 29 × 29 | 841 |
| Q | 33 × 33 | 1,089 |
| H | 37 × 37 | 1,369 |

https://www.styloqr.com/menu?table=12, at each level, drawn with StyloQR's own encoder. L and M need the same grid for this particular link; Q and H need progressively larger grids, and H has about 63% more modules than L or M.Two points from the table. First, L and M happen to land on the same size for this link: codes grow in steps (each size adds four modules per side), and this link fits the same step at both levels. That will not always be true. Second, the jump from M to H is eight modules per side, which is a visible increase in density.
Longer data shows the effect more strongly. A 136-character campaign link (a path plus several tracking parameters) came out at 45, 49, 57 and 61 modules per side at L, M, Q and H. Compared with L, level H needs a grid 16 modules wider. By contrast, a short 24-character link (https://www.styloqr.com/) needed 25 modules at L and M and 29 at Q and H.
Why bigger is a problem when you print
A denser code matters because print size is usually fixed by the layout, not by the code. Imagine the code, including its blank margin of four modules on every side, must fit in a 25 mm square. The margin is part of the requirement; DENSO WAVE specifies four modules on all sides, and our size guide covers it.
- At level M, the 37-character link needs 29 + 8 = 37 modules across, so each module is about 25 / 37 = 0.68 mm.
- At level H, it needs 37 + 8 = 45 modules, so each module is about 25 / 45 = 0.56 mm.
Same data, same space, and the modules are roughly 18% smaller. Smaller modules are harder for a phone camera to resolve, harder for a printer to reproduce cleanly (ink spreads and fills in small gaps), and less forgiving at a distance. So the extra protection of H can be partly or wholly cancelled by the extra density, which is the main reason “always use the highest level” is poor advice.
Why higher is not always better
The levels protect against some kinds of problems and not others. Consider what you actually expect to go wrong.
- Screen display, clean environment: little damage to repair. A higher level adds density and gains almost nothing. M, or even L for very long data, is reasonable.
- Printed material that will be handled, scuffed, or left outdoors: real physical damage is likely. Q or H earns its cost, provided you give the code enough physical size to keep modules from getting too small.
- Blur, low contrast, poor lighting: error correction helps with some of this, but it is a poor substitute for fixing the cause. A sharp, high-contrast, adequately large code at level M often beats a blurry, low-contrast one at level H.
- Very small print: every step up in level makes the modules smaller at a given size. Often the best move is a lower level, or a shorter link, not a higher level.
A useful way to think about it is as a budget. Redundancy is a fixed quantity for a given level. Damage, blur and noise spend it. A logo spends it too, and that is what the next section is about.
Error correction and logos
A center logo works by covering modules and relying on error correction to rebuild whatever was underneath. That is why generators, including StyloQR, switch to level H automatically when a logo is present (and use M otherwise). It gives the logo the largest repair budget available.
The common mistake is reading “H = 30%” as “a logo may cover 30% of the code.” As explained above, the percentage is about codewords, not picture area, and some of the headroom is needed just to cope with the scanner not knowing which codewords are missing. In our own check (a level H code of that same link with a blank center, a sharp image, one OpenCV decoder), a code was still read with about 19% of its area blank, and failed with about 21%. That is a rough illustration on one decoder, not a guarantee, but it shows the usable area is well below 30% even in ideal conditions. We describe the test in how to add a logo to a QR Code.
Also note that DENSO WAVE's error-correction page does not mention logos at all. A logo is a widely used design technique that happens to rely on this feature; it is not something the standard promises. In practice:
- Keep the logo to about a fifth of the code's width (a bit under 5% of its area), as StyloQR does by default.
- Remember that H makes the code denser. A logo code at a small print size has smaller modules than the same code without the logo.
- Test the final design on real phones, not only a decoder on your computer.
If a logo is optional for your project, the lowest-risk design is no logo and level M. If it is required, use the smallest logo that does the job and test generously.
Which level should you choose?
These are practical starting points, not rules from the standard.
- Start with M. It is the most commonly selected level, and it suits most codes on screens, packaging, flyers and posters.
- Move to Q or H when the code will really be abused: stickers on equipment, outdoor signs, labels that get scratched. Make sure the printed size still leaves modules comfortably large, and consider shortening the data to offset the extra density.
- Use H when you add a logo, and treat it as a cost: the code gets denser and the logo uses part of the margin.
- Use L only when data is long and size is the constraint, and the code will be displayed cleanly, for example on a screen at a controlled size. Avoid it for anything printed and handled.
- Shorten the data before raising the level. A shorter link gives a smaller grid at any level. If you can drop tracking parameters or use a shorter path, you gain more than a level change would.
Whichever level you pick, test: how to test a QR Code before printing describes a routine that takes ten minutes.
Choosing the level in StyloQR
In StyloQR the level is set automatically: M by default, and H whenever a center logo is added. We have not documented a manual level selector, so if you specifically need Q or L, check the tool or use another one. That is a real limit for anyone who needs finer control. The practical consequences are that a code without a logo is already at the common, balanced level, and that adding a logo makes the code denser, so keep the link short and allow for more print size. The free web generator runs in the browser and exports PNG or SVG; see PNG vs SVG vs PDF for choosing a file format.
Misconceptions
- “Level H makes a code unbreakable.” It repairs more damage, but at the cost of density, and it does nothing for a blurry, low-contrast or too-small code. Structure that the scanner needs in order to find the code is not covered.
- “30% means I can cover 30% of the code with a logo.” The percentage is a share of codewords. See above: area and codewords are not the same.
- “A higher level gives better scanning.” Only if damage is the problem. A denser code can scan worse at a fixed size.
- “Error correction is encryption or security.” It is not. It repairs accidental errors. Anyone can read a QR Code's content.
- “The level can be changed after printing.” It is part of the printed pattern. A different level is a different code, and a static code cannot be edited once printed (see static vs dynamic QR Codes).
The standard that defines all of this is ISO/IEC 18004, whose current edition is dated 2024. It is a paid document; the figures above come from DENSO WAVE's public pages and from our own measurements.
Conclusion
Pick M unless you have a concrete reason not to, and think of the other levels as trades: more repair capacity for a denser code. If a logo or rough handling pushes you to H or Q, shorten the link and give the code more print size, then test on real phones before anything goes to print.
Frequently asked questions
What is the best error correction level for a QR Code?
For most codes, M. It is the level DENSO WAVE lists as most frequently selected, and it balances repair capacity against code density. Use Q or H for codes that will be scuffed or that carry a logo, and give them more print size.
Does a higher error correction level make a QR Code easier to scan?
Not necessarily. It helps when part of the code is damaged or covered, but it makes the code denser, so at a fixed print size each module becomes smaller. A clean, sharp, high-contrast code at M can scan better than a blurry one at H.
Can I cover 30% of a QR Code with a logo at level H?
No. The 30% commonly quoted for H refers to codewords, not to picture area. In our own clean-image check with one decoder, a level H code of a 37-character link failed with about 21% of its area blank. Keep logos small and test on phones.
How much bigger does a QR Code get at level H?
It depends on the data. For a 37-character link, our encoder produced 29 x 29 modules at L and M, 33 x 33 at Q and 37 x 37 at H. For a 136-character link the sizes were 45, 49, 57 and 61 modules per side.
Is Reed-Solomon the same thing as encryption?
No. Reed-Solomon codes add redundancy so accidental errors can be repaired. They do not hide the content, and anyone with a scanner can read the data in a QR Code.
Can I change the error correction level in StyloQR?
StyloQR uses level M by default and switches to H automatically when a logo is present. If you need Q or L specifically, check whether the tool offers it or use another one.
References
- DENSO WAVE, Error correction feature: four levels (L, M, Q, H); level M (15%) is the most frequently selected and Q is a 25% correction rate; a higher level holds less data and needs a larger code; correction uses Reed-Solomon codes and the rate is a share of total codewords. The page does not mention logos. The 7% (L) and 30% (H) figures are commonly quoted.
- DENSO WAVE, Point for determining the code area: a four-module-wide margin on all sides; symbol size equals version times module size.
- ISO/IEC, ISO/IEC 18004:2024: the international QR Code bar code symbology specification (4th edition, August 2024).
Try StyloQR free
Install the Chrome extension. Single QR Codes are free; Pro is a one-time $9.90 and adds batches, animation, history, and gradients.
Add to Chrome — it's free