What is QR Code Error Correction? A Complete Guide from Overview to Practical Application

QR codes have become a common sight with the spread of electronic payments. But did you know that a QR code can be read correctly even if a part of it is missing or obscured?

All QR codes come with an error correction feature (L, M, Q, H). This article will delve into the details of this function. We will introduce the technology that accurately restores data even when a QR code is damaged, covering error correction levels, the Reed-Solomon code mechanism, and real-world use cases.

Cover Photo

Overview of QR Code Error Correction

What is the Error Correction Function?

The QR code is a 2D barcode widely used in modern society, and one of its key features is "error correction." QR codes are designed to be read accurately even if a part of the image is smudged or damaged. This error correction function makes the QR code a highly reliable tool for information transfer.

The Importance of Error Correction in QR Codes

QR codes are used in various locations and on diverse media, such as outdoor signs, product packaging, and advertisements. In these environments, they are exposed to risks like light reflection, weather-related degradation, scuffs, dirt, and damage. The error correction function restores data even if a part of the code is missing, ensuring an accurate reading.

How Does It Help in Daily Life?

Many people who use QR codes regularly may not have noticed the benefits of the error correction function. In fact, you are likely benefiting from it in the following situations without realizing it:

1. QR Codes with Icons or Logos When platforms like Whatsapp or Instagram issue a QR code, they generate one with an icon in the center. Without error correction, it would be impossible to overlay a logo on a QR code. While not an officially sanctioned method, QR codes with logos are widely used.

2. Scanning with a Smartphone When you scan a QR code with your smartphone, it's difficult to capture it 100% accurately due to handshake, reflections, and other factors. The error correction function allows the content to be read even if parts of the QR code are obscured.

List of QR Code Error Correction Levels

The QR code's error correction function has four "error correction levels." These levels determine the code's ability to be read accurately despite damage or degradation. It is important to adjust the level according to the use case, as a higher data recovery capability results in a larger code.

Error Correction Level Chart

There are four levels, which are specified when creating a QR code:

Level

Recovery Capability

L

Approx. 7%

M

Approx. 15%

Q

Approx. 25%

H

Approx. 30%

Visual Differences by Error Correction Level

I tried creating QR codes containing the same string of text, changing only the error correction level.

How QR Codes look different depending on  Error Correction Level

If you try scanning them, you can confirm they point to the same URL. If you look closely at the appearance of the QR codes, you'll notice that the dot density changes between Level M and Level Q. This is because increasing the level to Q reduces the available data capacity, necessitating an increase in the version (the number of cells in the QR code).

The Trade-off Between Error Correction Level and Data Capacity

Choosing an error correction level for a QR code isn't just about increasing data recovery capability. Because a lot of redundant data is included for error correction, the higher you set the level, the less actual data you can store. This creates a trade-off:

  • Level L: Maximum data capacity, minimum recovery capability.

  • Level H: Maximum data recovery capability, minimum data capacity.

Therefore, you need to select the appropriate error correction level based on how much damage you expect the code to endure and how much data you need to store. Level H is often chosen when incorporating designs or logos, or for use in harsh environments. Level L is more suitable when the risk of damage is low.

Recommended Error Correction Levels for Different Use Cases

QR codes have four error correction levels: L (Low), M (Medium), Q (Quartile), and H (High). Each level represents a trade-off between the amount of data that can be restored and the data capacity of the code. For those searching for "QR code error correction," here are our recommendations for the best error correction level for your specific use case.

Level L: For Limited Use in Controlled Environments

  • Recovery Capacity: Approximately 7%

  • Recommended Use Cases:

    • QR codes for temporary use, such as personal photos or contact information.

    • Use in controlled environments where the risk of the QR code getting dirty or damaged is extremely low, such as for parts management in a factory.

    • Cases where reissuing the code is easy, such as for electronic tickets or links to limited-time websites.

Level L is the choice when you want to maximize the data capacity of the QR code, but it has the lowest resistance to dirt and damage. Therefore, you should avoid using it in situations where it will be used by the general public or where the quality of the QR code cannot be guaranteed.

Level M: Ideal for General Commercial Use and Marketing

  • Recovery Capacity: Approximately 15%

  • Recommended Use Cases:

    • Promotional materials such as product packaging, posters, and flyers.

    • Contact information and website URLs on business cards.

    • General marketing activities.

Level M offers a good balance between data capacity and error correction capability, making it the most widely used level. For general use, Level M is a safe bet. If you are unsure which level to choose for "QR code error correction," we recommend starting with Level M.

Level Q: For Situations Requiring High Reliability

  • Recovery Capacity: Approximately 25%

  • Recommended Use Cases:

    • QR codes for payments.

    • Posters and information boards displayed in public places for extended periods.

    • QR codes that are difficult to reissue or play a critical role, such as event admission tickets.

Level Q is effective in situations that demand higher reliability than Level M. It increases the probability that the code can be read even if it gets slightly dirty or damaged, making it suitable for ensuring that information is reliably delivered to the user.

Level H: For When Absolute Reliability is Essential

  • Recovery Capacity: Approximately 30%

  • Recommended Use Cases:

    • Patient identification and medication management in medical settings.

    • Factory production lines where a QR code read error could lead to significant losses.

    • Management of construction materials and machinery used in harsh outdoor environments.

Level H has the highest error correction capability and the best chance of restoring data even if a part of the QR code is missing. However, it also has the smallest data capacity. Choose this level for handling extremely important information where read accuracy is the top priority.

