What is a QR code?
A QR code is a square made of small black and white squares that a camera can read. The two letters stand for “Quick Response”.
Where it comes from
The QR code was invented in 1994 at Denso Wave, in Japan. It was made for a practical job: tracking automotive parts. Instead of somebody reading and typing information, a scanner takes it straight from the printed square. The name states the goal, which is a response that comes quickly.
The format is standardised as ISO/IEC 18004. A shared standard describes how a code has to be built, so a code made with one tool can be read by a scanner made by somebody else. That is why you do not need a special app for a particular code: the rules are the same everywhere.
The little squares are called modules
Each black or white square in a QR code is a module. A module is the smallest unit of the code. It is either dark or light, and nothing in between. All the modules together form a square grid, and reading a code means working out, position by position, which modules are dark and which are light.
Because the grid runs both across and down, a QR code is a two-dimensional code: the information is spread over an area, not along a single line.
Sizes: versions 1 to 40
QR codes come in 40 sizes, called versions. Version 1 is the smallest, at 21 × 21 modules. Every next version adds 4 modules to each side, so version 2 is 25 × 25 and version 3 is 29 × 29. The pattern continues up to version 40, which is 177 × 177 modules.
| Version | Modules per side | Modules in total |
|---|---|---|
| 1 | 21 × 21 | 441 |
| 2 | 25 × 25 | 625 |
| 3 | 29 × 29 | 841 |
| 10 | 57 × 57 | 3,249 |
| 40 | 177 × 177 | 31,329 |
A longer piece of content needs more modules, and so a higher version. If you print two codes at the same width, the one with the higher version has smaller modules, which makes it harder to read from far away. A short link is therefore a good thing: it keeps the grid small and the modules large.
What is inside a QR code
Not every module carries your content. Some of them form fixed shapes that help a scanner find the code and read it correctly:
- Finder patterns: the three large squares in three of the corners. Each is 7 × 7 modules, with a white separator one module wide between it and the rest of the code.
- Timing patterns: lines that run between the finder patterns.
- Alignment patterns: one or more smaller squares, present from version 2 upwards.
- Format information: records the error-correction level and the mask pattern that were used.
- Version information: included from version 7 upwards.
The remaining modules hold the content itself and the extra data that protects it. The page on how QR codes work goes through each of these parts.
Why a damaged code can still scan
QR codes use Reed–Solomon error correction. Along with your content, the code stores extra data calculated from it. If part of the code is dirty, scratched or covered, a scanner can use that extra data to rebuild what is missing. The content is split into units called codewords, and there are four levels of protection:
| Level | Codewords it can recover (roughly) |
|---|---|
| L | 7% |
| M | 15% |
| Q | 25% |
| H | 30% |
More protection is not free. The extra data takes up room, so the same content at a higher level may need a larger version.
The white border matters
Around every QR code there should be an empty light margin, called the quiet zone. A width of 4 modules is recommended. It separates the code from whatever is printed next to it, so that a scanner can tell where the code begins. If you place a code on a poster or a package, treat the quiet zone as part of the code.
QR codes that look like pictures
A QR code does not have to be a plain black and white block. With strong error correction and careful drawing, a picture can show through while the code stays readable. That is what QR Art does, in your browser. Read how QR art works, or try it with a picture of your own.
Put your own link inside your own picture. Your image never leaves your device.
Try it