# Alignment pattern

> Alignment patterns are the small 5 × 5 concentric squares scattered through larger QR codes. They let a scanner correct for perspective distortion when the code is curved, tilted or photographed at an angle.

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

---

## When they appear

Version 1 has none. Version 2 adds one. The count grows with version, reaching 46 at
version 40. Their positions are defined by a table in ISO/IEC 18004, not by a formula —
which is why a from-scratch encoder needs the table.

| Version | Alignment patterns |
|---|---|
| 1 | 0 |
| 2–6 | 1 |
| 7–13 | 6 |
| 14–20 | 13 |
| 21–27 | 22 |
| 28–34 | 33 |
| 35–40 | 46 |

## Why they exist

Without them, a scanner has only the three corners to establish geometry, and any
non-linear distortion — a code on a bottle, a photograph taken at 40° — accumulates error
toward the middle of the pattern. Alignment patterns give the decoder local reference
points to resample against.

This is the practical reason a large code on a curved surface still scans while a small
one on the same curve does not: the large one has alignment patterns to correct with.
