QR Code Error Correction Levels: L, M, Q and H Explained
By Urlzee Team · Published · 5 min read
QR codes have four error correction levels, L, M, Q and H, which let a scanner recover roughly 7%, 15%, 25% and 30% of the data if part of the code is damaged or hidden. Higher levels are tougher but produce denser patterns, so M suits most uses and Q or H suits rough conditions.
What is QR code error correction?
Error correction is extra information stored in the code so that a scanner can rebuild missing or misread parts.
When a QR code is generated, your content is converted to a sequence of data bytes called codewords. The generator then calculates additional codewords from that data using Reed–Solomon coding, the same family of mathematics used on CDs and in deep-space communication. Both sets are woven into the pattern.
When a phone scans the code and some modules are unreadable, perhaps under a coffee stain or a torn corner, the decoder uses the extra codewords to work out what the missing ones must have been. If the damage is within the level's limit, the result is exactly the original content. There is no partial read: a QR code either decodes completely or not at all.
What do L, M, Q and H mean?
The four letters are fixed levels defined in the QR code standard. Each says roughly what share of the codewords can be restored.
| Level | Name | Approximate recovery | Typical use |
|---|---|---|---|
| L | Low | 7% | Clean screens, maximum capacity |
| M | Medium | 15% | General-purpose default |
| Q | Quartile | 25% | Print that gets handled |
| H | High | 30% | Harsh environments, codes with a logo overlay |
The percentages are approximate and describe codewords, not surface area. A scratch that crosses many different codewords does more harm than a blot of the same size that lands on a few. And some parts of the pattern are not protected in the same way: the three large corner squares, called finder patterns, are how a scanner locates the code in the first place. Cover one of those and the code will often fail at any level.
Denso Wave, the company that invented the QR code, publishes a short reference on error correction levels if you want the source.
How does error correction affect capacity and size?
Every error correction codeword takes a place that could have held data. So at any given grid size, a higher level holds less content.
Here is how many bytes (roughly, characters of a typical URL) fit at each level for a few sizes:
| Grid | Level L | Level M | Level Q | Level H |
|---|---|---|---|---|
| 21 × 21 (version 1) | 17 | 14 | 11 | 7 |
| 25 × 25 (version 2) | 32 | 26 | 20 | 14 |
| 29 × 29 (version 3) | 53 | 42 | 32 | 24 |
| 33 × 33 (version 4) | 78 | 62 | 46 | 34 |
| 37 × 37 (version 5) | 106 | 84 | 60 | 44 |
Read the table the other way round to see the real effect. A 40-character URL fits a 29 × 29 grid at level M. At level H the same URL needs 37 × 37. Print both at 2 cm and the H version's squares are about a fifth smaller.
That is the trade-off in one line: higher correction protects against damage, but smaller modules are harder for a camera to resolve. Push the level up without making the code bigger and you can make scanning worse, not better.
Which error correction level should you choose?
Start from where the code will live.
- On a screen (website, slide, email, phone display): L or M. Screens don't get scratched, and a simpler pattern reads faster.
- Clean indoor print (flyers, business cards, brochures): M. It handles minor print flaws and the odd crease.
- Print that gets handled or wiped (menus, table stickers, packaging, labels): Q.
- Outdoor, industrial or long-life use (signs exposed to weather, equipment tags, anything that will be scuffed): H.
- A logo placed over the middle: H, because the logo destroys the modules beneath it and the code survives only by spending its error budget.
If you are unsure, M is a safe choice. It is the default in Urlzee's QR code generator, where you can switch between all four levels and watch the preview get denser or lighter.
How do you use a high level without making the code harder to scan?
Keep the content short so the grid stays small even with the extra codewords.
A 25-character short link at level H needs a 33 × 33 grid. A 110-character tracked URL at level H needs 57 × 57. The first is easy to scan on a jam jar; the second isn't.
- Shorten the destination with the URL shortener. A custom alias keeps it readable too.
- Paste the short link into the generator.
- Select Quartile or High.
- Print at a size that suits the scanning distance. The QR code size guide explains how to check the module width.
- Scan a printed proof.
Does error correction let you put a logo on a QR code?
Yes, that is how logo codes work, but it is a workaround rather than a feature of the standard. The logo simply blocks part of the pattern, and the decoder treats that area as damage.
Two cautions follow. First, a logo uses up tolerance that would otherwise protect against real wear, so a logo code at level H has less margin left than a plain code at level H. Second, the logo must stay well under the recovery limit and away from the corner finder patterns.
Urlzee's generator does not embed logos. It lets you set the code colour, background colour, error correction level and size. If you add a logo yourself in a design tool, generate the code at level H, keep the logo small and central, and test the final artwork on several phones. For more on what is safe to change, see QR code design best practices.
What error correction cannot fix
Error correction repairs missing data inside an otherwise readable code. It does nothing for problems that stop the scanner finding or resolving the code.
- Low contrast between code and background.
- Inverted colours in scanners that expect dark on light.
- A missing quiet zone, the blank margin around the pattern.
- Blur from a low-resolution image stretched too far.
- A code that is too small for the distance.
- A broken destination. If the link inside is dead, the code scans perfectly and still leads nowhere.
If a code fails and raising the level doesn't help, the cause is probably on that list. The troubleshooting steps in why a QR code is not scanning go through each one.
Frequently asked questions
- What are the four QR code error correction levels?
- Level L recovers about 7% of the data, M about 15%, Q about 25% and H about 30%. Higher levels survive more damage but need more modules to hold the same content.
- Which error correction level is best for a QR code?
- Level M is a good default for clean print and screens. Use Q or H when the code may be scratched, dirty, partly covered or printed on a rough surface.
- Does higher error correction make a QR code scan better?
- Not always. It helps a damaged code, but it also makes the pattern denser, which makes an undamaged code harder to read when it is small or far away.
- Can I change the error correction level of an existing QR code?
- No. The level is built into the pattern when the code is generated. To change it, generate a new code with the same content and a different setting.