# Timing patterns — the ruler inside every QR code

> Timing patterns are single lines of alternating dark and light modules running along row 6 and column 6, between the finder patterns. They give the decoder the module pitch and count — a built-in ruler for placing the sampling grid — and both ends of each line are always dark.

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

---

## Where they are

Two single-module lines of strictly alternating dark and light modules:

- **Horizontal**: row 6, running between the top-left and top-right finder separators.
- **Vertical**: column 6, running between the top-left and bottom-left finder separators.

Each line is **size − 16 modules long** — 5 modules in a version 1 symbol, 161 in a
version 40. Because the symbol side is always odd and 16 is even, the length is always odd,
which is what lets both ends be dark: the sequence starts dark, alternates, and lands dark
against each finder's separator.

## What they calibrate

A decoder that has found the three [finder patterns](/docs/spec/finder-patterns) knows the
corners but not the grid. Two questions remain:

1. **How wide is one module?** The alternation gives a direct measurement: every
   dark-light transition along the timing line is one module boundary. Averaging across
   the whole run gives the module pitch far more accurately than dividing the symbol width
   by a guessed count.
2. **How many modules — which version is this?** Counting timing modules between the
   finders reveals the symbol size directly. For versions 1–6 this count is the *only*
   in-symbol statement of the version; from version 7 the BCH-protected
   [version information](/docs/spec/version-information) provides a robust cross-check,
   and decoders trust it when the two disagree.

The timing lines also correct small errors that would compound across the symbol. A 0.5%
misestimate of module pitch is invisible over 10 modules and disastrous over 170 — the
sampling grid drifts until the decoder reads the wrong cells entirely. Regular transitions
along a known row and column keep the grid locked, with
[alignment patterns](/docs/spec/alignment-patterns) handling two-dimensional distortion
between them.

## Failure modes

Timing patterns are function patterns — **outside Reed–Solomon protection**. Typical ways
they get hurt:

- **Styling that merges modules.** Rounded and connected module styles must not bridge the
  gaps in row 6 or column 6; a fused timing line reads as one long dark run and the
  alternation is gone.
- **Logos placed off-centre** that clip column 6 — a surprisingly common slip, since column
  6 passes close to the symbol's left third, not its centre.
- **Ink spread in print** ([dot gain](/docs/print/ink-spread-and-dot-gain-in-qr-codes))
  fattening dark modules until the light gaps close. The timing lines are where fattening
  shows first, because every second module there is light by design.
- **Low resolution.** Each timing module is a single cell; there is no redundancy. If your
  raster export blurs single-module features, the whole grid calibration degrades — one
  more reason to [print from SVG](/docs/print/why-you-should-print-qr-codes-from-svg).

A code with a damaged timing line sometimes still scans — modern decoders can fall back on
interpolation between finder and alignment anchors — but tolerance is much thinner than in
the data region. Treat row 6 and column 6 as untouchable, and
[verify the final artwork decodes](/validate).

## FAQ

### What is the dotted line inside a QR code?
The timing pattern: a line of strictly alternating dark and light modules along row 6 and column 6, connecting the finder patterns. It gives the decoder the exact module width and count so it can place its sampling grid.

### Why do QR codes need timing patterns?
Because after locating the corners a decoder still needs the module pitch and the symbol size. The alternating transitions provide a measurable ruler, preventing sampling drift across large symbols, especially at versions 1–6 which carry no version information field.

### Are timing patterns protected by error correction?
No. Like all function patterns they sit outside the Reed–Solomon-protected data region. Decoders tolerate minor damage by interpolating from other anchors, but a fused or obscured timing line degrades scanning far faster than equivalent damage to data modules.

### Do both timing patterns always start and end with a dark module?
Yes. The line length is always odd (symbol size minus 16), so an alternating sequence that starts dark also ends dark, sitting against the light separator of the finder pattern at each end.

## Try it

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