Spec & internals
Finder patterns — how a scanner locates a QR code
Finder patterns are the 7×7 concentric squares in three corners of a QR code: a 3×3 dark centre, a light ring, and a dark ring. Any straight line through the centre crosses dark and light in a 1:1:3:1:1 ratio, so a scanner can find the code at any rotation.
The structure
Each finder pattern (the standard calls them position detection patterns) is 7 × 7 modules:
- a 3 × 3 dark centre,
- a 1-module light ring around it,
- a 1-module dark ring around that.
Read across the middle and the widths are 1 : 1 : 3 : 1 : 1 — one dark, one light, three dark, one light, one dark. A one-module light separator then isolates the whole pattern from the data region, so the finder plus separator occupies an 8 × 8 corner zone.
At version 1, the three finders alone are 147 of 441 modules — exactly one third of the symbol. Location comes before data.
Why the ratio is rotation-invariant
The clever part is geometric: any straight line through the centre of concentric squares crosses the rings in the same 1:1:3:1:1 proportion — horizontal, vertical, or at 40 degrees. A scanner does not need to find squares at all. It streams pixel rows looking for runs of dark and light in that ratio, checks the candidate in the perpendicular direction, and it has found a centre. That works whatever the rotation, which is why you can scan a poster upside down.
The ratio is also deliberately rare in real imagery and in the code's own data — the mask penalty rules charge a heavy 40-point penalty for accidental 1:1:3:1:1 runs in the data region, precisely so false finders do not appear.
Why exactly three
Three points determine position, rotation and scale. With finders at top-left, top-right and bottom-left, the missing fourth corner tells the decoder which way is up: the corner without a finder is always bottom-right. A fourth finder would add no orientation information and would cost another 64-module corner. (The fourth corner's job of handling perspective distortion goes to the cheaper 5 × 5 alignment patterns instead.)
What finder patterns will not survive
Reed–Solomon error correction protects only the data region. Cover one finder and the code is gone at any error-correction level, because the scanner never gets far enough to use the redundancy. This is the hard rule behind logo placement: centre is negotiable, corners are not. It is also why a sticker, staple or fold across a corner is so much worse than the same damage in the middle — see scanning a damaged code.
Styling the finders ("custom eyes") is a partial exception: decoders tolerate rounded or reshaped eyes as long as the concentric dark-light-dark structure and its proportions survive in a thresholded camera image. Hollow eyes, gradients that cross the rings, or low-contrast eye colours break the ratio and the code with it. Always decode-verify a styled code before shipping — try it.
FAQ
What are the three squares in the corners of a QR code for?
They are finder patterns that let a scanner locate the code and determine its orientation. Any line through their centre crosses dark and light modules in a 1:1:3:1:1 ratio, which software can detect at any rotation angle.
Why do QR codes have three squares and not four?
Three points are enough to fix position, rotation and scale, and the empty fourth corner itself signals orientation. Perspective correction is handled by smaller 5×5 alignment patterns, which cost far fewer modules than a fourth finder would.
Can a QR code work with a damaged finder pattern?
Usually not. Error correction only protects the data region, so a covered or heavily damaged finder prevents the scanner from locating the code at all. Minor edge damage sometimes survives because detection needs the ratio, not pixel perfection.
Can you change the shape of the corner squares?
Within limits. Rounded or restyled eyes scan when the concentric dark-centre, light-ring, dark-ring structure and its 1:1:3:1:1 proportions are preserved after thresholding. Test the result with a real decoder before printing.
Try it — free, no signup
Related
- QR code anatomy — every region of the symbol — A labelled tour of a QR code: finder patterns, separators, timing, alignment, format and version information, the data region and the quiet zone.
- Timing patterns — the ruler inside every QR code — The alternating dark-light lines in row 6 and column 6 tell a decoder the module pitch and count, so it can place its sampling grid before reading data.
- Alignment patterns — the small squares that fix distortion — 5×5 alignment patterns anchor the decoder's sampling grid. Version 1 has none; the count grows to 46 at version 40, at positions fixed by ISO/IEC 18004.
- Custom QR code eye shapes — what survives detection — QR eyes can be square, rounded, circle, leaf or diamond. What the 1:1:3:1:1 detection ratio allows, and the risk order of the common variants.