Glossary
Codeword
A codeword is one 8-bit byte in a QR code's data stream. Capacity tables are ultimately expressed in codewords: a version-1 code holds 26 of them, split between data and error correction.
Data versus error-correction codewords
Every version has a fixed total codeword count. The error-correction level decides how that total is split.
| Version 1 | Total | Data | Error correction |
|---|---|---|---|
| L | 26 | 19 | 7 |
| M | 26 | 16 | 10 |
| Q | 26 | 13 | 13 |
| H | 26 | 9 | 17 |
At level H, a version-1 code spends nearly two thirds of its capacity on redundancy. That is the cost of 30% damage tolerance.
Remainder bits
Some versions have a few leftover bits after the codewords are placed — 7 bits at versions 2–6, for example. They are set to zero and ignored.
Related
- Reed–Solomon coding — Reed–Solomon is the error-correcting code that lets a damaged QR code still decode. It adds redundant codewords so that a decoder can reconstruct the…
- Interleaving — Interleaving is the reordering of QR code data so that consecutive codewords come from different error-correction blocks. It spreads localised physical…
- Data capacity — Data capacity is how much a QR code can hold, and it depends on three things at once: the version, the error-correction level and the encoding mode. The…