Skip to content

Encoding & Structure

What is Module?

By CodexEngr, QR Systems Engineer · Last reviewed: 2026-10-19

The smallest single square unit of a QR code matrix, representing one binary bit — dark for 1, light for 0.

A module is the fundamental atomic unit of a QR code symbol. Every QR code is constructed from a square grid of modules, where each module represents exactly one binary digit: a dark (filled) module encodes a logical 1, and a light (empty) module encodes a logical 0.

The physical size of a module — denoted Wx in technical literature — directly determines both the printable dimensions of the QR code symbol and its minimum scanning distance. The relationship is straightforward: a Version 1 QR code contains a 21×21 module grid (441 modules total), while a Version 40 QR code expands to a 177×177 grid (31,329 modules total). As the version number increases, the total number of modules grows quadratically, increasing both data capacity and the physical size of the printed symbol at any given module width.

Module Width and Print Sizing

For reliable scanning by smartphone cameras, ISO/IEC 18004 specifies a minimum module width of 0.25mm, though practical engineering practice establishes 0.35mm as the realistic minimum for standard CMOS sensors in good lighting. The recommended minimum for commercial printing applications is 0.50mm per module.

The total printed symbol width can be calculated as: Symbol Width = (Number of Modules per Row) × (Module Width)

For a Version 5 QR code (37 modules across) printed at a module width of 0.5mm: Symbol Width = 37 × 0.5mm = 18.5mm

Adding the mandatory 4-module quiet zone on each side (4 × 2 sides × 0.5mm = 4mm per side): Total Print Area Width = 18.5mm + 4mm + 4mm = 26.5mm

Functional vs Data Modules

Not all modules in a QR code encode user data. The symbol contains two distinct regions:

  1. Functional Pattern Modules: The three finder patterns (7×7 each), timing tracks, separators, and alignment patterns consume a fixed number of modules that scale with version. These modules carry no encoded data — they serve as optical reference markers for the scanner.
  1. Data and Error Correction Modules: The remaining modules encode the user's data codewords interleaved with Reed-Solomon parity codewords.

At higher QR versions, functional patterns occupy a smaller fraction of total modules, improving encoding efficiency. In Version 1, functional patterns consume approximately 36% of available modules; in Version 40, they represent only about 9%.

Module Reflectance and Contrast

The optical effectiveness of a module depends on its reflectance differential from the background. ISO/IEC 18004 requires the absolute difference in reflectance between dark modules (Rmin) and light modules (Rmax) to satisfy: Rmax - Rmin ≥ 0.50 × Rmax

In practical terms, for white paper (Rmax ≈ 0.90), dark modules must have reflectance below 0.45 — easily achieved with standard black ink on coated paper. Problems arise when using colored inks, metallic substrates, or printing dark modules on dark-colored packaging.

Diagram description: Grid showing a 7×7 finder pattern with individual modules labeled dark/light, alongside a zoomed module with Wx dimension annotation and reflectance scale.

Frequently asked questions

What is the minimum module size for a QR code to be scannable?

ISO/IEC 18004 specifies an absolute minimum of 0.25mm per module, but practical scanning reliability begins at 0.35mm for good lighting conditions. For commercial print production, use a minimum of 0.50mm per module.

Do dark modules always represent 1 and light modules represent 0?

In the raw bit stream, yes — dark = 1 and light = 0. However, after data masking is applied (one of 8 XOR patterns), some bits are flipped. The physical module colors are the post-masking representation, not the raw data bits.

How do I calculate the printed size of a QR code from its modules?

Multiply the modules per side — 21 + 4 × (version − 1) — by your module width, then add 8 module-widths for the quiet zone (4 per side). A Version 5 code (37 modules) at 0.5 mm modules needs 22.5 mm total.

Sources

Related terms

Related tools