QR Code Error Correction Levels: How L, M, Q, and H Change Your Code

Every QR code generator asks one question before you download, and most people click through it. The error correction level decides how much of the printed code can be damaged before a scanner gives up. Our QR code generator ships four buttons for it, and picking the wrong one either wastes print space or gets your code torn by weather.

What each error correction level promises

The tool shows the four levels with their recovery rates right under the buttons. L recovers 7 percent of the code, M recovers 15 percent, Q recovers 25 percent, and H recovers 30 percent.

Those percentages describe codewords, the redundant blocks the QR standard interleaves through the symbol. Recovery works on damage anywhere in the code, which is why a logo stamped over the middle still scans at level H.

The cost is density. Higher levels allocate more codewords to redundancy, so the same text produces a grid with more modules at H than at L. A denser grid needs a larger print size to scan from the same distance.

The default is M, and the choice persists in your browser storage under the key qr-err-level. Change it once and every future visit keeps your level until you change it again.

Level selection rules

Apply these four condition rules instead of guessing.

1. The code lives on a screen only, in a slide, an app, or a web page. Choose L. Screens do not tear or smudge, so the smallest grid wins.

2. The code is printed on paper that people handle briefly, a flyer, a business card, a menu insert. Keep M. Fifteen percent absorption covers fingerprints and small creases at a modest size cost.

3. The code goes on packaging, outdoor signage, or anything scratched, folded, or cleaned. Choose Q. Twenty five percent recovery survives the abuse that paper accumulates.

4. You plan to overlay a logo or you print in a harsh environment. Choose H. Thirty percent recovery gives you room to cover part of the grid with a mark and still scan.

If two rules match your case, take the higher level. Size grows, reliability grows with it.

What the generator does with your choice

The tool renders through the qrcode library, version 1.5.4 in this repository, writing straight to a canvas element. Three render settings surround your level choice.

The size slider runs from 128 to 512 pixels in steps of 32 and defaults to 256. The PNG you download comes from the canvas at exactly that pixel size, named webrecast-qr.png.

The quiet zone, the white border around the modules, is set to 2 modules. The library default is 4. Two modules is tighter than the standard recommends, which keeps the code compact on screen. If you print small, verify the border looks generous in the final artwork.

Colors default to black on white and persist between visits alongside the level. The dark color stays configurable, which matters because contrast between dark and light modules is what scanners read.

Two failure modes built into the tool

The first involves the color text boxes next to the pickers. You can type any 7 characters into them, but only a valid HEX value renders. An invalid string makes the library throw, and the tool catches that error silently, so the canvas keeps showing your last successful code. The settings panel says one thing and the image shows another. Fix it by reselecting a color from the picker and confirming the canvas redraws.

The second involves the clear button next to Download. Pressing it empties the content box, but the last rendered image and its download link stay alive until you type new content. You can download a code whose text is no longer visible anywhere on the page. Always read the content box, not the canvas, before you trust a download.

Both modes share one defense. Change one setting, confirm the canvas visibly redraws, then scan the downloaded PNG with a second phone before sending anything to print.

Checklist before you print

  • [ ] The level matches the survival rule for the surface, L for screens, M for paper, Q for abuse, H for logos.
  • [ ] The color fields contain valid HEX strings and the canvas redrew after your last change.
  • [ ] The quiet zone survives your layout, since the tool renders 2 modules rather than the library default 4.
  • [ ] You scanned the downloaded PNG with at least two different phones.
  • [ ] The content box shows exactly what you want encoded, not what an earlier render left behind.

Level M covers most work, and the persistence means you set it once. Open the [QR code generator](/en/qr-code), encode the same URL at all four levels, and compare the module density side by side. If your printed tests fail at a level that should hold, tell us the surface and the scan distance and we will recheck the guidance.