How QR codes work
By Yin-Chi Chan and Claude Opus
- Parts of a QR code
The fixed patterns, the format and version information, and the data area.
- Format and version information
Error correction levels, mask patterns, and the BCH and Golay codes that protect them.
- Encoding the data
Turning text into bits with the numeric, alphanumeric, byte and kanji modes.
- Arithmetic on bytes
GF(2⁸), where bytes can be added, multiplied and divided, the basis of Reed-Solomon codes.
- Reed-Solomon codes
Calculating the error correction bytes, recovering damaged data, and interleaving the blocks.
- 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.