# Alignment patterns — the small squares that fix distortion

> Alignment patterns are 5×5 squares — a dark outline, a light ring and a single dark centre module — that anchor the decoder's sampling grid against perspective and curvature. Version 1 has none, version 2 has one, and the count grows to 46 at version 40, at positions fixed by the standard.

Source: https://useqr.app/docs/spec/alignment-patterns · Last reviewed 2026-08-21 · UseQR is free forever, MIT licensed, no signup.

---

## The structure

An [alignment pattern](/glossary/alignment-pattern) is 5 × 5 modules: a dark outline, a
1-module light ring inside it, and a **single dark module at the centre**. It is a
miniature of the finder pattern — small enough to be cheap, distinctive enough to be found
once the decoder already knows roughly where to look.

## What they are for

The three [finder patterns](/docs/spec/finder-patterns) fix the corners, but between the
corners the decoder must guess where every module centre sits. On a flat, squarely
photographed code, linear interpolation would do. Real scans are not that: camera lenses
distort, paper curves, [labels wrap around bottles](/docs/print/qr-codes-on-cylindrical-packaging),
and phones shoot [at an angle](/docs/scanning/qr-scanning-at-an-angle).

Alignment patterns are known landmarks scattered across the interior. The decoder predicts
where each one should be, finds where it actually is, and warps its sampling grid to match
— piecewise, between each set of anchors. The bigger the symbol, the more modules sit
between the corners, the more anchors are needed.

## How many, and where

The positions come from a table in ISO/IEC 18004 (Annex E) — they are not computed by a
neat formula, though they are approximately evenly spaced between coordinate 6 and the
right edge. The full list is in the
[alignment pattern position table](/docs/reference/alignment-pattern-position-table); the
shape of the growth:

| Versions | Centre coordinates per axis | Patterns per symbol |
|---|---|---|
| 1 | — | 0 |
| 2–6 | 2 | 1 |
| 7–13 | 3 | 6 |
| 14–20 | 4 | 13 |
| 21–27 | 5 | 22 |
| 28–34 | 6 | 33 |
| 35–40 | 7 | 46 |

The count is the number of coordinate pairs minus three: with *k* coordinates per axis
there are *k*² grid intersections, but the three that would sit on top of finder patterns
are skipped. Version 7, for example, uses coordinates {6, 22, 38} on each axis — nine
intersections, minus the three finder corners, gives six patterns. **Version 40 uses
{6, 30, 58, 86, 114, 142, 170}** — 49 intersections, 46 patterns.

Version 1 gets away with none because a 21 × 21 grid is small enough to interpolate from
the finders and [timing patterns](/docs/spec/timing-patterns) alone.

## Why this matters in practice

Alignment patterns are function patterns: **not protected by error correction**. A logo or
styling element that lands on one removes a grid anchor, and the damage is worst on dense
codes photographed at an angle — exactly the scans that needed the anchor. Good generators
(including UseQR's renderer) treat alignment patterns as keep-clear zones when placing a
centre logo, and styles that redraw modules should preserve their solid 5 × 5 geometry.

This is also why very dense codes fail on curved surfaces before sparse ones do: more
modules between anchors means each anchor is doing more work. If you control the payload,
[a shorter one buys a lower version](/docs/spec/qr-code-versions-1-to-40) — fewer, better
supported modules. Then [verify the print](/validate).

## FAQ

### What is the small square inside a QR code?
An alignment pattern — a 5×5 square with a dark centre module that gives the decoder a known landmark for correcting lens distortion, curvature and perspective. Larger QR versions contain more of them, up to 46 at version 40.

### Why do some QR codes have no small square?
Version 1 codes (21×21 modules) have no alignment patterns; the symbol is small enough to sample accurately from the finder and timing patterns alone. Every version from 2 upwards has at least one.

### Where are alignment patterns placed?
At grid intersections listed in Annex E of ISO/IEC 18004 — roughly evenly spaced coordinates on each axis, with the three intersections that would overlap finder patterns omitted. The positions are fixed per version, not chosen by the generator.

### Can a logo cover an alignment pattern?
It should not. Alignment patterns are not protected by error correction, and losing one degrades grid calibration — most visibly on dense codes scanned at an angle or on curved surfaces. Keep logos clear of them and verify the result decodes.

## Try it

- https://useqr.app/url
- https://useqr.app/scan
- https://useqr.app/validate
