keepcalculator

06 Numbers and Powers

How QR Codes Survive Damage: Error Correction

Card No. 06·48765 · Updated · Standard formula, shown below

QR codes can still scan even when part of the code is dirty, torn, or covered, thanks to a built-in error correction system. This guide explains how that system works and shows you how to test it, so you can design QR codes that stay readable in real-world conditions.

What You’ll Need

  • A printed or digital QR code (any size)
  • A smartphone with a QR scanning app (most camera apps work)
  • Something to cover or damage the code (e.g., sticky notes, tape, marker, or scissors)
  • Optional: a QR code generator that lets you set the error correction level

Step-by-Step

  1. Understand the four error correction levels. QR codes use Reed–Solomon error correction, which can restore lost data. The levels are:
    L – recovers up to 7% damage
    M – recovers up to 15% damage (default for most generators)
    Q – recovers up to 25% damage
    H – recovers up to 30% damage
    Higher levels make the QR code denser (more modules), but they survive more damage.
  2. Check the current level of your QR code. If you generated it yourself, the setting is usually in the generator’s options. If you have an existing code, you can often infer the level by scanning it with a reader that shows the level, or by using an online QR decoder.
  3. Test the baseline. Scan your QR code while it’s clean and undamaged. It should work instantly. This confirms the code is valid and your scanner works.
  4. Cover a small part of the code. Place a small sticker or piece of tape over one of the three corner squares (the position markers). Try scanning. If it fails, move the sticker to a less critical area—the position markers are essential for orientation, so covering them usually breaks the code.
  5. Cover a larger area. Now cover a portion of the data area (the rest of the code). Try scanning again. Depending on the error correction level, you may still get a successful scan. For level H, you can cover up to about 30% of the code area and it should still work.
  6. Try physical damage. If you’re using a printed code, try crumpling it slightly, tearing a corner, or scratching a section. Rescan. The code may still scan if the damage is within the recovery capacity.
  7. Experiment with different levels. If you have a generator, create the same QR code at levels L, M, Q, and H. Print them out and damage each one the same way. You’ll see that higher levels scan more reliably, but they also look busier and require a larger print size to scan from the same distance.
  8. Test with a partially covered code. Some real-world damage isn’t random—like a label covering the center. Use a piece of paper to cover the center of the code and scan. The center is often less critical than the corners, so this may still work even at lower levels.
  9. Verify the data is intact. After a successful scan, always confirm the data is correct. Error correction can restore the data, but if the damage exceeds the capacity, the scan will fail or, worse, return incorrect data (though this is rare).

Common Mistakes

  • Covering the position markers. The three large squares in the corners are essential for the scanner to recognize the code. Damage to these areas cannot be fully corrected, even at the highest level. Keep them clean.
  • Assuming all damage is equal. Damage that is concentrated in one area is harder to correct than the same amount of damage spread out. Error correction works best when the damaged modules are scattered.
  • Using too low an error correction level. If you set level L to keep the QR code small, you sacrifice durability. For printed codes that may get dirty or scratched, use at least level Q.
  • Ignoring the quiet zone. The white margin around the QR code is not decorative. If you trim it off or place the code too close to other graphics, the scanner may fail even without any damage.

Tips

  • Choose the highest level that still scans. For most uses, level H is best if the code will be exposed to wear and tear. For codes that are always clean and digital, level L is fine and keeps the code small.
  • Print at a large size. A larger QR code is easier to scan and can tolerate more physical damage because each module is bigger.
  • Test in real conditions. If the code will be on a curved surface, like a bottle, test it on that curve. Distortion can also cause scanning issues.
  • Keep a backup. If your QR code is for a critical link, always have a plain text URL as a fallback, in case the code becomes unreadable.

Troubleshooting

If your QR code fails to scan after damage, try these steps:

  • Clean the code. Dirt, grease, or a reflective surface can interfere. Wipe it gently.
  • Adjust the lighting. Glare or deep shadow can hide modules. Try a different angle or move to a shaded area.
  • Move closer or farther. The scanner needs to see the whole code. If you’re too close, it may not capture the quiet zone.
  • Use a dedicated QR scanner app. Some camera apps are less tolerant of damage. A specialized app may have better error correction algorithms.
  • If the code is still unreadable, the damage exceeds the error correction capacity. You have two options: regenerate the code at a higher error correction level, or repair the physical code (e.g., tape a torn corner).

Frequently Asked Questions

Can a QR code be partially covered and still work?

Yes, as long as the covered area is less than the error correction capacity (up to 30% for level H) and the position markers are not covered. The scanner will use the error correction to reconstruct the missing data.

What happens if the damage is too much?

The scan will fail. The QR code will not decode, and you’ll get an error message from your scanner. There’s no partial read—it either works or it doesn’t.

Does the error correction level affect the size of the QR code?

Yes. Higher error correction levels add more data modules, so the code becomes denser and physically larger for the same content. That’s why level L is used when space is tight.

Can I add error correction to an existing QR code?

No. The error correction level is fixed when the code is generated. You can’t change it later without regenerating the code. If you need more durability, create a new QR code with a higher level.

Why does my QR code fail to scan when it’s not damaged?

Common reasons include: the quiet zone is too small, the code is printed on a reflective surface, the contrast is low (e.g., light colors on white), or the code is distorted (e.g., stretched or on a curved surface).

Is it true that QR codes can be scanned even if 50% is damaged?

No. The maximum error correction level (H) can recover up to 30% of the data. Claims of 50% or higher are incorrect. The 30% figure is the theoretical maximum, and in practice, damage distribution also matters.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →