QR QR Studio

fundamentals

How QR codes work

Published 7 September 2026 · 2 min read

A QR code looks like noise. It is actually one of the most orderly things you will point a camera at. Every square in it has a job, and once you know the jobs the whole thing makes sense.

The parts

  • Version 3, 29×29 modules, error correction M, mask 0. Tap a label to isolate it.
Every module in a QR code has a job. The three large squares are finder patterns; the dotted lines joining them are timing patterns; the small square near the bottom right is an alignment pattern; the strips beside the finders carry format information; everything else is your data and its error-correction codewords.

Finder patterns. The three large squares, one in each corner except bottom-right. A scanner looks for their distinctive 1:1:3:1:1 ratio of dark and light in any direction. Find three of them and you know where the code is, how big it is and which way it is turned.

Timing patterns. A row and a column of alternating dark and light modules joining the finders. They let the scanner count how many modules wide the code is, which tells it the version.

Alignment patterns. Small squares scattered across larger codes. If the code is printed on a curved cup or photographed at an angle, these let the scanner correct the distortion. Version 1 (the smallest) has none.

Format information. Two copies of fifteen bits beside the finders, saying which error-correction level and which mask was used. Without these nothing else can be read, so they get their own protection.

Data and error correction. Everything else. Your text, plus extra codewords that let the scanner repair damage.

What happens when you scan

  1. The camera takes a picture and turns it into black and white.
  2. The scanner hunts for the three finder patterns.
  3. It uses them, and the timing patterns, to lay a grid over the image and read each module as 0 or 1.
  4. It reads the format bits, learns the mask, and removes it.
  5. It reads the data modules in a zigzag from the bottom-right corner upwards.
  6. Reed–Solomon error correction fixes any modules it read wrongly.
  7. The bits become text. Your phone sees that it starts with https:// and offers to open it.

In practice

Steps 2 and 3 are why the white border matters. The finder search needs to see the edge of each big square against clean white. Crowd the code with text and step 2 fails before anything else gets a chance.

Why a damaged code still reads

  • Level L 7%
  • Level M 15%
  • Level Q 25%
  • Level H 30%
Share of codewords that can be repaired at each error-correction level.

Some of the data modules are not data at all. They are computed from the data using Reed–Solomon coding, the same maths that lets a scratched CD play. At level M, about 15% of the codewords can be wrong and the message still comes out intact. That budget is what a logo in the middle spends.

Common mistake

Thinking the error correction protects the corners. It protects the data. Damage a finder pattern and the scanner never finds the code, however high the level.

Three examples

QR code encoding https://getqrstudio.app/scan?c=v1
Version 1, level L: 21 modules, a short link, nothing to spare.
QR code encoding https://getqrstudio.app/scan?c=version-three-example
Version 3, level M: 29 modules and an alignment pattern appears.
QR code encoding https://getqrstudio.app/scan?c=this-is-a-much-longer-example-link-with-tracking-parameters&utm_source=learn&utm_medium=web
Version 7, level H: 45 modules. Same print size, much finer squares.
Masking, and why codes look random

After encoding, one of eight fixed patterns is XORed over the data area. The encoder scores each result for large blank areas, long runs, and anything resembling a finder pattern, then keeps the best. That is why two codes for nearly the same text can look completely different, and why a code never has a big white hole in it. The deep dive shows all eight masks.

Try it yourself

Type your own text and watch the version, alignment patterns and mask change. Tap a legend item to see only that part.

Open the anatomy explorer

Frequently asked questions

Does a QR code contain an image or a website?

Neither. It contains text, usually a web address. Your phone reads the text and decides what to do with it.

Why are there only three big squares, not four?

Three are enough to work out position, rotation and skew. The fourth corner is used for data, and the small alignment square helps with distortion.

Can a QR code be read upside down?

Yes. The three finder patterns tell the scanner which way is up, so orientation does not matter.

Related reading

Make yours in QR Studio

Unlimited static codes free, no ads, no watermark. AI design, dynamic codes and print-ready export when you need them.

Download on the App Store