NOTE 11 · CODES · EST. 1994

441 modules, 26 codewords, one square.

Watch HELLO WORLD become a real QR code: finder patterns, a bitstream, Reed–Solomon insurance, the zigzag, the mask election — every number computed live.

OCT 2026 ~10 MIN 5 SCENES + 1 LAB MODE: COMPUTED LIVE
PAYLOAD: THIS PAGE'S URL · 64 BYTES → VERSION 4-L

01The square is a grid

Scanning a QR code feels like pointing a camera at a tiny picture. It is not a picture. It is a grid of modules — small squares that are either dark or light — and every one of them has a job that was decided before anything was drawn. The smallest standard code is 21 × 21 modules: 441 seats. Around the grid sits a margin of light modules, the quiet zone, so the code has an edge a camera can find.

There is no other size ladder: a QR code's side is always 4 × version + 17 modules, for forty versions.

V121×21
V225×25
V329×29
V433×33
V537×37
V1057×57
V25117×117
V40177×177
SIDE = 4 × VERSION + 17 · EACH VERSION ADDS FOUR MODULES PER SIDE · THE HERO CODE ABOVE IS V4 (33×33) BECAUSE ITS URL NEEDS 64 BYTES

The rest of this page builds one code from scratch, the way an encoder does: the fixed furniture first, then the message HELLO WORLD as bits, then insurance, then seats, then a mask. The 21 × 21 version carries 26 codewords — bytes with a very particular commute — and by the end you will know the job of every module in the square.

Start with the empty square: 441 modules, all unassigned. A scanner will have to find this grid in a photo — tilted, half-lit, on a moving train — before it can read a single bit of your text.

So three finder patterns claim the corners: 7×7 squares whose rings run dark–light–dark in the ratio 1:1:3:1:1 — in both directions. That ratio is what a scanner hunts for, at any angle. The designers chose it as the alternating pattern least likely to appear in ordinary print.

Each finder gets a one-module light separator, so it cannot bleed into data and masquerade as a fourth landmark. Three corners fix position and orientation; the fourth is deliberately left free.

Two timing lines cross the code on row and column 6, alternating dark–light. They give the scanner a ruler: sample anywhere along them and you know how wide a module is in this photo.

Finally the dark module — always dark, no exceptions — and two reserved format strips where the code will later announce its error correction level and mask. The furniture is complete: 233 of 441 modules are already spent. Your text gets 208.

02The bitstream

The 208 free seats will hold 26 codewords — bytes, eight bits each. Before anything is seated, the message itself has to become bits, in an order every reader on Earth agrees on.

The payload: eleven characters. QR codes have four ways to write text — digits pack three-per-ten-bits, uppercase packs two-per-eleven — but the universal one is byte mode: any character, one byte each.

Each character becomes its byte. H is 01001000 — 72 — and so on for all eleven. Text, to this machine, was always numbers.

In front goes a header the reader can trust: the mode 0100 (byte), then the count 00001011 (eleven). No lengths are guessed in a QR code; they are announced.

A terminator of four zero bits closes the message. Header, data, close: 104 bits — exactly thirteen codewords.

Six seats remain, so the encoder pads with alternating bytes EC 11 EC 11… — not random filler, a fixed pattern any reader can strip. The rack is full: 19 data codewords, ready for insurance.

Half the square was spoken for before your text arrived.

Nineteen codewords on the wall. A scratched module, a glint of glare, a sticker across the corner — any of these can corrupt them. So QR codes insure the payload before it ships.

The tool is Reed–Solomon arithmetic. The encoder treats the data as one long number and divides it by a fixed degree-7 generator over a 256-value finite field — the strip below the wall. You never see a decimal point; addition is XOR, multiplication wraps like clockwork.

It keeps only the remainder: seven bytes, different for every message. For HELLO WORLD they are C8 46 26 41 E8 F8 F6 — computed by the code rendering this page, not typed into it.

Data plus remainder: 26 codewords. With seven parity bytes the code can repair any 3 damaged codewords — unknown values, recomputed from the survivors. That is the whole magic of a logo printed over a QR code: the logo is damage, and the insurance pays for it.

Insurance is a dial. Levels L, M, Q, H buy 7, 10, 13, 17 parity bytes — correcting 3, 5, 6, 8 codewords — and pay for it with capacity: 19, 16, 13, 9 data codewords. A warehouse label picks H; a poster with a clean print picks L.

Twenty-six codewords, 208 bits, 208 free seats — and a seating chart. It starts at the bottom-right corner, in a two-module-wide column, moving upward: right bit, then left bit.

At the top, the next column pair drops and the direction flips: down, then up, then down — a zigzag the reader can walk without a single instruction beyond "start here".

When the walk meets furniture — a format strip, a finder — the bits do not overwrite it. They wait for the next free module. The chart serves the furniture, never the reverse.

One hard exception: the vertical timing column is never crossed. When the zigzag reaches it, the next column pair simply starts to its left.

