Anatomy of a QR code
A QR code looks like uniform noise, but it is really half a dozen parts with completely different jobs, assembled at fixed positions. Learn which parts are fixed and the rest explains itself.
The three corner squares
Formally, finder patterns. Seven modules across, with a dark ring, a light ring and a dark core, arranged so that a scan line through the centre in any direction gives run lengths of 1:1:3:1:1. Scanners sweep the whole photo looking for that ratio.
There are three, not four, on purpose. Which corner is missing tells the decoder how the code is rotated and whether it is mirrored.
The dotted line
The timing pattern. Counting it tells the scanner how many modules the code has and how many pixels each one occupies in this particular photo. It is the ruler.
The small squares
Alignment patterns, five modules across, appearing from version 2 onward. They re-anchor the grid when the paper is curved or the photo was taken at an angle.
The strip around the top-left square
Format information: 15 bits, recorded twice in two places.
- Which error correction level was used
- Which of the eight mask patterns was applied
Everything else is data
Filling starts at the bottom-right corner and snakes upward two columns at a time, then shifts left and comes back down. That order is why the red dots in the diagram bunch along the left and right edges: the payload sits at the right end, the error correction bytes at the left, and the wide region between them is all padding.
Masking
Once the data is placed, one of eight lattice patterns is XORed across the data region. The standard scores four penalty rules and picks the most evenly mixed pattern. This site replaces that scoring with a whitest-result rule instead, and records the chosen number in the format strip as usual.
Versions and capacity
| Version | Modules | Uppercase | Mixed case |
|---|---|---|---|
| V1 | 21 | 25 | 17 |
| V2 | 25 | 47 | 32 |
| V5 | 37 | 154 | 106 |
| V7 | 45 | 224 | 154 |
| V10 | 57 | 395 | 271 |
Uppercase letters and digits switch on a dedicated mode that packs two characters into 11 bits, nearly doubling capacity. Domains are case-insensitive so that part is safe, but paths depend on the server, so check before uppercasing one.