QR code
A café prints a QR code for its menu on the tables and puts its logo in the middle. On the first tables the code reads at once, but on the new stickers it does not: the designer enlarged the logo. The code seems intact, all three corner squares are in place. But under the logo a third of one block's bytes have vanished, and level M correction fixes fewer. The phone looks at the code and says nothing.
A QR code writes text with square modules: dark is 1, light is 0. The data is split into bytes and laid out in a snake. Reed–Solomon correction bytes are added to them: the scanner uses them to restore the damaged part. One of eight masks is laid over the data so that the code has no large empty patches. The mask number and the correction level are written next to the finder patterns, twice.
| What it is | two-dimensional matrix code with error correction |
| Standard | ISO/IEC 18004; national versions — JIS X 0510 in Japan, GB/T 18284 in China, GOST R ISO/IEC 18004 in Russia |
| Size | versions 1–40: from 21×21 to 177×177 modules, +4 modules of quiet zone |
| Capacitance | up to 7089 digits, 4296 letters and digits or 2953 bytes |
| Protection | Reed–Solomon over GF(256), 7 to 30 % of bytes |
| Read with | with a camera: a laser line needs one row, QR needs the whole image |
Etymology
Quick response, mother and measure
The name QR is an English abbreviation coined in Japan; QR Code is a registered trademark of Denso Wave. Most languages kept the Latin letters, while Chinese named the code after its structure — “two-dimensional”. The standard calls the code a matrix code and its little squares modules.
01 · Structure
The service frame and the byte snake
Three finder patterns in the corners tell the camera where the code is and how it is rotated. The dashed timing line between them sets the grid step. From version two on, alignment patterns stand inside: the scanner uses them to correct skew and the bend of the paper. Near the finder patterns are 15 format bits, and in large versions 18 more bits of version number.
Everything else is data. It is written in columns two modules wide, in a snake: bottom to top, then top to bottom, right to left. Correction bytes follow the data right away. In large versions the bytes are split into several blocks and interleaved, so one blotch damages every block a little rather than one block entirely.
How a code reports level and mask
Choose a correction level and a mask. Below are five data bits, ten check bits and the protective mask. This string is written twice: around the top-left finder pattern and along the other two.
Build a code and damage it
The code is built from your text according to the standard: mode, version, blocks, Reed–Solomon, mask. “Structure” — click a module to learn whose bit it is. “Mask” — go through the eight masks and see the penalties. “Damage” — cover the middle with a logo, drop paint, scratch. The scanner reads what is left and repairs blocks.
02 · Evolution of two-dimensional codes
From a line to a plane
The linear code ran into a length limit: no more than about two dozen characters fit in a line. First the lines were stacked, then they moved to a grid of modules. Each code solved its own task: a part at a factory, a parcel on a conveyor, a ticket on a screen. QR won because it became free and arrived in phones.
03 · Modes and capacity
The alphabet decides the size
QR compresses data by the choice of mode. Digits go in threes in 10 bits. Capital Latin letters, digits and nine symbols go in pairs in 11 bits. Everything else goes in bytes of 8 bits. Before the data come 4 mode bits and a character count.
04 · What's inside
Just text, by agreement
QR itself does not know there is a link or a password in it. It stores a string. The phone looks at the start of the string: https:// — open the browser, WIFI: — join the network, BEGIN:VCARD — save the contact. Payment strings differ in every country. Mass QR payments began in China: Alipay and WeChat Pay. In India it is a upi://pay link, in the euro area a SEPA transfer in the EPC format, in Brazil Pix by the EMVCo template, in Russia payment details by GOST R 56042-2014.
05 · Printing rules
06 · Neighbouring codes
07 · Historical section
Masahiro Hara said the idea of the grid came to him while playing go: black and white stones on the board already carry a lot of information. The difficulty was elsewhere — the camera must instantly find the code among text and pictures. Hara went through newspapers, magazines and boxes and picked a width ratio that almost never occurs in print.
The 1 : 1 : 3 : 1 : 1 pattern looks the same along any line through the centre, whatever the angle the camera looks from. Having found three such patterns, the scanner knows the position, rotation and size of the code without reading a single data bit. That is why QR reads in any orientation, while a barcode has to be held with its line along the beam.
Catalogue of quantities
the whole index →The seven SI base units
A drop of acid changes the colour of the juice, salt colours the flame, water freezes at a tap. Below them are all Simetrium sheets, by discipline and alphabetically.
Open the index →





