File formats
QR Code Error Correction Explained: What L, M, Q and H Actually Do
The four letters on a QR generator decide whether your code scans in the rain or not. Here is what each one buys you, and how to choose.
Every QR generator asks the same question before it draws anything: how much of this code should survive being damaged? The answer is one of four letters - L, M, Q or H - and it is the single setting that decides whether your code scans in the real world or sits there looking fine and refusing to work.
The letters are not a quality rating. They are an insurance premium.
What the four levels actually mean
A QR code does not store your data once. It stores it, and then it stores extra, carefully arranged copies of that data across the symbol. That redundancy is what lets a scanner reconstruct the original even when part of the code is missing or dirty.
Each level says how much redundancy to carry:
| Level | Recovers up to | What it is for |
|---|---|---|
| L | about 7% | The most data, the least protection. For a code on a clean screen. |
| M | about 15% | The sensible default. Roughly 10% of real-world uses. |
| Q | about 25% | Printed things that get handled - stickers, packaging, menus. |
| H | about 30% | The most robust. Small codes, curved surfaces, logos over the code. |
There is no "best" level - only a trade. Every level of redundancy you carry is data you cannot carry.
How much room each level leaves
The capacity of a QR symbol depends on its version - the square size - and on the error correction level. In plain character counts for a typical link or text payload:
- L - about 2,900 characters
- M - about 2,200 characters
- Q - about 1,600 characters
- H - about 1,200 characters
If you are encoding a long Wi-Fi string, a vCard with a long biography, or a paragraph of text, you may simply not fit at level H. The QR Code Generator shows the character budget for the level you pick and tells you when you have run past it, which saves the frustration of exporting a code that no phone can read.
Choosing a level: start from where the code will live
Work backwards from the surface, not from the letter.
On a screen, in good light, and nobody will touch it - a code in a video, on a slide, in a chat message. L or M is plenty. M if you want a margin for a slightly dirty screen.
On paper, in daylight, read at arm's length - a poster, a leaflet, a receipt. Q is the sweet spot. It survives a thumbprint across part of it and still scans.
On something that gets handled - a business card, a takeaway cup, a product label, a sticker on a laptop lid. Q. And test it at the size it will actually be printed, not on your screen.
On something small, curved or worn - a bottle cap, a keyring, a coin, a tiny sticker, a code that will be scratched by keys in a pocket. H, and make the code physically bigger. A level H code printed at 15 mm is a failure; a level M code printed at 40 mm usually works.
With a logo in the middle - H. The logo hides modules, and the level is what pays for the missing squares. This is the single most common reason a "good looking" code fails.
The failures that have nothing to do with the level
Error correction is not the reason most printed codes fail. These are:
- Not enough contrast. The code must be dark on light. Light grey on white, or a dark photo background, and most scanners give up. Black on white is the only combination you can rely on.
- No quiet zone. Every QR code needs a clear margin of about four modules around it. A code that touches the edge of a label has no quiet zone, and a surprising number of scanners refuse it.
- Too small. The rule of thumb: the code should be at least a tenth of the scanning distance. A phone held 30 cm away needs a code of about 3 cm or more. A poster read from two metres needs 20 cm.
- Glare and angle. A laminated code under a downlight, or a code printed on a shiny bag, can be unreadable at any level.
- Screen brightness and colour. A code displayed on a phone in sunlight competes with the sun. Test the real device, outdoors, at midday.
Testing before you print five hundred of them
Print one, or show it on the real screen, and then test it properly:
- Scan it with at least two different phones. A code that works on your phone and fails on someone else's is the normal case, not the exception.
- Test it at the size it will be printed, from the distance a reader will actually be at.
- Test it in the light it will be used in - outdoors, in a dim restaurant, under a lamp.
- If it will be covered by a logo, a badge or a sticker, test it with the cover in place.
- If it must work for months, test it again after a week outdoors. Sunlight fades ink, and faded ink is damage the error correction has to absorb.
A note on private QR codes
A QR code is just text rendered as a pattern, and the text can be a secret. A Wi-Fi QR code holds the network name and the password in plain sight - anyone who photographs it with a phone gets both. The same goes for a code that opens a document, a discount code or an internal address.
Generating that code on someone else's server means your password went to someone else's server. A browser-side generator has no such step: the QR Code Generator draws the code on a canvas from your own device, so the payload never leaves it.
Where people use these codes
The most common uses are worth a link each, because they have their own traps:
- A WhatsApp link in a QR code - handy for a shop window, but remember the code only opens a chat; the message text is not in it. There is more on QR codes for WhatsApp.
- A UPI payment code - a UPI URI in a QR code, for a stall or a restaurant counter. The format and the working parts are covered in the UPI QR code guide.
The short version
If you are not sure, pick M for anything on a screen, Q for anything printed, and H for anything small, handled, curved or carrying a logo. Then print one, test it with two phones, and only then order the five hundred.