Specifications¶
QR Code Specifications¶
QR Code Definition¶
A QR code is a square array of dark and light dots. One dot (or module) represents one bit of information.
QR codes contain various types of data and can be of different models, versions and levels. They always contain a message, metadata about alignment, a size, a format and error correction bits. They comply with the international standard ISO/IEC 18004 (1, 2 and 2005).
QR Code Structure¶
The QR code symbol consists of:
An encoding region that contains the data and error correction codewords.
Function patterns that contain the symbol metadata and the position data.
A QR code must be structured with the following elements:
Quiet zone: a blank margin around the QR code
Finder patterns: recognizable zones identifying a QR code
Extension patterns: markers for the alignment of the QR code (model 1)
Alignment patterns: markers for the alignment of the QR code (models 2 and 2005)
Timing patterns: data giving the module size (in pixels)
Format information: zones providing the QR code level
Version information: data giving the QR code size, for instance 25 x 25 modules (models 2 and 2005)
Data content and error correction codewords: the primary information carried by the symbol, with additional information for error correction
Variants of this structure exist, according to the model, format or version of the QR code. For instance, model 1 QR codes do not feature alignment patterns but extension patterns. Micro QR codes include only one finder pattern and no alignment pattern.
Structure of a model 1 QR code symbol¶
Structure of a QR code 2005 symbol¶
Structure of a Micro QR code symbol¶
QR Code Subtypes¶
A QR code can be one of the following subtypes:
Basic: The default subtype.
ECI (Extended Channel Interpretation): The ECI subtype provides a consistent method to embed interpretation information of data in the QR code. The ECI protocol is defined in the AIM Inc. International Technical Specification. (ECI is not available for Micro QR code symbols.)
GS1: The data contained in the QR code are formatted according to the GS1 General Specification.
AIM: The data contained in the QR code are formatted according to a specific industry application previously agreed with AIM Inc. The application indicator value is embedded in the QR code data.
Data Types¶
The QR code data can be any mix of these types:
Numeric data (0-9)
Alphanumeric data (0-9, A-Z, /, $, %…)
Byte data (possibly ECI-encoded)
Kanji characters
Byte Data Interpretation¶
In a QR code, the byte data can represent any information. Their interpretation depends on the subtype of the QR code:
Basic subtype:
If some byte data are present in the QR code, you need to know how to interpret them.
Use the
EByteInterpretationMode.NET Python enum to select the corresponding byte interpretation mode (see the retrieving decoded data section in Retrieve and Interpret the Read Data for more details).
ECI-encoded byte data:
The ECI subtype provides an ECI table indicator.
This indicator defines the character set to use to interpret the byte data.
EasyQRCode currently supports the UTF8 conversion table (ECI table indicator 26).
Models, Versions and Levels¶
Models (Standards)¶
Model 1: original QR code international standard, with versions ranging from 1 to 14.
Note that the “version” of a QR code is the symbol size (in number of modules). It does not relate to the version of the standard, which is called the “model”.
Model 2: improvement of model 1. It provides versions from 1 to 40. It defines alignment patterns to improve the reading of distorted QR codes or QR codes printed on curved surfaces.
Model 2005: improvement of model 2, including white-on-black QR codes and mirror symbol orientation.
Micro QR codes: smaller QR codes to save printing space, from version M1 to version M4.
Versions (Symbol Size)¶
QR codes: from version 1 (21 x 21 modules) to version 40 (177 x 177 modules), with an increment of 4 x 4 modules (version 2: 25 x 25 modules, version 3: 29 x 29 modules, …, version 39: 173 x 173 modules).
Micro QR codes: version M1 (11 x 11 modules), version M2 (13 x 13 modules), version M3 (15 x 15 modules), version M4 (17 x 17 modules).
Left: micro QR code, version M3, 15 x 15 modules
Center: model 2 QR code, version 4, 33 x 33 modules, 67-114 characters
Right: model 2 QR code, version 40, 177 x 177 modules, 1852-4296 characters¶
Levels (Error Correction)¶
QR codes contain error correction data. The standard offers the following levels of error correction:
L (low): about 7% of codewords can be restored
M (medium): 15%
Q (quality): 25%
H (high): 30% (not available for Micro QR codes)
For Micro QR code symbols, the available error correction levels depend on the version:
M1 has only error detection
M2 and M3 support L and M levels
M4 supports L, M and Q levels
EasyQRCode Specifications¶
The QR code reader scans the image and searches for 3 finder patterns that could match a QR code, with the following requirements:
Minimum quiet zone width: 3 pixels
Minimum module size: 3 x 3 pixels
Minimum isotropy: 0.5
Maximum corner deformation: 15° (corner angles can range from 75° to 105°)