QR code basicsTechnology

How Do QR Codes Work? A Plain-English Explanation

The corner squares, the random-looking speckle, the blank margin — every part of a QR code is doing a specific job. Here is what each one does, and why that matters when you print one.

The Qrelux Team6 min read

A QR code looks like visual noise, which is exactly why most people never think about what is inside one. But the pattern is highly structured, and once you can see the structure, a lot of practical decisions get easier — why some codes are denser than others, why a logo in the middle is survivable, and why cropping the white border kills the whole thing.

This is the non-mathematical version. No Reed–Solomon algebra, just what the parts do.

Where QR codes came from

QR codes were invented in 1994 by Denso Wave, a subsidiary of the Toyota group, to track parts moving through car factories. Ordinary barcodes held too little data and had to be scanned at the right angle; the team wanted something a scanner could read fast, from any orientation, even if it was a bit grubby.

The name is literal: Quick Response. Everything about the design serves reading speed and tolerance of real-world mess — which is why they turned out to be so well suited to a job nobody anticipated, being photographed off a poster by a phone.

The anatomy of a QR code

Every code is a grid of small squares called modules. Some of them carry your data. Most of the rest are structural — they exist to help a scanner orient itself.

The three big corner squares

These are the finder patterns, and they are the first thing a scanner looks for. Three squares in three corners is enough to establish where the code is, how big it is, and which way up it is — which is why you can scan a code upside down or at an angle and it still works instantly.

The fourth corner is deliberately left free. Three points define the orientation; a fourth would be redundant.

The smaller squares and the dotted lines

Larger codes also carry alignment patterns — smaller concentric squares scattered through the grid — which let a scanner correct for distortion when the code is printed on something curved or photographed at a steep angle.

The dotted lines running between the finder patterns are timing patterns: strictly alternating light and dark modules. They act as a ruler, telling the scanner exactly how wide one module is so it can lock onto the grid.

The blank margin

The clear border around the pattern is the quiet zone, and it must be at least four modules wide. Without it, a scanner cannot tell where the code ends and the rest of the page begins. This is the single most commonly destroyed part of a printed QR code — see why QR codes fail to scan.

Everything else

The remaining modules — the part that looks like static — are your data plus its error-correction codewords, laid out in a zigzag from the bottom-right corner. A narrow strip beside the finder patterns holds format information: which error correction level was used and which mask was applied.

How a phone reads one

The whole thing happens in a fraction of a second, but the sequence is:

  1. Find the code. The camera looks for the distinctive finder pattern — a dark square, a light ring, a dark centre, in a fixed ratio that almost nothing else in nature produces.
  2. Work out the geometry. Three finder patterns give position, size and rotation. Alignment and timing patterns correct for skew and confirm the module width.
  3. Read the format strip. This says which error correction level and which mask were used.
  4. Undo the mask. The mask is reversed to recover the raw bits.
  5. Decode and repair. The data is read off, and the error-correction codewords are used to fix anything unreadable.
  6. Interpret the text. The result is a string. If it starts with http, the phone offers to open it; if it starts with WIFI:, it offers to join a network. That prefix is the whole mechanism — see the free generator for what each type encodes.

That last point is worth dwelling on, because it is the most common misconception about QR codes: a QR code is just text. It is not a program, and it cannot do anything by itself. Everything that happens after a scan is your phone reacting to a string it recognised.

Why codes look random (and why yours will differ)

If large areas of a code came out solid black or solid white, scanners would struggle to find the grid. So before the pattern is finalised, the encoder tries eight different masks — fixed patterns XORed over the data — and picks whichever produces the most evenly distributed speckle.

This is why two codes holding the same text can look completely different if generated with different settings, and why the pattern never looks tidy. The randomness is deliberate.

How much data actually fits

QR codes come in 40 versions. Version 1 is a 21×21 grid; each version adds four modules per side, up to version 40 at 177×177. The generator picks the smallest version your data fits into.

There are also four encoding modes, and the more restricted the character set, the more efficiently it packs. At maximum size and minimum error correction, the ceilings are roughly:

ModeCharactersMaximum capacity
Numeric0–9 only~7,089 digits
Alphanumeric0–9, A–Z, some symbols~4,296 characters
ByteAnything, including lowercase~2,953 characters
KanjiJapanese characters~1,817 characters

Those numbers are theoretical maximums, not targets. A version 40 code has 177 modules across; printed at 3cm, each module is under 0.2mm and no phone will read it. Capacity is limited by physics long before it is limited by the format.

Why a damaged code still scans

QR codes carry redundant data using Reed–Solomon error correction — the same family of maths used on CDs and in deep-space transmission. You choose how much redundancy at generation time:

LevelRecovers roughlyTrade-off
L7% of the codeSmallest, densest data payload
M15%The usual default
Q25%Noticeably larger pattern
H30%Largest pattern

This is why a scuffed label still works, and why you can place a logo in the middle of a code — the missing modules are reconstructed from the redundancy. It is also why that trick has a hard limit: the correction budget is shared between your logo and real-world damage, so a logo that uses all of it leaves nothing for a coffee ring. Adding a logo properly covers where that line sits.

Higher correction is not free. More redundancy means more modules, which means smaller modules at the same printed size. Turning correction up to compensate for a code that is too small makes things worse, not better.

What this means when you actually print one

Four practical consequences fall out of the structure:

  • Shorter data prints smaller. Fewer characters means a lower version, means fewer and bigger modules, means it scans from further away.
  • The quiet zone is not decoration. It is a functional part of the code. Never crop it.
  • The corner squares are sacred. Restyle the data modules if you like; leave the finder patterns alone.
  • Error correction is a budget, not a safety net. Spend it on a logo or on durability, but not both.

None of this changes what a scan feels like to the person holding the phone — which is the point. The format was designed in 1994 to be forgiving, and it mostly is. It just is not infinitely forgiving.

Make a code with the quiet zone and error correction set correctly, free and without signing up.

Open the free QR code generator

Frequently asked questions

How do QR codes work?

A QR code stores text as a grid of black and white squares called modules. Three large corner squares let a scanner find the code and work out its orientation, timing and alignment patterns lock onto the grid, and the remaining modules hold your data plus redundant error-correction data. The phone decodes the grid back into text and reacts to it — opening a link, joining a network, or saving a contact.

Can a QR code contain a virus?

No. A QR code is just text and cannot execute anything by itself. The risk is entirely in the destination: a code can send you to a malicious website exactly as a typed link could. That is why previewing the URL before opening it matters.

How much data can a QR code hold?

At maximum size, roughly 7,089 digits, 4,296 alphanumeric characters, or 2,953 bytes. Those are theoretical limits, though — a maximum-size code has 177 modules across and is unreadable at normal print sizes. For anything printed, keep the encoded text under about 100 characters.

Why do the three corner squares matter?

They are the finder patterns, and they are the first thing a scanner looks for. Three of them are enough to establish the code's position, size and rotation, which is why a code scans upside down or at an angle. Covering or restyling them breaks the code, unlike a logo in the centre, which error correction can absorb.

Who invented QR codes?

Denso Wave, a Toyota group subsidiary, in 1994. They were designed to track car parts through factories, where ordinary barcodes held too little data and had to be read at the right angle. QR stands for Quick Response.

Stop guessing what your printed marketing does

Dynamic QR codes let you change the destination after printing and show you every scan—when, where, and on what device.

Start a 14-day free trial

No credit card required

Keep reading