marcella

In plain words · technology

How a QR code works

I take a real QR code apart, module by module: it holds a link to this very page — point a camera at it and check. Nine steps: how the camera finds the code, where the data sits and why it still reads with a piece covered.

In short

A QR code is a square of black and white cells that stores text, most often a link. Three large squares in the corners help the camera find and straighten the code; the other cells hold the data and spare bytes for error correction. That is why the code still reads when part of it is covered by a logo.

Marcella, web and bot developer · updated 17 November 2026

A link: 37 characters

Step 01 / 09

What is inside

A QR code is text written as a picture. This one holds a link to this page: https://marcella.solutions/explain/qr, 37 characters.

Technically: a black module is a one, a white module a zero. A 29×29 grid is “version 3”.

A module is one cell of the code. The version is the grid size: from 1 (21×21) to 40 (177×177).

Glossary · tap a word and the diagram will show it

Check it yourself: point a phone camera at the code and this very page opens. The code is real; you can print it.

In short

A QR code is text written as a picture. Most often it holds a link, but it can be anything: a phone number, Wi-Fi login details, payment details. The name comes from Quick Response. The code was invented in 1994 at the Japanese company Denso Wave to read car-part labels at Toyota plants, and was left free for anyone to use.

The code is a grid of black and white cells called modules. A black module is a one, a white module a zero. Some modules are for service: three big squares in the corners help the camera find the code and see how it is turned, dotted stripes set the size of the grid, a small square corrects for skew. The rest is data plus error correction: extra bytes that let the phone rebuild scratched or covered areas.

The grid size depends on how much is stored: from 21×21 modules to 177×177. The largest code holds 2,953 bytes — about a page of text. Ours is 29×29: a 37-character link with enough spare to read the code with a patch covered, as step 8 shows.

A QR code by itself is safe: it is just text. What can be dangerous is the address it points to, so look at what the phone shows before you open it. Payments via SBP work through QR codes too — the code holds a link to an invoice in the Faster Payments System.

Questions and answers

What is a QR code, in plain words?
Text written as a square picture of black and white cells. A phone camera reads the cells as ones and zeros and turns them back into text — most often a link. The name stands for Quick Response: the code was invented in 1994 at Denso Wave to track car parts.
How does a phone read a QR code?
It first finds the three big corner squares and works out where the code is and how it is turned. It counts the grid along the dotted lines and fixes the tilt with the small square. Then it reads the format strips (error level and mask), removes the mask, walks the data in a snake and corrects errors. All in a fraction of a second.
How much fits in a QR code?
The largest code (177×177 modules) holds up to 7,089 digits, or 4,296 letters and digits, or 2,953 bytes — about a page of text. But the more you store, the smaller the cells and the harder the code is to read, so short addresses work best for links.
Why does a scratched code, or one with a logo, still read?
Spare bytes — Reed–Solomon codes — are added in advance. The phone uses them to rebuild damaged areas: up to 7% of the code at level L, 15% at M, 25% at Q, 30% at H. A logo in the middle eats part of that spare, so codes with logos use level Q or H.
Is it safe to scan QR codes?
The code itself is safe — it is just text, and scanning runs nothing. The risk is the link: fraudsters stick their own codes over real ones — in car parks, restaurants, on bills — and send people to fake payment sites. This is called quishing. Look at the address the phone shows before opening it, and do not enter card details on unknown sites.
QR code versus barcode — what is the difference?
An ordinary barcode is one row of bars holding a product number of about 13 digits. A QR code is two-dimensional: data runs both across and down, so it holds hundreds of times more and reads from any angle and with some damage.
What is a dynamic QR code?
A code holding a short link to an intermediary service, which then redirects to the real address. The address can be changed without reprinting, and scans can be counted. The downside: it works only while the service works and the subscription is paid. A plain static code with a direct link works forever.
How do I make a QR code for payments?
In Russia payment QR codes usually come from SBP: a bank or payment gateway issues them, and inside is a link to an invoice on qr.nspk.ru. A code can be static (one sticker at the till, the buyer types the amount) or dynamic (a new code with the amount for each order). A website or a Telegram bot can create them automatically — that is what I build, see below.

QR payments on your site

I will add SBP payments: a QR code on desktop, a jump into the bank’s app on the phone. Or build a Telegram bot that issues the invoice and sends the QR by itself.