QR code glossary · Anatomy of a QR code
Alignment pattern
Definition
An alignment pattern is a small 5 × 5 module square, a dark ring around a light ring around a single dark module, placed at regular intervals inside QR codes of version 2 and above so a scanner can correct for tilt, perspective and curved surfaces.
How it works
The three finder patterns give a scanner three corners of the code. When the camera views the code at an angle, or the code is printed on a curved bottle or a wrinkled flyer, the fourth corner and the grid between them are distorted, and estimating them from three points alone is not accurate enough for a large code. Alignment patterns give the decoder extra measured reference points inside the grid, so it can map each module’s position correctly.
- Alignment patterns
Version 1 has none. Their number grows with the version, at positions listed in the standard, leaving out the three places where one would overlap a finder pattern:
| Versions | Alignment patterns |
|---|---|
| 1 | 0 |
| 2 to 6 | 1 |
| 7 to 13 | 6 |
| 14 to 20 | 13 |
| 21 to 27 | 22 |
| 28 to 34 | 33 |
| 35 to 40 | 46 |
Why it matters
Alignment patterns are why larger QR codes remain readable on packaging, curved surfaces and photos taken at an angle. Like the finder patterns, they are fixed structures rather than data, so damage to them is not something error correction is designed to repair.
This matters most for logos. In versions 7 to 13 an alignment pattern sits exactly where a centered logo goes. Decoders can often fall back on estimating the grid without it, but the code loses a reference point, which is one more reason to keep logos small and to test codes printed on curved or flexible materials at the real scanning angle.
Example
In a version 2 code (25 × 25), the single alignment pattern is centered on row 18, column 18, counting from 0 at the top left, so its center is 6 modules in from the bottom and right edges, near the corner that has no finder pattern. In version 7 (45 × 45) the centers lie on rows and columns 6, 22 and 38: nine combinations, minus the three that would land on finder patterns, gives the six patterns in the diagram above.
Related terms
- Finder patternA finder pattern is one of the three large concentric squares in the top-left, top-right and bottom-left corners of a QR code, which a scanner uses to detect the code, measure its size and angle, and work out which way up it is.
- Timing patternA timing pattern is one of two lines of alternating dark and light modules, one horizontal and one vertical, that run between a QR code’s finder patterns and let a scanner count the rows and columns and find the center of each module.
- QR code versionA QR code’s version is its size on a scale from 1 to 40: version 1 is 21 × 21 modules and each version adds 4 modules per side, up to 177 × 177 at version 40, so a version V code is 17 + 4V modules across.
- Logo in a QR codeA logo in a QR code is an image placed over part of the pattern, usually the center, which works because Reed–Solomon error correction can rebuild the modules the logo hides, provided the logo stays within the correction budget and clear of the finder patterns.
- ModuleA module is a single square cell of a QR code, either dark or light, and the basic unit of the symbol: each one is a bit of data or part of a fixed pattern, and the printed width of one module decides how far away the code can be read.
Learn more
- QR codes on packaging: Printing codes on curved and flexible surfaces.
- QR code error correction: How big a logo can safely be.
Sources
Last updated . Written by the CirculateQR team; technical facts follow the sources listed above. Example codes and sizes are computed with the open-source qrcode encoder that CirculateQR uses. Spotted something wrong? Email support@circulateqr.com. QR Code is a registered trademark of DENSO WAVE INCORPORATED.
← Browse the full glossary