ISO/IEC 18004:2024
(Main)Information technology — Automatic identification and data capture techniques — QR code bar code symbology specification
Information technology — Automatic identification and data capture techniques — QR code bar code symbology specification
This document specifies requirements for the symbology known as “QR code”. It specifies the QR code symbology characteristics, data character encoding methods, symbol formats, dimensional characteristics, error correction rules, reference decoding algorithm, production quality requirements and user-selectable application parameters.
Technologies de l'information — Technologie d'identification automatique et de capture des données — Spécification de la symbologie de code à barres code QR
General Information
Relations
Standards Content (Sample)
International
Standard
ISO/IEC 18004
Fourth edition
Information technology —
2024-08
Automatic identification and data
capture techniques — QR code bar
code symbology specification
Technologies de l'information — Technologie d'identification
automatique et de capture des données — Spécification de la
symbologie de code à barres code QR
Reference number
© ISO/IEC 2024
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on
the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below
or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
© ISO/IEC 2024 – All rights reserved
ii
Contents Page
Foreword .vi
Introduction .vii
1 Scope . 1
2 Normative references . 1
3 Terms and definitions . 1
4 Mathematical and logical symbols, abbreviated terms and conventions . 3
4.1 Mathematical and logical symbols.3
4.2 Abbreviated terms .3
4.3 Conventions .4
4.3.1 Module positions .4
4.3.2 Byte notation .4
4.3.3 Version references.4
5 Symbol description. 4
5.1 Basic characteristics .4
5.2 Summary of additional features .5
5.3 Symbol structure .6
5.3.1 General .6
5.3.2 Symbol versions and sizes .8
5.3.3 Finder pattern .14
5.3.4 Separator . 15
5.3.5 Timing pattern . 15
5.3.6 Alignment patterns . 15
5.3.7 Encoding region . 15
5.3.8 Quiet zone . 15
6 Conformance .16
7 Requirements .16
7.1 Encode procedure overview . .16
7.1.1 General .16
7.1.2 Step 1: Data analysis .16
7.1.3 Step 2: Data encoding .16
7.1.4 Step 3: Error correction coding .16
7.1.5 Step 4: Structure final message .16
7.1.6 Step 5: Module placement in matrix .17
7.1.7 Step 6: Data masking .17
7.1.8 Step 7: Format and version information .17
7.2 Data analysis .18
7.3 Modes .18
7.3.1 General .18
7.3.2 Extended channel interpretation mode .18
7.3.3 Numeric mode .19
7.3.4 Alphanumeric mode .19
7.3.5 Byte mode .19
7.3.6 Kanji mode .19
7.3.7 Mixing modes .19
7.3.8 Structured append mode . 20
7.4 Data encoding . 20
7.4.1 FNC1 mode . 20
7.4.2 Sequence of data . 20
7.4.3 Extended channel interpretation mode .21
7.4.4 Numeric mode . 23
7.4.5 Alphanumeric mode .24
7.4.6 Byte mode . 25
© ISO/IEC 2024 – All rights reserved
iii
7.4.7 Kanji mode . 26
7.4.8 Mixing modes .27
7.4.9 FNC1 modes .27
7.4.10 Terminator . 29
7.4.11 Bit stream to codeword conversion . 29
7.5 Error correction . 33
7.5.1 Error correction capacity . 33
7.5.2 Generating the error correction codewords . 40
7.6 Constructing the final message codeword sequence .41
7.7 Codeword placement in matrix.42
7.7.1 Symbol character representation.42
7.7.2 Function pattern placement .42
7.7.3 Symbol character placement .43
7.8 Data masking . 46
7.8.1 General . 46
7.8.2 Data mask patterns . 46
7.8.3 Evaluation of data masking results . 49
7.9 Format information .51
7.9.1 QR code symbols . .51
7.9.2 Micro QR code symbols .52
7.10 Version information . 54
8 Structured append .55
8.1 Basic principles . 55
8.2 Symbol sequence indicator . 56
8.3 Parity data . 56
9 Symbol printing and marking.57
9.1 Dimensions .57
9.2 Human-readable interpretation . .57
9.3 Marking guidelines .57
10 Symbol quality .57
10.1 Methodology .57
10.2 Symbol quality parameters . 58
10.2.1 Fixed pattern damage . 58
10.2.2 Scan grade and overall symbol grade . 58
10.2.3 Grid non-uniformity . 58
10.2.4 Print growth . 58
10.3 Process control measurements . 58
11 Decoding procedure overview .58
12 Reference decode algorithm for QR code .59
13 Autodiscrimination capability .67
14 Transmitted data . 67
14.1 General principles .67
14.2 Symbology identifier .67
14.3 Extended channel interpretations .67
14.4 FNC1 mode . 68
Annex A (normative) Error detection and correction generator polynomials .69
Annex B (normative) Error correction decoding steps .72
Annex C (normative) Format information . 74
Annex D (normative) Version information . 76
Annex E (normative) Position of alignment patterns .78
Annex F (normative) Symbology identifier .80
Annex G (normative) QR code print quality — Symbology-specific aspects .81
© ISO/IEC 2024 – All rights reserved
iv
Annex H (informative) JIS8 and shift JIS character sets .87
Annex I (informative) Symbol encoding examples .89
Annex J (informative) Optimisation of bit stream length .94
Annex K (informative) User guidelines for printing and scanning of QR code symbols .103
Annex L (informative) Autodiscrimination.105
Annex M (informative) Process control techniques .106
Annex N (informative) Characteristics of model 1 symbols .107
Bibliography .110
© ISO/IEC 2024 – All rights reserved
v
Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are
members of ISO or IEC participate in the development of International Standards through technical
committees established by the respective organization to deal with particular fields of technical activity.
ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations,
governmental and non-governmental, in liaison with ISO and IEC, also take part in the work.
The procedures used to develop this document and those intended for its further maintenance are described
in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for the different types
of document should be noted. This document was drafted in accordance with the editorial rules of the ISO/
IEC Directives, Part 2 (see www.iso.org/directives or www.iec.ch/members_experts/refdocs).
ISO and IEC draw attention to the possibility that the implementation of this document may involve the
use of (a) patent(s). ISO and IEC take no position concerning the evidence, validity or applicability of any
claimed patent rights in respect thereof. As of the date of publication of this document, ISO and IEC had not
received notice of (a) patent(s) which may be required to implement this document. However, implementers
are cautioned that this may not represent the latest information, which may be obtained from the patent
database available at www.iso.org/patents and https://patents.iec.ch. ISO and IEC shall not be held
responsible for identifying any or all such patent rights.
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and expressions
related to conformity assessment, as well as information about ISO’s adherence to the World Trade
Organization (WTO) principles in the Technical Barriers to Trade (TBT) see www.iso.org/iso/foreword.html.
In the IEC, see www.iec.ch/understanding-standards.
This document was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 31, Automatic identification and data capture techniques.
This fourth edition cancels and replaces the third edition (ISO/IEC 18004:2015), which has been technically
revised.
The main changes are as follows:
— continuous grading according to ISO/IEC 15415 has been adopted for grade fixed pattern damage;
— the reference decoding algorithm has been clarified.
Any feedback or questions on this document should be directed to the user’s national standards
body. A complete listing of these bodies can be found at www.iso.org/members.html and
www.iec.ch/national-committees.
© ISO/IEC 2024 – All rights reserved
vi
Introduction
There are four technically different, but closely related members of the QR code family, which represent an
evolutionary sequence.
[21]
— QR code model 1 is the original specification for QR code and is described in AIM ITS 97-001 .
— QR code model 2 is an enhanced form of the symbology with additional features (primarily, the addition
of alignment patterns to assist navigation in larger symbols) and is the basis of the first edition of this
document (i.e. ISO/IEC 18004:2000).
— QR code [the basis of the second edition of this document (i.e. ISO/IEC 18004:2006)] is very similar to
QR code model 2; its QR code format differs only in the addition of the facility for symbols to appear in
a mirror image orientation for reflectance reversal (light symbols on dark backgrounds) and the option
for specifying alternative character is set to the default.
— The micro QR code format [also specified in the second edition of this document (i.e. ISO/IEC 18004:2006)],
is a variant of QR code with a reduced number of overhead modules and a restricted range of sizes, which
enables small to moderate amount of data to be represented in a small symbol, particularly suited to
direct marking on parts and components, and to applications where the space available for the symbol is
severely restricted.
QR code is a matrix symbology. The symbols consist of an array of nominally square modules arranged
in an overall square pattern, including a unique finder pattern located at three corners of the symbol (in
micro QR code symbols, at a single corner) and intended to assist in easy location of its position, size and
inclination. A wide range of sizes of symbol is provided for, together with four levels of error correction.
Module dimensions are user-specific to enable symbol production by a wide variety of techniques.
QR code model 2 symbols are fully compatible with QR code reading systems.
QR code model 1 symbols are recommended only to be used in closed system applications. Equipment
complying with this document are not required to support QR code model 1 symbols. Since QR code is the
recommended model for new, open system application of QR code, this document describes QR code fully.
This document also lists the features in which QR code model 1 differs from QR code in Annex N.
© ISO/IEC 2024 – All rights reserved
vii
International Standard ISO/IEC 18004:2024(en)
Information technology — Automatic identification and
data capture techniques — QR code bar code symbology
specification
1 Scope
This document specifies requirements for the symbology known as “QR code”. It specifies the QR code
symbology characteristics, data character encoding methods, symbol formats, dimensional characteristics,
error correction rules, reference decoding algorithm, production quality requirements and user-selectable
application parameters.
2 Normative references
The following documents are referred to in the text in such a way that some or all of their content constitutes
requirements of this document. For dated references, only the edition cited applies. For undated references,
the latest edition of the referenced document (including any amendments) applies.
ISO/IEC 15415, Information technology — Automatic identification and data capture techniques — Bar code
symbol print quality test specification — Two-dimensional symbols
1)
ISO/IEC 15424:— , Information technology — Automatic identification and data capture techniques — Data
Carrier Identifiers (including Symbology Identifiers)
ISO/IEC 19762, Information technology — Automatic identification and data capture (AIDC) techniques —
Harmonized vocabulary
3 Terms and definitions
For the purposes of this document, the terms and definitions given in ISO/IEC 19762 and the following apply.
ISO and IEC maintain terminology databases for use in standardization at the following addresses:
— ISO Online browsing platform: available at https:// www .iso .org/ obp
— IEC Electropedia: available at https:// www .electropedia .org/
3.1
character count indicator
bit sequence which defines the data string length in a mode (3.10)
3.2
data masking
process of XORing the bit pattern in the encoding region (3.4) with a data mask pattern to provide a symbol
with more evenly balanced numbers of dark and light modules, and reduced occurrence of patterns which
would interfere with fast processing of the image
3.3
data mask pattern reference
3-bit identifier of the data masking (3.2) patterns applied to the symbol
1) Under preparation. Stage at the time of publication: ISO/IEC DIS 15424:2024.
© ISO/IEC 2024 – All rights reserved
3.4
encoding region
region of the symbol not occupied by function patterns (3.8) and available for encoding data and error
correction codewords, and for version (3.20) and format information (3.7)
3.5
exclusive subset
subset of characters within the character set of a mode (3.10) which are not shared with the more restricted
character set of another mode
3.6
extension pattern
function pattern (3.8) in model 1 symbols, which does not encode data
3.7
format information
encoded pattern containing information on symbol characteristics essential to enable the remainder of the
encoding region (3.4) to be decoded
3.8
function pattern
overhead component of the symbol (finder, separator (3.16), timing patterns (3.19) and alignment patterns)
required for location of the symbol or identification of its characteristics to assist in decoding
3.9
masking
process of XORing the bit pattern in an area of the symbol with a mask pattern to reduce the occurrence of
patterns which would interfere with fast processing of the image
3.10
mode
method of representing a defined character set as a bit string
3.11
mode indicator
1-bit to 4-bit identifier (depending on symbol size) indicating in which mode (3.10) the following data
sequence is encoded
3.12
padding bit
zero bit, not representing data, used to fill empty positions of the final codeword after the terminator (3.18)
in a data bit string
3.13
remainder bit
zero bit, not representing data, used to fill empty positions of the symbol encoding region (3.4) after the final
symbol character, where the area of the encoding region available for symbol characters does not divide
exactly into 8-bit symbol characters
3.14
remainder codeword
pad codeword, placed after the error correction codewords, used to fill empty codeword positions to
complete the symbol if the total number of data and error correction codewords does not exactly fill its
nominal capacity
3.15
segment
sequence of data encoded according to the rules of one extended channel interpretation or encoding mode
© ISO/IEC 2024 – All rights reserved
3.16
separator
function pattern (3.8) of all light modules, one module wide, separating the finder patterns from the rest of
the symbol
3.17
symbol number
3-bit field indicating the symbol version (3.20) and error correction level applied, used as part of the format
information (3.7) in micro QR code symbols
3.18
terminator
bit pattern of defined number (depending on the symbol) of all zero bits used to end the bit string
representing data
3.19
timing pattern
alternating sequence of dark and light modules enabling module coordinates in the symbol to be determined
3.20
version
size of the symbol represented in terms of its position in the sequence of permissible sizes for micro QR code
symbols from 11 × 11 modules (version M1) to 17 × 17 modules (version M4) or, for QR code symbols, from
21 × 21 modules (version 1) to 177 × 177 (version 40) modules
Note 1 to entry: The error correction level applied to the symbol can be suffixed to the version designation, e.g. version
4-L or version M3-Q.
3.21
version information
encoded pattern in certain QR code symbols containing information on symbol version (3.20) together with
error correction bits for this data
4 Mathematical and logical symbols, abbreviated terms and conventions
4.1 Mathematical and logical symbols
div integer division operator
mod integer remainder after division
XOR exclusive-or logic function whose output is one only when its two inputs are not equivalent
NOTE XOR is represented by the symbol ⊕.
4.2 Abbreviated terms
BCH Bose-Chaudhuri-Hocquenghem
DPM direct part mark
ECI extended channel interpretation
FNC1 function 1 symbol character
RS Reed-Solomon
© ISO/IEC 2024 – All rights reserved
4.3 Conventions
4.3.1 Module positions
For ease of reference, module positions are defined by their row and column coordinates in the symbol, in the
form (i, j) where i designates the row (counting from the top downwards) and j the column (counting from
left to right) in which the module is located, with counting commencing at 0. The module (0, 0) is therefore
located at the upper left corner of the symbol.
4.3.2 Byte notation
Byte content is shown as a hex value.
4.3.3 Version references
For QR code symbols, symbol versions are referred to in the form version V-E where V identifies the version
number (1 to 40) and E indicates the error correction level (L, M, Q, H).
For micro QR code symbols, symbol versions are referred to in the form version MV-E where the letter M
indicates the micro QR code format, V identifies the version number (with a range of 1 to 4) and E indicates
the error correction level (with values L, M and Q).
5 Symbol description
5.1 Basic characteristics
QR code is a matrix symbology with the following characteristics:
a) Formats:
1) QR code, with full range of capabilities and maximum data capacity;
2) micro QR code, with reduced overhead, some restrictions on capabilities and reduced data capacity
(compared with QR code symbols).
b) Encodable character set:
1) numeric data (digits 0 - 9);
2) alphanumeric data (digits 0 - 9; upper case letters A - Z; nine other characters: space, $ % * + - . /: );
3) byte data [default: ISO/IEC 8859-1; or other sets as otherwise defined (see 7.3.5)];
4) Kanji characters (Kanji characters in QR code can be compacted into 13 bits).
c) Representation of data: a dark module is nominally a binary one and a light module is nominally a binary
zero. However, see 5.2 for details of reflectance reversal.
d) Symbol size (not including quiet zone):
1) for micro QR code symbols: 11 × 11 modules to 17 × 17 modules (versions M1 to M4, increasing in
steps of two modules per side);
2) for QR code symbols: 21 × 21 modules to 177 × 177 modules (versions 1 to 40, increasing in steps of
four modules per side).
e) Data characters per symbol:
1) maximum micro QR code symbol size, version M4-L:
— numeric data: 35 characters;
© ISO/IEC 2024 – All rights reserved
— alphanumeric data: 21 characters;
— byte data: 15 characters;
— Kanji data: 9 characters;
2) maximum QR code symbol size, version 40-L:
— numeric data: 7 089 characters;
— alphanumeric data: 4 296 characters;
— byte data: 2 953 characters;
— Kanji data: 1 817 characters.
f) Selectable error correction: four levels of Reed-Solomon error correction (referred to as L, M, Q and H in
increasing order of capacity) allowing the symbol codeword recovery of
— L: 7 %;
— M: 15 %;
— Q: 25 %;
— H: 30 %.
For micro QR code symbols, error correction level H is not available. For version M1 micro QR code
symbols, the RS capacity is limited to error detection only.
g) Code type: matrix.
h) Orientation independence: yes (both rotation and reflection).
Figure 1 illustrates a version 1 QR code symbol in normal colour and with reflectance reversal (see 5.2), in
both normal and mirror image orientations.
Figure 2 illustrates a version M2 micro QR code symbol in normal colour and with reflectance reversal (see
5.2), in both normal and mirror image orientations.
5.2 Summary of additional features
The use of the following additional features is optional in QR code.
— Structured append: This allows files of data to be represented logically and continuously in up to 16
QR code symbols. These can be scanned in any sequence to enable the original data to be correctly
reconstructed. Structured append is not available with micro QR code symbols.
— Extended channel interpretations: This mechanism enables data using character sets other than the
default encodable set (e.g. Arabic, Cyrillic, Greek) and other data interpretations (e.g. compacted data
using defined compression schemes) or other industry-specific requirements to be encoded. ECIs other
than the default interpretation are not available in micro QR code symbols.
— Reflectance reversal: Symbols are intended to be read when marked so that the image is either dark on
light or light on dark (see Figures 1 and 2). The specifications in this document are based on dark images
on a light background, therefore in the case of symbols produced with reflectance reversal references to
dark or light modules should be taken as references to light or dark modules respectively.
— Mirror imaging: The arrangement of modules defined in this document represents the "normal"
orientation of the symbol. It is, however, possible to achieve a valid decode of a symbol in which the
arrangement of the modules has been laterally transposed. When viewed with the finder patterns in
the top left, top right and bottom left corners of the symbol, mirror imaging interchanges the row and
column positions of the modules.
© ISO/IEC 2024 – All rights reserved
a) Normal orientation b) Normal orientation c) Mirror image orientation d) Mirror image orientation
and normal reflectance and reversed and normal reflectance and reversed
arrangement reflectances arrangement reflectances
NOTE The corner marks indicate the extent of the quiet zone.
Figure 1 — Examples of a QR code symbol encoding the text "QR code Symbol"
a) Normal orientation b) Normal orientation c) Mirror image orientation d) Mirror image orientation
and normal reflectance and reversed and normal reflectance and reversed
arrangement reflectances arrangement reflectances
NOTE The corner marks indicate the extent of the quiet zone.
Figure 2 — Examples of a version M2 micro QR code symbol encoding the text "01234567"
5.3 Symbol structure
5.3.1 General
Each QR code symbol shall be constructed of nominally square modules set out in a regular square array
and shall consist of an encoding region and function patterns, namely finder, separator, timing patterns
and alignment patterns. Function patterns do not encode data. The symbol shall be surrounded on all four
sides by a quiet zone border. Figure 3 illustrates the structure of a version 7 symbol. Figure 4 illustrates the
structure of a version M3 symbol.
© ISO/IEC 2024 – All rights reserved
Key
A quiet zone F format information
B finder pattern G version information
C separator H data and error correction codewords
D timing patterns I function patterns
E alignment patterns J encoding region
Figure 3 — Structure of a QR code symbol
Key
A finder pattern quiet zone E quiet zone
B timing patterns F separator
C format information G timing pattern
D encoding region
Figure 4 — Structure of a version M3 micro QR code symbol
© ISO/IEC 2024 – All rights reserved
5.3.2 Symbol versions and sizes
5.3.2.1 QR code symbols
There are 40 sizes of QR code symbol referred to as version 1, version 2 . version 40. Version 1 measures
21 × 21 modules, version 2 measures 25 × 25 modules and so on, increasing in steps of 4 modules per side up
to version 40 which measures 177 × 177 modules. Figures 5 to 10 illustrate the structure of versions 1, 2, 6,
7, 14, 21 and 40.
a) Version 1 b) Version 2
Key
data and error correction codewords 1 21 modules
format information and its error correction code 2 5 modules
remainder bits 3 25 modules
4 9 modules
Figure 5 — Versions 1 and 2 symbols
© ISO/IEC 2024 – All rights reserved
Key
data and error correction codewords 1 41 modules
format information and its error correction code 2 25 modules
remainder bits
Figure 6 — Version 6 symbol
© ISO/IEC 2024 – All rights reserved
Key
Da
format information and its error correction code 2 29 modules
version information and its error correction code
Figure 7 — Version 7 symbol
© ISO/IEC 2024 – All rights reserved
Key
data and error correction codewords 1 73 modules
format information and its error correction code 2 57 modules
version information and its error correction code
remainder bits
Figure 8 — Version 14 symbol
© ISO/IEC 2024 – All rights reserved
Key
1 101 modules
data and error correction codewords
2 85 modules
format information and its error correction code
version information and its error correction code
remainder bits
Figure 9 — Version 21 symbol
© ISO/IEC 2024 – All rights reserved
Key
1 177 modules
data and error correction codewords
2 161 modules
format information and its error correction code
version information and its error correction code
Figure 10 — Version 40 symbol
5.3.2.2 Micro QR code symbols
There are four sizes of micro QR code symbol, referred to as versions M1 to M4. Version M1 measures 11 × 11
modules, version M2 measures 13 × 13 modules, version M3 measures 15 × 15 modules and version M4
measures 17 × 17 modules, i.e.
...








Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.
Loading comments...