Summary

Level

Recovery Capacity (Approx.)

Feature

Recommended Use Cases

L

7%

Maximum data capacity

Personal use, controlled environments

M

15%

Balanced and common

Commercial use, marketing

Q

25%

High reliability

Payments, public displays

H

30%

Highest correction capability

Medical, industrial, or mission-critical uses

By selecting the appropriate "QR code error correction" level for your needs, you can maximize the convenience and reliability of your QR codes.

The Mechanism of QR Codes and Reed-Solomon Codes

At the core of the QR code's error correction function is a mathematical algorithm called the "Reed-Solomon code." This code is a technology that can restore the original correct data even if a part of it is missing or incorrect. The Reed-Solomon code is widely used in many digital technologies, such as CDs, DVDs, and data communication, and it is a crucial element supporting QR codes.

What is the Reed-Solomon Code?

The Reed-Solomon code is an error-correcting code developed in the 1960s by Irving S. Reed and Gustave Solomon. This code is particularly effective at accurately restoring original data even when a part of it is damaged in a continuous block.

In QR codes, the Reed-Solomon code is used to make the data redundant. By storing this redundant data within the QR code, it becomes possible to compensate for missing parts and reconstruct the original data, even if the QR code gets dirty or damaged.

Specifically, the process in a QR code works as follows:

  1. Data Division: The original data to be stored is divided into specific units (symbols). Each symbol corresponds to the black and white modules of the QR code.

  2. Addition of Redundant Data: Applying the Reed-Solomon code generates additional redundant data from the original data.

  3. Data Storage: The original data and the redundant data are stored within the QR code. At this point, the QR code contains not only the original information but also the additional information for error correction, making data recovery possible even if a part is missing.

Constraints and Limitations of QR Code Error Correction

While the QR code's error correction function has many benefits, it also has disadvantages and limitations. This section details those points.

  • Increased Data Capacity Needs: To enable data recovery, the function adds redundant information (redundant bits). Since this data is included in the QR code, a higher error correction level reduces the usable data capacity.

  • Slower Reading Speed: A higher error correction level can complicate the processing required for reading, potentially affecting reading speed, especially when the code is damaged and the algorithm needs to perform data recovery.

  • Limits Based on Damage Rate: The function is effective against a certain amount of damage, but it cannot restore data from any level of damage. If the damage to a QR code is too extensive (e.g., over 30%), even the highest error correction level will fail.

Benefits Outweigh the Demerits

Although we've introduced the disadvantages, the reason QR codes are so widely used is that the benefits outweigh the demerits. The optimal error correction level must be chosen based on the application and situation, as performance is affected by data capacity, code size, reading speed, physical environment, and print quality.

An Experiment Using QR Code Error Correction

Let's conduct our own experiment to see how the error correction function actually works. For this experiment, we'll use the QR code below, set to error correction Level Q.

Example QR Code

The following devices were used for scanning:

  • iPhone XR's standard camera

  • Google Pixel 7a's Google Lens

  • Google Pixel 7a's standard camera

  • Android's Quick Settings > "QR code scanner" on Google Pixel 7a

Experiment 1: Changing the Damage Rate

We created QR codes with damage rates of 15%, 20%, 25%, and 30% and conducted a reading test. Since error correction Level Q corresponds to approximately 25% damage, we predicted that only the 30% version would be unreadable.

Experiment 1 QR Codes

Experiment 1 Results As it turned out, we were only able to read the QR codes with up to 20% damage.

Experiment 1 Results

Additionally, the damaged QR codes took noticeably longer to scan. From this result, we can conclude that the tolerance of the error correction level should be considered a guideline.

Experiment 2: Changing the Damage Location

Next, we fixed the damage rate at 15% and changed the location of the damage. The tested locations were:

  1. Overlapping with a Finder Pattern (the large "eyes").

  2. On the left edge of the QR code.

  3. Overlapping with an Alignment Pattern (the smaller "eye").

  4. A horizontally long damaged area.

We predicted that versions 1 and 3, which have damage to functionally significant parts, would not be readable.

Experiment 2 QR Codes

Experiment 2 Results The result was that all versions were readable except for the one overlapping with the finder pattern.

Experiment 2 Results

This experiment shows that the finder patterns are critical for the readability of the code.

Summary: The Error Correction Function that Supports QR Codes

The QR code's error correction function is a technology that restores data and enables accurate reading even if a part of the code is missing. This function can be set to one of four levels (L, M, Q, H); the higher the level, the greater the recovery capability, but the smaller the data capacity becomes.

The logo-embedded QR codes we see in daily life and the smooth scanning experience on smartphones, despite handshake or reflections, are all thanks to this error correction feature.

As our experiment showed, the finder patterns (the three large "eyes") are especially crucial for the code's recognition, highlighting the importance of avoiding these areas when placing a design.

When creating a QR code, selecting the optimal error correction level based on the usage environment and your objective (such as design needs or data volume) will lead to highly reliable operation.

About the Writer

QS

The QR STOCK Editorial Team

The QR STOCK Editorial Team is a dedicated group of researchers, developers, and tech writers. We are passionate about making QR technology accessible to everyone through data-driven articles, in-depth guides, and practical tips.

Related Articles

*QR Code is registered trademark of DENSO WAVE INCORPORATED.
What is QR Code Error Correction? A Complete Guide from Overview to Practical Application | QR STOCK