A 5×5 concentric-square marker placed in a grid across larger QR symbols (Version 2 and up) that corrects local warping, letting scanners read codes printed on curved, tilted, or uneven surfaces.
Alignment patterns are the smaller concentric squares — 5 modules by 5 modules — that appear scattered across the interior of larger QR codes. While finder patterns handle global positioning (where is the code, which way is up), alignment patterns handle local distortion: the subtle warping that occurs when a QR code is printed on a curved bottle, photographed at a steep angle, or stuck to a slightly wrinkled label.
How distortion breaks the sampling grid
A QR decoder works by overlaying an ideal square grid on the camera image and sampling the center of each grid cell. On a perfectly flat code photographed straight-on, one global grid fits the whole symbol. But on a curved surface — a coffee cup, a pipe, a rounded product package — the modules near the edges are compressed relative to the center. A single global grid no longer matches reality: sample points drift off the true module centers, and the decode error rate climbs steeply.
Alignment patterns solve this by providing local anchor points. The decoder locates each 5×5 pattern in the image, compares its observed position against the ideal grid, and computes a local correction for the surrounding region. In effect, the symbol is divided into sub-regions, each calibrated independently — a piecewise correction that tracks the curvature of the surface.
Placement follows a lookup table
Unlike finder patterns, which sit at three fixed corners, alignment pattern centers are positioned according to a version-dependent lookup table defined in the specification. A Version 2 symbol carries a single alignment pattern near the bottom-right; as the version grows, the patterns form an expanding grid, reaching seven positions along each axis at Version 40. Positions that would overlap the finder patterns or their separators are omitted. This scaling is deliberate: larger symbols cover more physical area and therefore encounter more distortion, so they need denser correction coverage.
Structure: a miniature finder
Each alignment pattern is a 5×5 module structure with the same concentric logic as a finder pattern: a dark 5×5 outer square, a light 3×3 ring, and a single dark center module. The 1:1:1:1:1-ish cross-section through the center gives the vision algorithm a distinctive signature to hunt for, similar in spirit to the finder pattern's 1:1:3:1:1 ratio but smaller and unambiguous at its scale. The single dark center module is the precise anchor point the decoder uses for its local grid correction.
Design and print implications
Because alignment patterns are functional patterns, they must never be covered by logos, recolored to low contrast, or absorbed into decorative styling. A common failure mode in "designer QR codes" is a logo or graphic that overlaps an alignment pattern near the center of the symbol; the code may still scan head-on in good light but fails the moment it is photographed at an angle, because the decoder has lost the local reference it needs for that region. When evaluating a styled QR code, check that every alignment pattern — not just the three big finders — remains crisp and high-contrast.
Diagram description: Version 7 QR code with all six alignment patterns circled, plus an inset showing a code on a curved bottle where the decoder uses nearby alignment patterns to correct the warped sampling grid.
