DEV Community

Rahman
Rahman

Posted on

How a QR code fixes its own errors (and why your logo doesn't break it)

You've seen QR codes with a logo in the middle, rounded dots, colors, and they still scan. How can a pattern be partly covered and still readable? Two words: error correction. Here's how it works, and what it means when you design a branded code.

Error correction, in plain terms

A QR code doesn't just encode your data. It adds redundancy computed with a Reed-Solomon code. In practice: even if part of the modules (the little squares) is unreadable, the reader can rebuild the missing information from that redundancy.

There are four levels:

  • L (Low): ~7% of the code can be damaged and still read.
  • M (Medium): ~15%.
  • Q (Quartile): ~25%.
  • H (High): ~30%.

The higher the level, the more redundancy, so the more modules, and the denser the pattern.

Why your logo doesn't break the code

When you drop a logo in the center, you cover some modules. As long as the covered area stays under the correction threshold, the reader rebuilds the rest. That's why a small center logo works: you stay well under the ~30% of level H.

Common mistakes:

  • A logo that's too big. Pass the threshold and no reader rebuilds the code.
  • A logo over the corners. The three big squares (the "eyes") are used for detection. Covering them breaks detection before correction even matters.
  • Treating correction as permission to wreck the code. Error correction compensates for wear and small masking, not a sloppy design.

In practice

  • If you add a logo, switch to level H and keep the logo around the center fifth.
  • Leave the eyes and the quiet zone alone.
  • Always test on a real phone at the actual print size.

A note on tools

Full disclosure: I help build a generator called QRolling. It handles logos, colors, and the correction level with a live preview, so you can see right away whether a design still scans. It's a paid app with a free week to try.

Error correction is what makes branded QR codes possible. Understand the limit, stay under it, and you can dress up a code without ever making it unreadable.

Top comments (0)