Format information

Also called: format bits, format string

Definition

Format information is a 15-bit field in every QR code that records its error correction level and mask pattern. It is stored twice, next to the finder patterns, so a scanner can read it first.

What the 15 bits contain

The field starts with 5 data bits: 2 bits for the error correction level and 3 bits for the mask pattern number. Ten more bits of BCH error correction are added, making the code BCH(15,5).

The 15-bit result is then XORed with the fixed pattern 101010000010010. This keeps the field from ever being all light, which could confuse a reader looking for the edge of the code.

  • Error correction level bits: L = 01, M = 00, Q = 11, H = 10
  • Mask pattern: 3 bits, 000 to 111
  • Error correction: 10 BCH bits
  • Fixed XOR mask: 101010000010010

Where it is stored

One copy wraps around the top-left finder pattern, in the row and column next to its separator. The second copy is split between the area below the top-right finder and the area beside the bottom-left finder.

Two copies mean the code can still be decoded when one corner is damaged. Next to the bottom-left copy sits a single module that is always dark, called the dark module, which is not part of the data.

Why it is read first

A scanner cannot decode the data until it knows which mask to remove and how the codewords are split between data and error correction. The format information answers both questions, so it is read right after the finder patterns are located. Micro QR codes use a single 15-bit format field that also encodes the symbol version.

Frequently asked questions

Where is the error correction level stored in a QR code?

In the format information, a 15-bit field placed twice next to the finder patterns. Two of its bits give the level L, M, Q or H.

What is the single dark module near the bottom-left finder?

It is the dark module, a module the standard requires to be dark in every QR code. It sits beside the second copy of the format information and carries no data.

Sources and standards

All terms