01Guide
How a QR code works.
Three squares in the corners, a grid of dots, and a phone reads a link from it. Here is each area of the code, and what the reader does with it.
The short answer
A QR code is a grid of dark and light modules. A fixed part helps the reader find the code, straighten it and read it. The rest carries the message in 8-bit words, with error correction that keeps it readable even when damaged.
By QR Samurai · published on · 10 sources · All guides
01A grid of modules
A QR code is a square of small dark or light squares, the modules[1]. A barcode stores information in one direction, a 2D code in two[2].
DENSO WAVE, then a division of DENSO CORPORATION, introduced it in 1994. “QR” stands for quick response: a code that reads quickly[2]
Its use is free, as long as the standard is followed[3]: DENSO WAVE does not enforce its patent on standardized codes[4].
You cannot see its content by looking at it[3]: the inspector reads it, without opening the link.
The layout of a QR code, here in version 7: 45 modules per side, surrounded by their margin.
In blue, the finder patterns and their separators. In gray, the timing patterns. In orange, alignment. In purple, format; in turquoise, version. In black, the data; in green, error correction.
02The fixed patterns
The reader must first find the code, see which way it is turned and straighten its grid: that is the job of the fixed patterns[5].
- The finder patterns: three squares of 7 × 7 modules, in three corners[6]. Their bands follow the ratio 1:1:3:1:1, chosen by DENSO WAVE because it was the rarest in printed matter: the reader recognizes it from any angle[2].
- The separators: a light band one module wide around each finder pattern[6].
- The timing pattern: the seventh row and seventh column, where dark and light alternate from one finder pattern to the other[7]
[6]. - The alignment patterns: squares of 5 × 5 modules[7], added with model 2, today’s QR code. They let a code on a curved surface or seen at an angle still read[8]. None in version 1, one in versions 2 to 6, 6 in version 7, 46 in version 40[6].
- The quiet zone: a mandatory light margin of 4 modules on all four sides[9].
In version 1, 233 of the 441 modules are fixed or reserved for format information: that leaves 208 for the message and its error correction[6].
Error correction does not protect these patterns: if a finder pattern is destroyed, the reader can no longer orient the grid[5].
03From text to bits
To write text in bits, the QR code has four modes, more or less economical[3].
- Numeric: the ten digits[3], three per 10 bits[6].
- Alphanumeric: the digits, the 26 uppercase letters and 9 symbols, the space and $ % * + - . / :[3]. Two characters per 11 bits[6].
- Byte: everything else, lowercase and accented letters included, 8 bits per byte[3]
[6]. In UTF-8, which our encoder writes, an accented letter takes two bytes[6]. - Kanji: Japanese characters[3], 13 bits each[6].
Each segment announces its mode in 4 bits, then its length, in a field whose size changes at versions 10 and 27[7].
For 12 characters, our encoder counts 54 bits for “202611222026”, 79 for “WELCOME 2026” and 108 for “Welcome 2026”[6]: lowercase letters cost the most.
A single code can mix modes[4], and the split is up to the software: two generators can draw two different codes for the same text[3]. Ours aims for the smallest code[6].
An end-of-message marker and padding bytes, 236 and 17 in turn, fill up the version[7].
04Error correction
The bits form 8-bit codewords. Error-correction codewords, computed with the Reed-Solomon method, are added to the data codewords, and let a dirty or damaged code still be read[10].
Developed for links with satellites and space probes, and also used in audio CDs, it corrects whole bytes at a time, which handles burst errors well[10].
Two error-correction codewords repair one damaged codeword. Whoever creates the code chooses among four levels[10]:
- L: about 7% of codewords can be restored[4], for a clean environment and a lot of data[10].
- M: about 15%[4], the most common level[10].
- Q: about 25%[4].
- H: about 30%[4]. Q and H suit places where the code gets dirty, such as a factory[10].
These percentages are rounded: version by version, the actual rate ranges from 7.7 to 10.5% at L, from 15.4 to 19.2% at M, from 23.1 to 28.0% at Q and from 30.8 to 33.2% at H[6].
Raising the level makes the code bigger[10]: at version 10, capacity drops from 271 bytes at L to 119 at H[6].
In large codes, the codewords are split into blocks, each with its own error correction, then interleaved[7]
05Placement, mask and format
The codewords are placed in a zigzag, in columns two modules wide, from the bottom-right corner[7]
A mask, a regular pattern that inverts part of the modules, breaks up large uniform areas and shapes that imitate a finder pattern and would fool the reader[5]. It never touches the fixed patterns[7].
The encoder tries all eight masks and keeps the least penalized under four rules: runs of the same color, 2 × 2 blocks, shapes that imitate a finder pattern, imbalance between dark and light[7]
The chosen mask is written in the format information: 15 bits, written twice near the finder patterns[5]
From version 7 on, two blocks of 6 × 3 modules repeat the version number, near the top-right and bottom-left finder patterns[7]
06Versions, from 1 to 40
The size of a QR code is called its version: 21 modules per side in version 1, 4 more with each version, 177 in version 40[1].
The more data, the more modules[1]: the generator picks the smallest version that fits at the chosen level[6].
At the maximum, in version 40 at level L: 7,089 digits, 4,296 alphanumeric characters or 2,953 bytes[4]. Version 1 at level H holds 17 digits, or 7 bytes[6].
The first model stopped at version 14, that is 73 × 73 modules[8].
Capacity and layout of each version: Capacity and 40 versions. Print size: the calculation.
Micro QR, the smaller one, has been a Japanese standard since 2004[2]. It has its own page, as does the rectangular QR code.
07What the phone does
The phone retraces the path in reverse: it looks for the three finder patterns, then the alignment pattern near the fourth corner, to correct size, orientation and viewing angle[5].
It reads the format information, removes the mask and converts the modules into bits; error correction checks the message and repairs it if needed[5].
Android, and iOS since iOS 11, read QR codes with the camera, with no app to install[5].
It gets a text, and decides what to do with it: display it, open a web page, offer a Wi-Fi network, add a contact[5].
On this site, every code created is read back this way by a decoder, ZXing, before download[6].
The drawing does not say whether the address read leads to the page or to a service that redirects to it: that is the difference between a static and a dynamic code, explained in this guide.
02Questions
Frequently
asked questions.
Why does a QR code have three squares in the corners?
They are the finder patterns: the reader looks for them first, to find the code and see which way it is turned.
What do levels L, M, Q and H mean?
They are the four error-correction levels: about 7, 15, 25 and 30% of codewords can be restored. The higher the level, the more the code resists damage, and the bigger it gets.
Can a damaged QR code still be read?
Yes, within the limit of its correction level, if its finder patterns are intact: error correction does not protect the fixed patterns.
How many characters can a QR code hold?
At most 7,089 digits, 4,296 alphanumeric characters or 2,953 bytes, in version 40 at correction level L.
Why are two QR codes for the same link different?
The software chooses the mode, the correction level and the mask: other choices give a different drawing, for the same link.
What is the white margin around the code for?
It is the quiet zone: 4 light modules on each side, and it is required. Include it in the space you plan for.
Who invented the QR code?
A team of two people at DENSO WAVE, a barcode reader maker. The code came out in 1994, after a year and a half of development.
03Sources
Sources
and dates.
Every claim in this guide links to one of these pages, read in full, with the date it shows and the day we read it.
- [1]
Information capacity and versions of the QR CodeDENSO WAVE, inventor of the QR codeNo date shown · accessed November 22, 2026
- [2]
History of QR CodeDENSO WAVESections 1 to 3: development, the 1:1:3:1:1 ratio, the 1994 launch, Micro QR.No date shown · accessed November 22, 2026
- [3]
FAQDENSO WAVEQuestions on the name, usage rights, the four modes and different codes for the same content.No date shown · accessed November 22, 2026
- [4]
QR Code StandardizationDENSO WAVEStandardization dates, patent, summary specification: maximum capacities and correction levels.No date shown · accessed November 22, 2026
- [5]
QR codeEnglish WikipediaRevision no. 1386207351, sections “Design”, “Error correction” and “Format information and masking”. Cited only in place of the ISO/IEC 18004 standard, which is not free.Date shown: November 17, 2026 · accessed November 22, 2026
- [6]
Zones, codewords, bits and capacities calculated by the site’s encoderQR Samurai measurementCalculations redone each time the site is built. Tests compare the map of zones, module by module, with that of a second encoder (uqr 0.1.3), and have ZXing read back the codes produced (zxing-wasm 3.1.7).Date shown: November 22, 2026 · accessed November 22, 2026
- [7]
Creating a QR Code step by stepProject NayukiThe steps of building a QR code, from 0 to 9. Our encoder follows Project Nayuki’s algorithms.Date shown: November 5, 2018 · accessed November 22, 2026
- [8]
QR Code Model 1 and Model 2DENSO WAVENo date shown · accessed November 22, 2026
- [9]
Point for determining the code areaDENSO WAVE4-module margin around the code.No date shown · accessed November 22, 2026
- [10]
Error Correction FeatureDENSO WAVENo date shown · accessed November 22, 2026