QRsvg

QR Code Error Correction Explained: L, M, Q and H Levels

How QR code error correction works, what levels L, M, Q and H recover, what they cost in size, which to pick for logos or print, and what they cannot fix.

8 min readUpdated

What error correction actually does

Every QR code carries more information than the message it stores. Alongside the data codewords (8-bit blocks that hold your URL or text), the code includes error correction codewords calculated from that data. When a scanner reads a code and some modules are wrong, whether because a coffee stain covers them, a logo sits on top of them, or the print is scuffed, it uses those extra codewords to reconstruct what the damaged ones should have been.

The algorithm behind this is Reed-Solomon coding, the same family of maths used on CDs, DVDs and deep-space radio links. You do not need the algebra to use it well, but one mental model helps: imagine writing a number, then also writing down its digit sum and a few other checks. If one digit later becomes unreadable, the checks let you work out what it was. Reed-Solomon does this at a much larger scale, treating each 8-bit codeword as a symbol and building redundant symbols that can pinpoint and repair errors, not just detect them.

Two practical consequences follow. First, error correction is applied to the encoded data region, not to the whole picture. Second, redundancy is not free: the extra codewords need space, so a code with more error correction is denser than one with less, for the same message.

The four levels: L, M, Q and H

The QR standard defines four error correction levels (often abbreviated ECL). Each specifies roughly what share of the codewords can be lost or corrupted while the code still decodes correctly. The percentages are approximate because the exact number depends on the version and how the blocks are split, but they are the figures you should remember.

  • L (Low): recovers about 7% of codewords. The smallest code for a given message.
  • M (Medium): recovers about 15%. The default in most generators, including [qrsvg.app](/), and the level used for the majority of QR codes in the wild.
  • Q (Quartile): recovers about 25%. Noticeably denser; a sensible floor when a logo covers part of the code.
  • H (High): recovers about 30%. The maximum the standard allows, and the densest code for the same content.

The cost: more correction means more modules

QR codes come in 40 versions. Version 1 is 21×21 modules and each step adds 4 modules per side, up to version 40 at 177×177. The version determines the total number of codewords available; the error correction level decides how many of them are spent on redundancy instead of data. Raise the level and you leave less room for your message, so the generator has to move to a bigger version.

A concrete example: a 50-character URL in byte mode fits in version 3 (29×29 modules) at level L. The same URL at level H needs version 5 or 6 (37×37 or 41×41), because at H roughly 30% of the codewords are reserved for correction. Printed at the same physical size, each module of the H code is about a third smaller, which is exactly the kind of detail a phone camera struggles with at a distance. Our size and print guidelines explain how module size translates to minimum print size.

Shorter payloads shrink the problem. If you use a dynamic QR code, the encoded URL is a short redirect like https://qrsvg.app/r/abc123 rather than a 120-character campaign link, and you can afford level H while staying at a small version.

Which level to pick

There is no universally correct answer; pick based on how the code will be displayed and how likely it is to be obscured or damaged. These are the rules of thumb we use.

  • L: on-screen codes (websites, presentations, TV) and large prints of long URLs, where damage is unlikely and keeping the module count low helps distant scanning.
  • M: the default for flyers, posters, business cards and most everyday uses. A good balance of robustness and density.
  • Q: codes with a logo, small prints such as product tags, and anything laminated, curved or likely to catch glare, where part of the code may be washed out from some angles. When you add a logo in [qrsvg.app](/), the generator automatically raises the level to at least Q.
  • H: logos covering more than about 20% of the code, packaging that gets scuffed in transit, outdoor signage, industrial labels and any environment where partial damage is expected rather than exceptional.

What error correction does not fix

