Remainder Bits
Remainder bits are filler bits that occupy the leftover modules in a QR code's data region after every codeword has been placed. They are always set to 0 and carry no data. The international standard ISO/IEC 18004 specifies exactly how many remainder bits each version has.
Why do leftover modules exist?
QR code data is managed in 8-bit codewords, but the number of modules available for data placement (everything except function patterns such as finder patterns, plus format and version information) is not always a multiple of 8. After tiling the codewords, a fragment of fewer than 8 modules can remain, and these are filled with zeros as remainder bits. They are excluded from error correction calculations and have no effect on the decoded result.
Remainder bits by version
| Version | Remainder bits |
|---|---|
| 1 | 0 |
| 2-6 | 7 |
| 7-13 | 0 |
| 14-20 | 3 |
| 21-27 | 4 |
| 28-34 | 3 |
| 35-40 | 0 |
The count is always 0, 3, 4, or 7 because it follows mechanically from each version's module count and the layout of its function patterns. Generator libraries handle this automatically, so users rarely notice it, but it is essential knowledge when tracing a QR code's internal structure bit by bit.
How do remainder bits differ from the terminator?
Both are zero-fill, but they work at different layers. The terminator is appended to the end of the data bit stream during encoding, before error correction codewords are calculated, marking where the data ends. Remainder bits appear at the very last stage: after all data and error correction codewords have been placed as modules, they fill the leftover fragment of the region. Masking is applied to the entire encoding region, so remainder bit modules are masked as well.