The large squares in the corners of a QR code are called finder patterns, and readers use them to locate the symbol and work out its orientation. Why are there three rather than four, and which damage makes a code fail to be recognised at all? This article walks through the function patterns with a colour-coded diagram of a real symbol.
A QR code is function patterns plus a data region
Not every dark and light square (module) in a QR code is data. Function patterns are placed first so that a reader can locate the symbol and split it into the correct grid; the data and error correction codewords fill whatever is left.
The key point is that function patterns are not covered by error correction. Reed-Solomon protects only the codewords in the data region, so a crushed corner square cannot be reconstructed by computation. That is why "a QR code still reads with 30% missing" does not hold everywhere on the symbol.
Demo: which module does what
A version 7 QR code is generated in your browser with its modules coloured by role. Solid colour marks modules that are actually dark; the pale tint marks light modules belonging to the same region. Note how the data region (dark navy) takes up most of the symbol.
Finder patterns: the three corner squares
The most conspicuous concentric squares are the finder patterns. Each is 7x7 modules, nested as a 3x3 dark core, a 5x5 light ring around it and a 7x7 dark ring outside that.
The 1:1:3:1:1 ratio
That nesting is deliberate. Draw a straight line through the centre of a finder pattern at any angle and the widths of dark, light, dark, light, dark come out as 1:1:3:1:1. A reader scans the image horizontally and vertically looking for runs that match this ratio, and that is how it finds the symbol. Because the test is a ratio, it is independent of the code's physical size or on-screen resolution and still works when the code is rotated.
Why three corners and not four
The fourth corner is left empty to fix the orientation. Once three finders are located, two perpendicular edges define the symbol's frame, and the corner without a finder is the bottom right. With four finders, 90-degree rotations would be indistinguishable and the code could be read upside down. That asymmetry is why a phone reads a QR code even when you hold it the wrong way up.
Separators and the quiet zone
A one-module light band, the separator, runs along the inner sides of every finder. Without it, dark modules from the data region could touch the finder, breaking the 1:1:3:1:1 ratio and defeating detection.
For the same reason the symbol needs a quiet zone of at least four modules all around it. If surrounding artwork or a logo is allowed to touch the code, the width of the outer dark ring cannot be measured correctly and detection itself fails. This is a very common cause of scanning problems.
Timing patterns: the ruler for the grid
Between the top-left and top-right finders (row 6) and between the top-left and bottom-left finders (column 6) runs a line of alternating dark and light modules. This is the timing pattern, and counting it tells the reader how many modules there are per side and how many image pixels one module spans.
Locating the finders fixes the outline but not where each grid line falls inside it. The larger the version, and thus the finer the grid, the more small errors accumulate and shift the grid. The timing pattern acts as the reference line that keeps it aligned.
Alignment patterns: correcting distortion
From version 2 onward the symbol also contains alignment patterns: 5x5 modules with a dark outer ring, a light ring inside it and a single dark module at the centre. They look like small finder patterns but serve a different purpose, namely compensating for a distorted surface.
On a bottle, a paper bag or in a photo taken at an angle, the code does not appear as a plain rectangle. Because alignment patterns sit at defined coordinates within the symbol, the reader can estimate the distortion from where they actually appear and redraw the grid accordingly. Higher versions carry more of them because a finer grid is more sensitive to local distortion.
| Version | Modules per side | Alignment patterns |
|---|---|---|
| 1 | 21 | 0 |
| 2 to 6 | 25 to 41 | 1 |
| 7 to 13 | 45 to 69 | 6 |
| 14 to 20 | 73 to 97 | 13 |
| 21 to 27 | 101 to 125 | 22 |
| 28 to 34 | 129 to 153 | 33 |
| 35 to 40 | 157 to 177 | 46 |
Format information and version information
The decoding settings themselves are written around the finders.
- Format information: the error correction level and the mask pattern number. The same content appears twice, once wrapped around the top-left finder and once split between the top-right and bottom-left areas.
- Version information: the version number. It is present only from version 7 upward, in two blocks, one to the left of the top-right finder and one above the bottom-left finder. Versions 6 and below omit it because counting the timing pattern is enough.
How to actually read the error correction level is covered in How to Check a QR Code's Error Correction Level.
What breaks when each part is damaged
"Position detection is off" covers several different failures depending on which part was damaged. Use this as a triage guide.
| Damaged area | What happens | Recoverable by error correction? |
|---|---|---|
| Finder pattern | The symbol is never detected as a QR code at all. Pointing a camera at it does nothing. | No (function patterns are not covered) |
| Separator / quiet zone | The 1:1:3:1:1 ratio is broken and detection tends to fail. The code visually merges with its background. | No |
| Timing pattern | Grid boundaries drift, causing more misreads and failures the larger the version. | No |
| Alignment pattern | Little effect on a flat surface, but codes on curved surfaces or shot at an angle suddenly stop reading. | No |
| Format information | Up to 3 bit errors are correctable, and a second copy exists, so damage to one copy is tolerable. | Partly |
| Data region | Recoverable up to the amount allowed by the error correction level. | Yes |
If the corners are blurred in a photograph, enhancing the image first sometimes makes it decodable. See How to Restore an Unreadable QR Code from a Photo for the steps, and Why Your QR Code Won't Scan and How to Fix It for cause-by-cause fixes.
Summary
- The three corner squares are finder patterns, built so that any scan line through them gives 1:1:3:1:1, which is how the code is located.
- There are three rather than four so that the orientation, and thus which corner is bottom right, is unambiguous.
- Timing patterns are the ruler for the module grid; alignment patterns correct distortion on curved or angled surfaces.
- Function patterns are not covered by error correction, so damaged corners or margins mean the code is never detected in the first place.
- Triage a scanning failure by asking whether the code was detected at all, or detected but not recovered.
Frequently Asked Questions
What are the three squares in the corners of a QR code?
They are the finder patterns. Each is a 7x7 nested structure, and a straight line drawn through the centre at any angle gives dark, light, dark, light, dark in the width ratio 1:1:3:1:1. Readers search for that ratio to locate the code.
Why are there three finder patterns instead of four?
To make the orientation unambiguous. Once three are located the frame of the symbol is fixed and the corner without a finder is known to be the bottom right. With four, rotations in 90-degree steps would be indistinguishable.
Can error correction recover a QR code with a damaged finder pattern?
No. Reed-Solomon protects only the codewords in the data region; function patterns such as the finder patterns are not covered by error correction. If the corners are damaged, the symbol is never detected as a QR code in the first place.
What is the alignment pattern for?
It compensates for a distorted surface. Because alignment patterns sit at defined coordinates within the symbol, a reader can estimate the distortion from where they actually appear on a curved surface or in an angled photo and redraw the grid. They appear from version 2 onward, and higher versions contain more of them.