How QR Codes Work: Modules, Error Correction & Scanning

Those black-and-white squares hold far more than a link β€” and they still scan when a third of them is torn off. Inside the finder patterns, timing marks and error correction that make it possible.

πŸ“‚ Web & Internet ⏱ About 8 minutes πŸ“Ά Beginner πŸ› οΈ Pairs with: QR Generator

What you will learn

  • Name the parts of a QR code and say what each one does
  • Pick the right error-correction level for print vs screen
  • Know how much data a QR code can hold β€” and what shrinks it
  • Tell a static code from a dynamic one
  • Avoid the design mistakes that make codes unscannable
In this guide
  1. What a QR code actually is
  2. Anatomy: how a scanner finds and reads the code
  3. Error correction: why a damaged code still scans
  4. How much can a QR code hold?
  5. Static vs dynamic QR codes
  6. Common mistakes
  7. Try it: QR Generator
  8. Frequently asked questions

What a QR code actually is

A QR (Quick Response) code is a two-dimensional barcode: instead of storing data in the widths of vertical bars, it stores data in a grid of black and white squares called modules. It was invented in 1994 by Denso Wave to track car parts, and it spread because a phone camera can read it from any angle, in a fraction of a second, without a special scanner.

Most QR codes you meet simply contain a URL β€” your phone reads the text, recognises it as a link, and offers to open it. But the code itself is just text: it can hold a Wi-Fi password, a contact card, plain words, or a payment instruction. The meaning is whatever the text says.

Anatomy: how a scanner finds and reads the code

A QR code is not a random scatter of squares. Its fixed patterns let a scanner find it, orient it, and read it even at an angle or upside down:

  1. Finder patterns β€” the three big squares

    The large squares in three corners tell the scanner β€œthis is a QR code, and here is where it is”. Their 1:1:3:1:1 black-white ratio is recognisable from any direction, which is why a code scans upside down.

  2. Timing patterns β€” the dotted lines

    Alternating black and white modules between the finders tell the scanner how wide one module is, so it can build the grid even in a blurry or distant photo.

  3. Alignment pattern β€” the small square

    Near the bottom-right (and more of them in larger codes), it corrects for perspective β€” a code photographed at an angle, or printed on a curved cup.

  4. Format information β€” the strips near the finders

    A small block that says which error-correction level and which data mask the code uses. It is duplicated so the scanner can read it even if one copy is damaged.

  5. Data modules β€” everything else

    The payload, mixed with error-correction codewords, scattered across the remaining grid by a mask pattern that avoids large blocks of one colour (which would confuse the timing).

Around all of it sits the quiet zone β€” a border of blank space at least four modules wide. Without it, the scanner cannot tell where the code ends and the background begins.

Error correction: why a damaged code still scans

The most surprising property of QR codes is that they keep working when damaged. This comes from Reed–Solomon error correction: extra codewords are stored alongside the data, and the scanner uses them to reconstruct the missing pieces β€” the same mathematics used on CDs and in deep-space communication.

LevelDamage it survivesBest for
L (Low)~7%Clean prints, maximum data capacity
M (Medium)~15%Everyday use β€” the default choice
Q (Quartile)~25%Outdoor posters, rough handling
H (High)~30%Codes with a logo in the middle, factory floors

The trade-off is capacity: higher correction means more space spent on redundancy and less on your data. And the logo trick works precisely because of this β€” a logo in the centre covers data modules, and level H rebuilds them. Cover more than ~30% and even H gives up.

How much can a QR code hold?

QR codes come in versions 1 to 40 β€” version 1 is 21Γ—21 modules, and each version adds 4 modules per side, up to 177Γ—177 at version 40. Capacity depends on the version, the error-correction level, and the kind of data:

Data typeMax characters (version 40, level L)
Digits only7,089
Letters + digits (alphanumeric)4,296
Bytes (any text, URLs, UTF-8)2,953
Kanji1,817

In practice, keep it short. A long URL makes a dense, fiddly code that needs to be printed large to scan reliably. Shorten the link first β€” and remember every extra character makes the modules smaller.

Static vs dynamic QR codes

A static code contains the destination itself: the URL is baked into the squares, it never changes, and it works forever with no service behind it. A dynamic code contains a short redirect link run by a service β€” you can change where it points, and the service can count scans, but if the service shuts down, every printed code dies with it. For anything printed in bulk (packaging, posters, business cards), the trade-off matters: static is forever, dynamic is flexible.

Common mistakes

  • No quiet zone. Printing the code tight against text or a border is the single most common reason a code won't scan.
  • Too small, or too dense. A version-40 code printed at 2 cm is unreadable. Size scales with data β€” short link, big modules, easy scan.
  • Low contrast or inverted colours. Scanners expect dark modules on a light background. Light-on-dark usually fails; a coloured code on a coloured background often fails too.
  • A logo that covers too much. Keep it under ~30% and use error-correction level H β€” and test the printed result, not just the screen.
  • Never testing the real thing. Scan the printed code with a cheap phone, in bad light, at arm's length. If it struggles there, your customers will struggle too.

Try it: QR Generator

Generate your own code with the QR Generator, then cover a corner with your thumb and scan it again β€” the error correction you just read about will keep it working.

Open the QR Generator β†’

Keep learning

Frequently asked questions

Do QR codes expire?

Static codes never expire β€” the data is in the squares. Dynamic codes last as long as the redirect service behind them keeps running. A code printed on a poster in 2015 still scans today if it was static.

Are QR codes safe to scan?

Mostly, but a code is just text β€” it can contain a link to a phishing site, which is called quishing. Your phone shows the URL before opening it: read it. Never scan a code that promises a login or a payment and leads somewhere you don't recognise.

Can a QR code be any colour?

It can be dark-on-light in most colours, but contrast is what matters β€” dark modules on a light background. Avoid light-on-dark, gradients across the code, and colours that are close in brightness.

Why won't my QR code scan?

Check in order: quiet zone present, enough contrast, printed large enough for the amount of data, not blurred or glossy with reflections, and the code itself isn't damaged beyond its error-correction level. Test with a different phone before redesigning.

How is a QR code different from a barcode?

A classic barcode is one-dimensional β€” it stores a short number in bar widths and needs a laser scanner aimed in a straight line. A QR code is two-dimensional, holds thousands of characters, and a phone camera reads it from any angle. Our Barcode Generator (the QR Forge's sibling tool) covers the 1D side.