guide

QR Code error correction explained: levels L, M, Q and H

Published by Malven Technologies · Updated 2026-11-12

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.

LevelShare of codewords it can restoreTypical 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.

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:

LevelGrid sizeTotal modules
L29 × 29841
M29 × 29841
Q33 × 331,089
H37 × 371,369
The same link encoded at error correction levels L, M, Q and H, shown as four QR Codes of 29, 29, 33 and 37 modules per side
The same link, 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.

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.

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:

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.

  1. Start with M. It is the most commonly selected level, and it suits most codes on screens, packaging, flyers and posters.
  2. 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.
  3. 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.
  4. 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.
  5. 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

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

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