Education9 min read

QR Code Error Correction Explained — How QR Codes Survive Damage

Deep dive into QR code error correction technology. Learn how Reed-Solomon encoding works, which level to choose, and why damaged QR codes still scan.

QR Code Error Correction Explained — How QR Codes Survive Damage

One of the most remarkable features of QR codes is their ability to function even when they are partially damaged, dirty, or obscured. You may have seen QR codes that are scratched, stained, or partially covered by a sticker — and they still scan perfectly. This is not luck. It is the result of a sophisticated mathematical system called error correction, built into every QR code.

This guide explains how QR code error correction works, what the different levels mean, and how to choose the right level for your use case.

What is Error Correction?

Error correction in QR codes is a system that adds redundant data to the code's content. This redundancy allows the scanning device to reconstruct the original data even if some of the QR code's modules (the individual black and white squares) are unreadable.

Think of it like this: if you wrote a message and then copied every third word below it, a reader could still understand the message even if some words in the original line were smudged — they could fill in the gaps from the copies. QR code error correction works on a similar principle, but with much more sophisticated mathematics.

The Technology Behind It: Reed-Solomon Encoding

QR codes use Reed-Solomon error correction, the same technology used in CDs, DVDs, Blu-ray discs, satellite communications, and deep-space data transmission. It was invented by Irving Reed and Gustave Solomon at MIT Lincoln Laboratory in 1960 and has become one of the most widely deployed error correction algorithms in the world.

Here is a simplified explanation of how it works:

  • Data encoding: Your content (a URL, text, etc.) is converted into a series of numbers called codewords
  • Error correction codewords: The Reed-Solomon algorithm generates additional codewords from the original data. These new codewords are mathematically derived so that they can reconstruct missing or corrupted original codewords
  • Combined encoding: Both the original data codewords and the error correction codewords are encoded into the QR code pattern
  • Scanning: When the QR code is scanned, the device reads all available codewords and uses the error correction codewords to verify and, if necessary, reconstruct any corrupted data codewords

The mathematical beauty of Reed-Solomon is that it can correct up to a specific number of errors regardless of where they occur in the data. It does not matter if the damage is in the center, corner, or scattered across the code — as long as the total damage does not exceed the correction capacity.

The Four Error Correction Levels

QR codes offer four levels of error correction, each trading code size for damage resilience:

Level L — Low (7% Recovery)

At Level L, approximately 7% of the QR code's data can be damaged or unreadable and still be decoded successfully.

Characteristics:

  • Produces the smallest, simplest QR code pattern
  • Minimum redundancy — least reliable in adverse conditions
  • Maximum data capacity for a given QR code version

Best for:

  • Controlled, digital-only environments (screens, digital displays)
  • Situations where QR code size is extremely constrained
  • Content that is short and does not need the code to be very dense

Not recommended for:

  • Any printed application
  • Outdoor use
  • Codes that will be physically handled

Level M — Medium (15% Recovery)

Level M can recover from approximately 15% data loss. This is a balanced option that provides moderate protection without significantly increasing code size.

Characteristics:

  • Moderate increase in QR code complexity compared to Level L
  • Good balance between size and reliability
  • Widely used as a default in many QR code generators

Best for:

  • Indoor digital signage (TV screens, monitors)
  • Short-term print materials (event handouts, temporary posters)
  • Codes that will be in good condition during their useful life

Level Q — Quartile (25% Recovery)

Level Q handles approximately 25% data loss. This provides strong protection suitable for most real-world conditions.

Characteristics:

  • Noticeably more complex pattern than Level M
  • Strong protection against environmental damage
  • Good for most printed applications

Best for:

  • General-purpose printed QR codes
  • Marketing materials (flyers, brochures, direct mail)
  • Product packaging
  • Codes that may experience moderate wear

Level H — High (30% Recovery)

Level H provides the maximum protection, recovering from approximately 30% data loss. This is the level QR Builder uses by default.