Error correction recovers corrupted data modules. It does nothing for the problems that stop a scanner from finding or framing the code in the first place, and those cause far more failed scans than damaged modules do.

  • A missing quiet zone. The blank margin around the code (ideally 4 modules, minimum 2) tells the scanner where the symbol ends. Text or graphics pushed against the edge confuse detection regardless of ECL.
  • Poor contrast. Light grey on white, dark blue on black, or a busy photo behind the modules reduce the signal before decoding even starts. Keep the modules clearly darker than the background; see the logo and colour guide.
  • Blur and low resolution. A JPEG scaled up from 200 pixels has soft module edges; error correction cannot sharpen them. Export as SVG or a large PNG instead.
  • Damaged finder patterns. The three large squares in the corners (the “eyes”) are what the scanner locates first to work out position, rotation and module size. They are not covered by error correction at all. If a logo, fold or scratch hits one of them, the code often will not be recognised as a QR code, no matter how high the ECL.
  • Wrong or unreadable content. If the URL is dead or the Wi-Fi password was typed wrong, the code will decode perfectly and still fail its purpose. Always test the destination.

Mask patterns and automatic version selection

Two more things happen behind the scenes when a QR code is built. After the data and correction codewords are laid out, the generator XORs the grid with one of eight mask patterns. Masking breaks up large areas of the same colour and avoids accidental shapes that look like finder patterns. The generator scores all eight masks against penalty rules from the standard and keeps the best one, then records the choice in the format information strip next to the eyes. This is why the same URL can produce slightly different-looking codes in different tools, and why you should never edit a code pixel by pixel.

Version selection is also automatic. You supply the content and the error correction level; the encoder picks the smallest version whose data capacity fits, taking the encoding mode into account (numeric, alphanumeric, byte or kanji). A generator like [qrsvg.app](/) shows you the resulting module count so you can judge density before you export. If the code looks too busy, the levers are: shorten the content, use a redirect link, or lower the ECL.

Myth: higher error correction is always safer

It is tempting to set every code to H and move on. In practice, a denser code is harder to read at small sizes and at a distance, because each module occupies fewer pixels on the camera sensor. A version 6 code at H printed at 2 cm has modules of roughly 0.5 mm, which many phone cameras cannot resolve in dim light. The same URL at M would be a version 4 code with modules about 25% larger, and it would scan more reliably in that scenario despite recovering less damage.

Think of ECL as insurance against a specific risk, obscured modules, rather than as a general quality dial. Match it to the real threat: logos and rough environments justify Q or H; a clean poster or a website does not. Then spend the module budget you saved on a larger quiet zone and a bigger print size, which improve scan rates far more than the last 15% of redundancy. For the complete workflow from content to export, start with how to create a QR code.

Frequently asked questions

What error correction level should I use for a QR code with a logo?
Use Q for logos up to about 20% of the code width and H above that. qrsvg.app switches to at least Q automatically when you add a logo, and lets you cap the logo at 35% of the width. Keep the logo centred so it never touches the three corner finder patterns, which are not protected by error correction.
Does error correction let me scan a QR code that is 30% torn off?
Only sometimes. Level H can rebuild about 30% of lost codewords, but only if the finder patterns, timing patterns and format information survive. A tear that removes a corner eye usually makes the code undetectable even if less than 30% of the area is missing.
Why did my QR code get bigger when I changed from M to H?
Higher levels reserve more codewords for redundancy, so less capacity is left for your data and the encoder must move to a larger version. A 50-character URL typically goes from version 3 (29×29) at L to version 5 or 6 (37×37 or 41×41) at H.
Can I change the error correction level of an existing QR code?
Not by editing the image. The level is baked into the format information and the codeword layout, so you have to regenerate the code from the original content with the new level. If the content is a dynamic redirect link, the destination stays the same and only the picture changes.
Is level M really enough for printed material?
For flyers, business cards and posters printed with good contrast and a proper quiet zone, yes. M recovers around 15% of codewords, which covers minor smudges and printing artefacts. Move to Q or H when a logo, lamination glare, curved packaging or outdoor exposure is involved.

Free, no signup

Make this QR code now

Clean SVG, PNG or PDF in seconds. Style it, add a logo, download.

Generate a QR code