The columns climb toward the top-left finder. Every seat filled so far is real: each module below is one actual bit of the 208, in order.

All 208 bits seated; furniture intact; nothing left over. The code now says exactly what it should — and it would still be hard to read. The last problem is the pattern itself.

Here is the unmasked code. The problem is visible: long runs of one color, and shapes that imitate a finder. A scanner resolving modules along a blurry line has no idea which square a smudge belongs to — big flat regions are where it fails.

The fix is a mask: a fixed formula that flips modules wherever it says so. This one — mask 0 — flips every module whose row and column sum to an even number: a checkerboard, drawn in acid. Flipping is free: the reader applies the same formula and flips them back.

There are eight formulas. The encoder applies each one and scores the result with penalty rules: long runs cost 3 points per extra module, 2×2 blocks cost 3, finder-lookalikes cost 40, and every step away from 50% dark costs 10. The scores below are computed for this exact code.

The election: lowest penalty wins. Mask 3 scores 444 and takes it; the runner-ups stay dimmed. Same message, same seats — only the flipping rule differs.

One duty left: announce the choice. The format strips carry five bits — level L, mask 3 — protected by their own error-correcting code and written twice, because a scanner that misreads the mask can decode nothing at all. The square is finished.

THE LAB BREAK IT (ON PAPER) DAMAGE VS BUDGET · COMPUTED

EACH ORANGE PATCH COVERS THE EIGHT MODULES OF ONE CODEWORD — REAL SEATS FROM THE ZIGZAG. THE VERDICT IS COMPUTED, NOT SIMULATED: THIS PAGE ENCODES, IT DOES NOT DECODE. THE BUDGET IS FLOOR(EC ÷ 2) PER REED–SOLOMON BLOCK; A VERSION-1 CODE HAS ONE BLOCK. YOUR CAMERA IS THE DECODER — THE HERO CODE AT THE TOP STILL SCANS. LEVEL H IS NOT IN THE PICKER FOR A REASON: IT SPENDS 17 OF A 21×21 CODE'S 26 CODEWORDS ON INSURANCE, LEAVING ONLY 9 DATA CODEWORDS — HELLO WORLD NEEDS 13, SO AT H IT ONLY FITS IN A VERSION 2 CODE.

03One choreography, 1994 → now

Put together, a QR code is a small machine for being read badly: fixed furniture that announces the grid, Reed–Solomon insurance on the payload, a zigzag with no ambiguities, and a mask elected to keep the noise looking like noise. Nothing in the square is stored twice by accident — the format strips are the only redundancy that is not mathematics.

The design dates to 1994, when Masahiro Hara's team at Denso Wave — a Toyota supplier — needed to replace the stack of barcodes on each box of car parts with one symbol that could also carry kanji. The black-and-white counters of a Go board are the often-told inspiration; the finder's 1:1:3:1:1 came from a search for the alternating pattern least used on printed matter. "QR" stood for quick response, and the name kept its promise: standardized by AIM in 1997, by Japan as JIS X 0510 in 1999, then as ISO/IEC 18004 — now in its 2024 edition. Denso Wave held the patents and chose not to enforce them for standardized codes, which is why the square spread from parts shelves to payments, boarding passes, and menus. "QR Code" remains its trademark.

FINDER 1:1:3:1:1 TIMING FORMAT ×2 DATA + EC — 208 MODULES
THE SAME HELLO WORLD CODE BUILT ON THIS PAGE — MASK 3, LEVEL L, 230 DARK MODULES OF 441

Capacity is the one number people quote, so quote it exactly. At version 40 with level L — 177 × 177 modules — the maximums are:

MODEPACKINGMAX AT 40-L
Numeric10 bits per 3 digits7,089 digits
Alphanumeric11 bits per 2 characters4,296 characters
Byte8 bits per byte2,953 bytes
Kanji13 bits per character1,817 characters

Three kilobytes is the ceiling — a QR code is a label, not a file system. When a payload is longer, encoders switch modes mid-message (URLs lowercase their scheme, then pack the uppercase-legal path two characters at a time) or split across several codes. The micro and rectangular variants shrink the furniture for tiny parts; the ideas above do not change.

A QR code is not a picture of a link. It is a choreography — furniture, insured bits, assigned seats, an elected mask — that any camera can dance.
Scope: the standard square QR code ("model 2") in byte mode; the live encoder on this page implements versions 1–5 at all four levels, verified against a published Reed–Solomon test vector and decoded by an independent reader. Penalty scores, codewords, and damage verdicts are computed by the code that renders them. Correctable counts are the per-block guarantee floor(EC ÷ 2); the familiar "7 / 15 / 25 / 30%" figures are the standard's approximate restorable share of larger symbols. Sources: Denso Wave · History of QR Code, Wikipedia · QR code, Thonky · QR Code Tutorial, ISO/IEC 18004:2024.