Characteristics:

  • Largest, most complex QR code pattern for a given amount of data
  • Maximum reliability in real-world conditions
  • Can tolerate significant damage, dirt, or obstruction

Best for:

  • Outdoor signage exposed to weather
  • Product labels that will be handled, shipped, and stored
  • QR codes with custom designs or logos covering part of the code
  • Long-term installations (permanent signs, asset labels)
  • Any situation where reliability is critical

How Error Correction Affects QR Code Size

Higher error correction levels require more redundant data, which means more modules in the QR code pattern. Here is a practical comparison for the same content:

Error CorrectionModules per SideRelative Size
Level L (7%)21 (Version 1)Smallest
Level M (15%)25 (Version 2)~19% larger
Level Q (25%)29 (Version 3)~38% larger
Level H (30%)33 (Version 4)~57% larger

These numbers are for a short URL. For longer content, all levels will require larger QR codes, but the relative difference between levels remains similar.

Why QR Builder Uses Level H by Default

We chose Level H as the default for a simple reason: in the real world, QR codes get damaged. They get rained on, scratched, partially covered, printed at lower quality than expected, scanned at awkward angles, and viewed under bad lighting.

The size difference between Level H and Level L is modest when you look at the actual print sizes involved. A Level H code for a typical URL might be 33x33 modules compared to 21x21 for Level L. At a physical size of 3 cm, the individual modules in the Level H code are still clearly readable by any modern smartphone camera.

The trade-off is straightforward: a slightly more complex visual pattern in exchange for dramatically better reliability. For the vast majority of use cases, this is the right default.

Practical Implications

Custom Designs and Logos

If you plan to place a logo or graphic in the center of your QR code (a common branding technique), you need high error correction. The logo is effectively "damaging" the code by covering modules. Level H can tolerate a logo covering up to approximately 30% of the code area — in practice, a centered logo covering about 10-15% works reliably.

Extreme Environments

QR codes on construction sites, outdoor equipment, industrial settings, or marine environments face serious abuse. Level H is essential, but even Level H has limits. For extreme environments, consider:

  • Printing on durable materials (metal plates, ceramic tiles, weatherproof synthetic paper)
  • Applying protective lamination
  • Using high-contrast colors (black on white) for maximum readability
  • Making the code larger than the minimum required size

Digital Displays

QR codes displayed on screens face different challenges than printed codes — screen resolution, brightness, viewing angle, and refresh rate. Level M is generally sufficient for digital display since there is no physical damage, but Level H does not hurt and provides a safety margin.

Archival and Long-Term Use

If a QR code needs to remain scannable for years or decades (museum exhibits, commemorative plaques, time capsules), use Level H and print on archival-quality, UV-resistant materials. The QR code standard itself is stable and has been unchanged since 2000 — any scanner today reads the same format that was defined over 25 years ago.

Testing Error Correction

You can verify error correction in action with a simple experiment:

  • Print a QR code at Level H
  • Scan it to verify it works
  • Cover approximately 10% of the code with your finger — it should still scan
  • Cover approximately 20% — it should still scan
  • Cover approximately 30% — it may still scan, depending on which modules are covered
  • Cover more than 30% — it will likely fail

This demonstrates the remarkable resilience that error correction provides. It is one of the reasons QR codes have become the universal standard for bridging physical and digital information.

Choosing the Right Level: A Decision Framework

  • Will the QR code be printed? If yes, use Level Q or H
  • Will it be outdoors or in a high-wear environment? Use Level H
  • Will it have a logo or custom design? Use Level H
  • Is it digital-only and temporary? Level M is acceptable
  • When in doubt? Use Level H — the slight size increase is almost always worth the reliability gain
#error correction#technology#education#reliability

Ready to Create Your QR Code?

Start generating free, customizable QR codes in seconds. No sign-up required.

Create QR Code Free

Related Articles