What the Corner Squares of a QR Code Do

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.

VersionModules per sideAlignment patterns
1210
2 to 625 to 411
7 to 1345 to 696
14 to 2073 to 9713
21 to 27101 to 12522
28 to 34129 to 15333
35 to 40157 to 17746

Format information and version information

The decoding settings themselves are written around the finders.

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 areaWhat happensRecoverable by error correction?
Finder patternThe 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 zoneThe 1:1:3:1:1 ratio is broken and detection tends to fail. The code visually merges with its background.No
Timing patternGrid boundaries drift, causing more misreads and failures the larger the version.No
Alignment patternLittle effect on a flat surface, but codes on curved surfaces or shot at an angle suddenly stop reading.No
Format informationUp to 3 bit errors are correctable, and a second copy exists, so damage to one copy is tolerable.Partly
Data regionRecoverable up to the amount allowed by the error correction level.Yes
Triage tip: if pointing a camera at the code produces no reaction at all, suspect the corners and the margin first. That is a failure to locate the symbol, which is a different problem from a dirty data region. If the code is recognised for an instant but yields no result, suspect data damage beyond the correction capacity instead.
Free Tool Inspect the structure with QR Code Analyzer Analyse a QR code image for its version, error correction level, mask pattern and stored data.

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

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.

← Back to Tech Blog