A QR Code (Quick Response Code) is a two-dimensional matrix barcode that stores data in a grid of black and white modules. Originally developed by Denso Wave in 1994 for automotive parts tracking, QR codes have become ubiquitous because any smartphone camera can read them.
QR codes can encode up to 7,089 numeric characters or 4,296 alphanumeric characters, and they include Reed-Solomon error correction that allows them to be read even when partially damaged. For GS1 supply chain applications, the most important development is the GS1 Digital Link - a standard that structures GS1 identifiers as web URLs inside a QR code.
Used for: Consumer engagement (product information, marketing), supply chain traceability, retail point-of-sale (via GS1 Digital Link), authentication, and serialisation.
GS1 Digital Link
GS1 Digital Link is a standard that encodes GS1 identifiers as structured web URLs. Instead of carrying a raw number like a traditional barcode, a Digital Link QR code contains a URL where the path segments map directly to GS1 Application Identifiers (AIs).
URL format
https://id.gs1.org/01/09520123456788/21/ABC123
Resolver domain /01/ = AI (01) GTIN /21/ = AI (21) Serial
The path segments /01/ and /21/ correspond to the same Application Identifiers used in GS1-128 barcodes. This means a GS1 Digital Link URL carries the same structured data as a traditional barcode - but in a format that is also a valid web address.
This dual nature is the key innovation:
A standard QR reader (any smartphone) opens the URL, which can resolve to a product page, nutritional information, recall notices, or marketing content - enabling direct consumer engagement.
A GS1-aware POS scanner parses the URL structure and extracts the GTIN , serial number, batch, and other AIs - functioning exactly like scanning a traditional barcode at retail checkout.
How QR Code / Digital Link relates to EPC/RFID
A GS1 Digital Link QR code and an EPC RFID tag can carry the same underlying identifiers. The GTIN and serial number encoded in a Digital Link URL map directly to the fields in SGTIN EPC schemes.
Digital Link element
EPC equivalent
/01/{GTIN}
GTIN field in SGTIN-96 or SGTIN-198 (company prefix + item reference)
/21/{serial}
Serial number field in SGTIN-96 (numeric) or SGTIN-198 (alphanumeric)
/00/{SSCC}
SSCC-96 EPC scheme - identifies a logistics unit
/414/{GLN}
SGLN-96 EPC scheme - identifies a location
In supply chains that use both technologies, a product might carry a GS1 Digital Link QR code on its consumer-facing label and an SGTIN EPC tag on its RFID inlay - both encoding the same GTIN and serial number, serving different read scenarios.
Sunrise 2027
GS1 Sunrise 2027 is a global initiative positioning GS1 Digital Link QR codes as the eventual successor to traditional EAN/UPC barcodes at retail point of sale. By 2027, GS1 expects retailers worldwide to be able to accept 2D barcodes - including Digital Link QR codes - at checkout.
The transition does not mean EAN/UPC barcodes will disappear overnight. Instead, Sunrise 2027 establishes 2D readiness as a baseline expectation: POS systems should be capable of reading both legacy 1D barcodes and new 2D symbols. Over time, brands can migrate to QR codes that serve a dual function - marketing and supply chain in a single symbol - rather than printing separate barcodes and QR codes on the same package.
For RFID-enabled supply chains, this convergence is significant. As the same GS1 identifiers flow through Digital Link QR codes, GS1-128 barcodes, and EPC RFID tags, the three technologies become interoperable views of the same data.
Where QR Code / Digital Link is used
Consumer engagement: Product pages, how-to videos, ingredient transparency, sustainability information, and loyalty programmes - all accessible with a smartphone scan.
Retail POS (Sunrise 2027): As retailers upgrade to 2D-capable scanners, Digital Link QR codes will replace or supplement traditional EAN/UPC barcodes at checkout.
Traceability: Encoding batch, lot, and serial data in the URL enables farm-to-fork and pharmaceutical track-and-trace without requiring specialised scanning hardware.
Authentication: Serialised Digital Link QR codes can be verified against a cloud database to detect counterfeits.
Healthcare: Pharmaceutical packaging increasingly uses 2D barcodes for serialisation under regulations like the EU Falsified Medicines Directive and US DSCSA.
QR Code (Model 2, the universal version) defines 40 versions. Each version is a fixed-size square; the module count per side grows linearly from version 1 (21 modules) to version 40 (177 modules):
modules_per_side = 21 + 4 × (version - 1)
The Annex 1 Micro QR variant defines its own four smaller sizes (M1–M4: 11×11 to 17×17) that do not follow this formula and are encoded differently - see the Micro QR page for details.
Symbol structure
Every QR Code is composed of fixed function patterns plus the variable data region:
Finder patterns - three nested 7×7 concentric squares placed in the top-left, top-right, and bottom-left corners. They have a distinctive 1:1:3:1:1 dark-to-light ratio when scanned through their centre line, which the decoder uses to locate the symbol and determine its rotation.
Separators - a single-module-wide light border around each finder pattern.
Alignment patterns - 5×5 concentric squares placed at fixed coordinates that depend on the version. Version 1 has none; version 2 has one (centred at module (18,18)); higher versions add a grid of alignment patterns. They let the decoder correct for perspective distortion when the symbol is photographed off-axis.
Timing patterns - one row and one column of alternating dark/light modules running between the finder patterns at row 6 and column 6. The decoder uses them to count modules across the symbol regardless of physical size.
Format information - a 15-bit BCH-encoded value duplicated in two places around the finder patterns, declaring the error-correction level (L/M/Q/H) and the mask pattern applied to the data region.
Version information - an 18-bit BCH-encoded value carried in two locations for versions 7–40; versions 1–6 derive their version from the module count alone.
Data and EC modules - everything else. Encoded payload + Reed-Solomon error-correction codewords, placed into the remaining modules by an interleave/zig-zag rule.
Quiet zone - ≥ 4× X-dimension on all four sides. Notably larger than the 1× quiet zone of Data Matrix.
Capacity by version
Pick a version below to see its module count, total codewords, and maximum payload at each error-correction level for all three character-set modes. Toggle the full 40-version table underneath to compare versions side-by-side.
Size37×37modules
Total codewords134data + EC
Mode
L (~7%)
M (~15%)
Q (~25%)
H (~30%)
Numeric (digits)
255
202
144
106
Alphanumeric (chars)
154
122
87
64
Byte (bytes)
106
84
60
44
Show all 40 versions (Byte-mode capacity)
Version
Modules
Total CW
Byte capacity by EC level
L
M
Q
H
1
21×21
26
17
14
11
7
2
25×25
44
32
26
20
14
3
29×29
70
53
42
32
24
4
33×33
100
78
62
46
34
5
37×37
134
106
84
60
44
6
41×41
172
134
106
74
58
7
45×45
196
154
122
86
64
8
49×49
242
192
152
108
84
9
53×53
292
230
180
130
98
10
57×57
346
271
213
151
119
11
61×61
404
321
251
177
137
12
65×65
466
367
287
203
155
13
69×69
532
425
331
241
177
14
73×73
581
458
362
258
194
15
77×77
655
520
412
292
220
16
81×81
733
586
450
322
250
17
85×85
815
644
504
364
280
18
89×89
901
718
560
394
310
19
93×93
991
792
624
442
338
20
97×97
1085
858
666
482
382
21
101×101
1156
929
711
509
403
22
105×105
1258
1003
779
565
439
23
109×109
1364
1091
857
611
461
24
113×113
1474
1171
911
661
511
25
117×117
1588
1273
997
715
535
26
121×121
1706
1367
1059
751
593
27
125×125
1828
1465
1125
805
625
28
129×129
1921
1528
1190
868
658
29
133×133
2051
1628
1264
908
698
30
137×137
2185
1732
1370
982
742
31
141×141
2323
1840
1452
1030
790
32
145×145
2465
1952
1538
1112
842
33
149×149
2611
2068
1628
1168
898
34
153×153
2761
2188
1722
1228
958
35
157×157
2876
2303
1809
1283
983
36
161×161
3034
2431
1911
1351
1051
37
165×165
3196
2563
1989
1423
1093
38
169×169
3362
2699
2099
1499
1139
39
173×173
3532
2809
2213
1579
1219
40
177×177
3706
2953
2331
1663
1273
Source: ISO/IEC 18004:2015 Table 7 (capacity per mode and EC level) and Table 9 (codewords + block structure), cross-checked against the canonical encoder tables in @rfid-me/epc-parser (VERSION_EC_TABLE / BYTE_CAPACITY in src/barcode/encoders/qr-tables.ts; epc-parser ships exact tables for versions 1–10).
Encoding modes
The data stream is split into one or more segments, each prefixed by a 4-bit mode indicator and a character-count field. Switching modes mid-stream is supported and is used by encoders to minimise the total bit length.
Mode
Indicator
Density
Notes
Numeric
0001
10 bits / 3 digits
"012345" → 3 digits + 3 digits = 20 bits
Alphanumeric
0010
11 bits / 2 chars
ASCII subset: 0-9, A-Z, space, $%*+-./:
Byte (ISO-8859-1)
0100
8 bits / byte
Default for GS1 Digital Link URLs and arbitrary ASCII/UTF-8 payloads
Kanji
1000
13 bits / glyph
Shift JIS double-byte characters
ECI (Extended Channel Interpretation)
0111
+ 8-24 bits
Switches charset (UTF-8 etc.) for the following Byte-mode segment
FNC1 (GS1 mode)
0101
+ 0 bits
Marks the symbol as a GS1 QR Code; FNC1 inside the stream also separates variable-length AIs
GS1 Digital Link payloads (HTTPS URLs) are encoded in Byte mode. The FNC1 mode indicator (0101) at the start of the symbol switches the decoder to GS1 QR Code behaviour, where the data stream is interpreted as concatenated GS1 Application Identifiers (the same payload model as GS1-128 and GS1 DataMatrix). A QR symbol can carry GS1 data either as a Digital Link URL (Byte mode) or as raw AIs (FNC1 mode) - both are valid and both decode to the same logical AI set.
Error correction
QR Code uses Reed-Solomon error correction (see the Reed-Solomon guide for how the algorithm computes parity symbols and recovers from damage). The codeword arithmetic happens in the Galois field GF(256) with primitive polynomial 0x11D - the same field as Data Matrix uses, but with a different polynomial (Data Matrix: 0x12D). A codeword in this context is the 8-bit unit - one symbol of the Reed-Solomon code - that the data region is broken into.
Four user-selectable error-correction levels trade payload capacity for damage tolerance:
L (Low) - ~7% of codewords recoverable
M (Medium) - ~15%
Q (Quartile) - ~25%
H (High) - ~30%
For larger versions the data + EC stream is split into one or more blocks (independent Reed-Solomon code words) and the bytes from each block are interleaved before placement - byte 0 of block 1, byte 0 of block 2, byte 1 of block 1, byte 1 of block 2, etc. Interleaving spreads any localised defect (a coffee stain, a finger smudge, a torn label edge) across fewer codewords per block, so each block stays inside its individual recovery threshold. Block parameters are version- and EC-level-specific - ISO/IEC 18004 Table 9 lists all 160 combinations.
Data masking
After encoding and Reed-Solomon, the data region is XORed with one of eight fixed mask patterns (mask 000 through 111). Each mask is a fixed black-and-white grid defined by a Boolean formula over the module's row (i) and column (j) coordinates - modules whose coordinates satisfy the formula are flipped.
Masking has nothing to do with security or scrambling: it exists to break up unfortunate coincidences in the bit pattern that would confuse a scanner - for example, a long horizontal run of dark modules, or a fragment that happens to look like a finder pattern (the 1:1:3:1:1 ratio). The chosen mask index is recorded in the 3-bit mask portion of the format information field (a 15-bit BCH-encoded value carried twice around the finder patterns - see "Symbol structure" above).
The eight mask patterns
Mask
Format bits
Condition for module (i, j) to be flipped
Visual character
0
000
(i + j) mod 2 = 0
Diagonal stripes; toggles every other module along both axes.
1
001
i mod 2 = 0
Horizontal stripes every other row.
2
010
j mod 3 = 0
Vertical stripes every third column.
3
011
(i + j) mod 3 = 0
Diagonal stripes every third module.
4
100
(⌊i ÷ 2⌋ + ⌊j ÷ 3⌋) mod 2 = 0
Coarse 2×3 checkerboard.
5
101
(i × j) mod 2 + (i × j) mod 3 = 0
Sparse dots concentrated near the origin.
6
110
((i × j) mod 2 + (i × j) mod 3) mod 2 = 0
Denser variant of mask 5.
7
111
((i + j) mod 2 + (i × j) mod 3) mod 2 = 0
Mixed diagonal and product pattern.
Source: ISO/IEC 18004:2015 §7.8.2 Table 10. i is the row and j is the column, both numbered from 0 at the top-left of the symbol. ⌊x⌋ means floor (integer division).
Penalty score (mask selection)
The encoder applies each of the eight masks in turn, scores the result against four penalty rules, sums the four rule scores, and picks the mask with the lowest total. The four rules each target a different scan-failure mode:
Rule
Penalty
Detects
Why it matters
N1
3 + i
Runs of same-coloured modules
For every horizontal or vertical run of 5 + i consecutive same-coloured modules, add 3 + i points. Discourages long bars or stripes that confuse a scan-line decoder.
N2
3
2×2 same-coloured blocks
For every 2×2 region of same-coloured modules, add 3 points. Discourages large solid patches that defeat the alignment/timing patterns.
N3
40
Finder-like patterns in the data
For every 1:1:3:1:1 dark/light ratio in a row or column (with 4 light modules on either side), add 40 points. Prevents false-positive finder patterns inside the data region.
N4
10 × k
Imbalance of dark vs light modules
Compute the percentage of dark modules across the whole symbol; k is the number of 5%-steps that percentage deviates from 50%. Add 10 × k points. Aims for a ~50/50 dark/light balance, which scans most reliably.
Source: ISO/IEC 18004:2015 §7.8.3.1. The encoder evaluates the sum N1 + N2 + N3 + N4 for each of the eight masks (so eight totals) and writes the index of the lowest-scoring mask into the format information field.
X-dimension and quiet zone
GS1 Sunrise 2027 sets the minimum X-dimension for retail-POS scanning at 0.396 mm with up to 0.991 mm for general distribution; healthcare DPM applications permit smaller. The 4× quiet zone on each side is mandatory - reducing it below 4× causes intermittent decode failure even when print quality is otherwise fine.
Key standards
The base QR Code symbology is defined by ISO/IEC 18004 - its Annex 1 covers the compact Micro QR variant used when the standard symbol is too large for the available label area.