How QR codes work

By Yin-Chi Chan and Claude Opus

  1. Parts of a QR code

    The fixed patterns, the format and version information, and the data area.

  2. Format and version information

    Error correction levels, mask patterns, and the BCH and Golay codes that protect them.

  3. Encoding the data

    Turning text into bits with the numeric, alphanumeric, byte and kanji modes.

  4. Arithmetic on bytes

    GF(2⁸), where bytes can be added, multiplied and divided, the basis of Reed-Solomon codes.

  5. Reed-Solomon codes

    Calculating the error correction bytes, recovering damaged data, and interleaving the blocks.

  6. Placing the data

    The zigzag path through the data area, and choosing a mask pattern.

Full interactive demo: make a QR code, damage it, and see whether it can still be read.