BrowserTools
webdev

How to Choose QR Code Error Correction Level (L, M, Q, H)

L gives capacity, H gives resilience. Learn which level survives logos, dirt, and low light without making the code unruly.

By Guga — BrowserTools maintainer, Tbilisi, Georgia·Last updated 2026-09-21·6 min read·1198 words

Creates QR codes with selectable L/M/Q/H error correction and PNG or SVG export, all in your browser.

generate QR codes with custom error correction →

What error correction does in a QR code

QR codes use Reed-Solomon error correction, the same family of cyclic codes used for CDs and many space payloads. The data is split into blocks, and each block is padded with error-correction codewords computed over its contents. If modules are obscured, the decoder uses the parity codewords to reconstruct the missing bytes up to the level's limit. ISO/IEC 18004, the QR symbology standard, specifies four levels and describes them as allowing recovery of L 7%, M 15%, Q 25% and H 30% of the symbol codewords. The trade is capacity. At version 4 in byte mode the payload ceiling is 78 characters at L, 62 at M, 46 at Q and 34 at H, so moving from M to H costs about 45% of the payload at a fixed version. Function patterns are fixed by the version and do not change with the level. Only the split between data and parity shifts, and that shift is what forces you up a version when the payload is fixed.

Reading the codeword budget

A version 4 symbol holds 100 codewords in total, split between data and parity by level. At L that is 80 data plus 20 parity. At M, 64 plus 36. At Q, 48 plus 52. At H, 36 plus 64. One parity codeword buys roughly two correctable errors per block, which is why the parity share is much larger than the headline recovery percentage. This is the number that matters when sizing a logo overlay: at H, two thirds of a version 4 symbol is parity, and parity is what absorbs damage. Structural elements are a fixed cost on top, sitting outside the data region. When working out how much room content has, subtract the mode indicator and character-count header first. Byte mode spends 4 bits on the mode and 8 on the length, so a 78-character payload needs 628 bits and does not fit the 640 available.

The four levels side by side

Level L, 7% recovery, gives the most payload per module and the smallest code for a given payload. Use it when the print is pristine and the scan happens in controlled light, such as a factory label read at a fixed station. Level M, 15% recovery, is the default in most generators and the right default generally. Level Q, 25% recovery, suits outdoor posters and packaging that will scuff, and is the first level to reach for if you must place a logo. Level H, 30% recovery, is for the worst conditions: embroidery where stitches bridge modules, or engraving where charring is irregular. One caveat catches people out. Because the same payload needs a higher version, an H code at version 25 is 117 by 117 modules while an M code at version 12 is 65 by 65. The H code survives more damage per module but is physically larger, and at normal scan distances a denser symbol is harder for the camera to resolve.

Logo overlays and what actually breaks

A logo replaces modules with a flat colour, destroying whatever the encoder put there: data, parity, and possibly format information. The 30% budget at H is spread across the symbol as erasures the decoder can tolerate in any pattern. A logo is one contiguous block, and it also consumes parity that was going to be spent repairing damage elsewhere, so the real margin is smaller than the headline number. Do the arithmetic in modules, not pixels. A version 3 symbol is 29 by 29 modules, 841 in total. A logo covering 5 by 5 modules is 25 modules, about 3% of the symbol, comfortably inside the H budget. A logo 10 by 10 modules is 100 modules, about 12%, and exceeds what Q is budgeted to repair in one piece. What works: a centred logo on a solid light tile, a shape clear of the corner finders, a high-contrast mark. What fails: covering a finder pattern, low contrast, and a stretched logo that distorts the grid.

Capacity planning with real numbers

Take a concrete payload. The URL https://browsertools.online/tools/qr-code-generator/ is 52 characters, so it is byte mode. At L it fits version 3, a 29 by 29 symbol. At M it needs version 4, 33 by 33. At Q, version 5, 37 by 37. At H, version 6, 41 by 41. Jumping from L to H costs 12 modules on each side, a 41% increase in linear dimension and about 100% in area, to buy 23 percentage points of recovery. Add campaign parameters and the picture worsens. Seventy-eight characters needs version 5 at M and version 8 at H, from 37 by 37 to 49 by 49. A vCard of about 220 characters needs version 11 at M, 61 by 61, and version 15 at H, 77 by 77. Printed small, 77 modules across falls below what offset lithography can hold. The lever is almost always the payload, not the level.

Testing before you print

Four checks catch almost everything. First, decode it back: drag the exported image into a reader and confirm the payload round-trips. Second, print a one-to-one proof on the actual stock and scan that, not the screen preview. Third, scan at the intended distance under the intended lighting, on more than one device, since failure thresholds differ between camera stacks. Fourth, simulate the damage you expect. Cover roughly ten percent of the symbol with an opaque sticker and try again; an H code should still decode and a code at M may not. On this site the generator computes the symbol locally with the qrcode library and offers PNG and SVG export with error correction as a control, and the reader decodes uploaded images with jsQR in the browser.

Frequently Asked Questions

Which error correction should I use for a logo QR?
Use Q (25%) or H (30%) if the logo covers a small fraction of the symbol. The recovery figure is a budget spread across the whole code, not a licence to cover that share of area with one solid block. Keep the four-module quiet zone clear and the three finder patterns untouched, then test on several devices.
Does higher error correction make the QR larger?
Indirectly. Higher correction reserves more codewords for parity, so the same payload needs a larger version and more modules. A 40-character URL fits version 3 at L, version 3 at M, version 4 at Q, and version 5 at H.
What damage can each level recover from?
ISO/IEC 18004 lists recovery of L 7%, M 15%, Q 25%, H 30% of the symbol codewords. Smudges, partial obstruction, or glare that corrupt that proportion of codewords can still decode. The figures describe erasures spread through the symbol, not one contiguous block.
Should I ever use L?
Yes for clean, controlled scans: inventory labels printed sharp and read in good light at close range. L maximises data capacity, up to 4,296 alphanumeric characters at version 40. For posters, packaging, and anything handled in the wild, use M or higher.