โ† All posts

How Do QR Codes Work? A Plain English Guide

๐Ÿ• 7 min readยทFor: Curious owners, students
QR basicsexplainer

You'll learn: What the squares in a QR code mean, how a phone reads them, and why error correction and the quiet zone matter when you print one.

How do QR codes work, in two sentences?

A QR code stores text, usually a web address, as a grid of dark and light squares, where each square is a 1 or a 0. Three big squares in the corners show the phone where the code is and which way up it is, and extra repeated data lets the phone fill in parts that are dirty, damaged or covered by a logo.

That is the whole idea. The rest of this guide explains each part in plain English, and what it means for the codes you print.

A large QR code grid with its three corner squares and a magnifying glass over one corner
A large QR code grid with its three corner squares and a magnifying glass over one corner

Where QR codes came from

The QR code was invented in 1994 by a team led by engineer Masahiro Hara at Denso, a Japanese car parts maker, to track parts faster than ordinary barcodes allowed. "QR" stands for Quick Response. IEEE Spectrum's history of the QR code tells how the board game Go and a view of tall buildings from a train shaped the design. Denso Wave chose not to enforce its patent, which is a big reason QR codes spread everywhere.

The parts of a QR code

Every QR code is a square grid of small cells called modules. Here is what they do.

PartWhat it looks likeWhat it does
Finder patternsThree large squares in three cornersLet the phone find the code and see which way up it is
Timing patternsA dotted line of alternating modules between the findersTell the phone how big each module is
Alignment patternA small square near the fourth corner (on larger codes)Helps when the code is curved or seen at an angle
Format informationA strip of modules next to the findersSays which error correction level and mask are used
Data and error correctionEverything elseYour content, plus the spare data to repair damage
Quiet zoneThe empty light border around it allSeparates the code from everything around it

The three finder squares have a fixed pattern of dark and light rings in the ratio 1:1:3:1:1. That exact ratio is rare in the real world, so a phone can spot it quickly in a busy scene.

How a phone reads it

  1. Find. The camera looks for the three finder squares.
  2. Straighten. Using those corners and the alignment pattern, it maps the tilted picture back to a flat square grid.
  3. Measure. The timing patterns tell it how many modules there are across.
  4. Read the settings. The format strip says how much error correction there is and which mask was used.
  5. Unmask. Before printing, the pattern was mixed with one of eight masks, so there are no large blank or solid areas that would confuse the camera. The phone undoes it.
  6. Decode and repair. It reads the 1s and 0s, uses the error correction data to fix any wrong or missing ones, and turns the result back into text.
  7. Act. If the text is a web address, the phone offers to open it. If it is Wi-Fi details or a contact card, it offers to join or save.

All of this takes a fraction of a second.

A phone camera pointed at a QR code on a card
A phone camera pointed at a QR code on a card

Error correction: the spare data

QR codes use a method called Reed-Solomon error correction, the same family of maths used on CDs. It adds extra data so missing pieces can be rebuilt. There are four levels:

LevelRoughly how much can be lost
L (Low)7%
M (Medium)15%
Q (Quartile)25%
H (High)30%

More correction means more modules, so the code gets denser. That is the trade-off. A centred logo uses up some of this spare capacity, which is why a logo code should use High. See QR code with logo.

Size, data and versions

QR codes come in 40 sizes called versions. Version 1 is 21 by 21 modules; each version adds four modules per side, up to version 40 at 177 by 177. The more you store, the higher the version and the smaller each module at the same print size.

This is the practical reason to keep what you encode short. A long web address with tracking tags makes a much denser code than a short link. A dynamic code encodes only a short link, so it stays a simple, low version code however long the real address is.

The quiet zone

The QR standard asks for an empty light border four modules wide on every side. Without it, the phone may read nearby text or the edge of a design as part of the code. Printers trimming to the edge and designers placing text right up against the code are common causes of codes that will not scan.

Step by step: see these parts in your own code

Step 1: Make a code in the free generator

Open the free QR code generator and type a short link. Look for the three finder squares in the preview.

The free QR code generator with a link typed in and the live preview
The free QR code generator with a link typed in and the live preview

Step 2: Watch the density change

Now paste a very long web address instead. Notice how the modules become smaller and more crowded. That is a higher version.

Step 3: Try error correction in Scnr

In Scnr, open a code's Style step, then the Advanced tab, and change Damage protection from Low to High. The code grows denser as more spare data is added.

Step 4: Read it back

Scan your code with the free QR code scanner. It shows the exact text inside, decoded from the modules.

The scanner result showing the address inside the code before you open it
The scanner result showing the address inside the code before you open it

Example: a teacher in Matara

This is an example, not a real customer. Dinusha teaches ICT at a school in Matara. To explain binary, she printed two QR codes on A4: one for a short link and one for a long link with many tags. Students counted the modules across each and saw the long one was far denser. Then they covered parts of each with sticky notes until the phones stopped reading them, a simple way to see error correction at work.

Common questions

Q: Is there a limit to how much a QR code can hold?
A: Yes. The largest version holds a few thousand characters. In practice, keep it to a short link so the code stays easy to scan.

Q: Can two QR codes look the same but go to different places?
A: Not if they contain different text. But two dynamic codes can look very similar, since each holds a short link of the same length.

Q: Do QR codes need the internet?
A: Reading the code does not. Opening a web address inside it does. A Wi-Fi or contact code works offline.

Q: Why are some QR codes round or coloured?
A: Scanners only care about dark and light. Rounded dots and colours work as long as contrast stays high and the finder squares stay clear.

Make one yourself

Try the free QR code generator, or make a dynamic, trackable code in Scnr. If a printed code is giving you trouble, read why your QR code is not scanning.

Ready to create?