QR code error correction levels explained: L, M, Q, H
qr-code developer-tools
QR code error correction levels explained: L, M, Q, H
Every QR code carries a hidden setting that decides how much damage it can survive before becoming unscannable: the error correction level. There are four levels — L, M, Q, H — and picking the wrong one is the most common reason a QR code fails in the real world.
This guide covers what each level means, how it affects the QR code's physical size and density, and a decision tree for picking the right one.
Want to generate a QR code with a specific error correction level right now? Use the free QR Code Generator — exports SVG and PNG with adjustable error correction.
What error correction means
A QR code is not just a grid of black and white squares. Roughly 30% of the data inside it is redundant — extra mathematical information that lets the decoder reconstruct the original message even if part of the code is damaged, dirty, or obscured.
The QR specification (ISO/IEC 18004) defines four error correction levels, each with a different recovery percentage:
| Level | Name | Recovery % | Use case |
| L | Low | ~7% | Clean environment, maximum density |
| M | Medium | ~15% | Default for most general use |
| Q | Quartile | ~25% | Industrial, some print damage expected |
| H | High | ~30% | Maximum durability, dirty/damaged environments |
"Recovery %" means: if that fraction of the QR code's modules (the black/white squares) are damaged or unreadable, the code can still be decoded successfully.
How error correction affects the code
Higher error correction means more redundant data, which means:
Example
For a typical URL like https://rumystic.com/en/dev/qr-code (35 characters), the QR code versions at each error correction level are approximately:
| Level | Version | Modules |
| L | 2 | 25 × 25 |
| M | 3 | 29 × 29 |
| Q | 4 | 33 × 33 |
| H | 4 | 33 × 33 |
Going from L to H roughly doubles the module count. If you print the code at the same physical size, the modules at H level are about 30% smaller — which can actually make the code harder to scan, not easier, if the print resolution is low.
The decision tree
Use this flowchart to pick the right level:
The safe default
If you are unsure, use M (15%). It is the level that most QR libraries default to, and it balances density and robustness for the majority of use cases.
Logos and error correction
A common design choice is to place a company logo in the center of the QR code. This looks great but it obscures part of the code — typically 10-20% of the modules.
If you do this, you must use error correction level H (30%). Otherwise, the logo will make the code unscannable.
Some QR code generators let you specify the logo size as a percentage of the QR code. A common rule: keep the logo under 22% of the QR code's width. Larger than that, even H level may not save you.
The RuMystic QR Code Generator lets you pick the error correction level explicitly so you can pair it with a logo safely.
Common mistakes
Mistake 1: Maximum error correction, minimum physical size
Using level H for a tiny QR code on a business card. The H level makes the modules smaller, and at small physical sizes, the camera cannot resolve individual modules. The code becomes unscannable despite the high error correction.
Fix: use level M or L for small physical sizes, and make the QR code as large as the layout allows.
Mistake 2: No quiet zone
The "quiet zone" is the blank margin around the QR code. The spec requires at least 4 modules of blank space on every side. Without it, decoders cannot find the code's boundary and fail to scan — even if the code itself is perfect.
Fix: always include a 4-module quiet zone. Most generators do this by default, but if you are cropping the QR code image, you can accidentally remove it.
Mistake 3: Inverted colors
A white QR code on a black background is technically valid (the spec allows it), but many older decoders fail to read it. Stick to black-on-white for maximum compatibility.
Mistake 4: Non-square pixels
If you scale a QR code non-uniformly (stretch it horizontally or vertically), the modules become rectangles and decoders fail. Always preserve the aspect ratio.
Version and capacity
The QR code "version" ranges from 1 (21×21 modules) to 40 (177×177 modules). Higher versions hold more data but are harder to scan at small sizes.
The maximum data capacity depends on the version, the error correction level, and the data mode (numeric, alphanumeric, byte, kanji):
| Mode | L | M | Q | H |
| Numeric | 2,953 | 2,331 | 1,663 | 1,273 |
| Alphanumeric | 1,817 | 1,444 | 1,022 | 784 |
| Byte | 1,273 | 1,011 | 712 | 545 |
| Kanji | 707 | 557 | 394 | 298 |
For a typical URL (byte mode, 30-50 characters), version 2-4 is enough, regardless of error correction level. You rarely need to worry about capacity for URLs.
Format information and masking
Error correction is applied at two layers:
The mask pattern is applied to the data to break up large runs of black or white that would confuse the decoder. The QR spec defines 8 mask patterns, and the encoder picks the one that produces the most "balanced" code.
You do not need to understand this layer to use QR codes — the encoder handles it automatically. But if you are debugging a QR code that refuses to scan, the format information is a common failure point (often due to physical damage at the code's corner finder patterns).
Testing your QR code
Always test a QR code before printing it at scale:
The RuMystic QR Code Generator lets you adjust error correction live and download SVG (for crisp printing at any size) or PNG (for screen use).
TL;DR
- L (7%) — clean environments, maximum density.
- M (15%) — the safe default for most uses.
- Q (25%) — industrial, some damage expected.
- H (30%) — logos, dirty environments, maximum durability.
- Always include a 4-module quiet zone.
- Test before you print.