GS1 DataMatrix is a 2D matrix barcode that uses the same Application Identifier (AI) structure as GS1-128 , but encodes the data in a compact square or rectangular grid of black and white cells instead of a linear series of bars. A FNC1 character in the first position signals that the contents follow GS1 standards.
Because it is a 2D symbol, GS1 DataMatrix can encode far more data in a much smaller space than GS1-128. This makes it the barcode of choice wherever space is limited, printing resolution is constrained, or the item itself must be directly marked - such as surgical instruments, electronic components, and pharmaceutical vials.
Used for: Pharmaceutical serialisation (EU FMD, US DSCSA), medical device UDI, fresh food traceability, direct part marking (DPM) on metal and plastic, and any application where a compact, high-density barcode is required.
Application Identifiers
GS1 DataMatrix uses the same Application Identifier system as GS1-128. A typical pharmaceutical DataMatrix encodes AI (01) GTIN + AI (21) serial number + AI (17) expiry date + AI (10) batch/lot - the four fields required by most serialisation regulations. The table below lists key AIs and their EPC equivalents – see the full AI reference for the complete list.
GS1 DataMatrix and EPC/RFID tags carry the same logical data - they differ only in the physical carrier. A DataMatrix encoding AI (01) GTIN + AI (21) serial number contains exactly the same identification as an SGTIN EPC tag. In pharmaceutical supply chains, both technologies may coexist on the same package: the DataMatrix for visual verification and the RFID tag for automated, line-of-sight-free reading.
As with GS1-128 , some AIs such as (10) Batch/Lot and (17) Expiry date have no dedicated EPC field. When these values must travel with the RFID tag, they are typically written to the tag's user memory bank or linked through a backend database keyed by the EPC.
The compact size of GS1 DataMatrix makes it especially relevant for item-level serialisation - the same granularity at which RFID operates. Both technologies answer the question "which specific unit is this?" rather than merely "what product type is this?"
Where GS1 DataMatrix is used
Pharmaceuticals - mandatory under the EU Falsified Medicines Directive (FMD) and the US Drug Supply Chain Security Act (DSCSA). Each saleable unit carries a DataMatrix encoding GTIN + serial + expiry + batch.
Medical devices (UDI) - the US FDA and EU MDR require a Unique Device Identifier on device labels, frequently encoded as a GS1 DataMatrix.
Fresh food - variable-weight items with GTIN, batch, and use-by date encoded in a small 2D symbol on the label.
Direct part marking (DPM) - laser-etched or dot-peened DataMatrix codes on metal parts, surgical instruments, and electronic components for lifetime traceability.
Retail and e-commerce - increasingly used on small consumer goods where a traditional barcode would be too large.
GS1 DataMatrix is ECC 200 Data Matrix with one constraint: the first data codeword is FNC1 (Function Code 1), signalling that the payload follows GS1 Application Identifier rules. Strip the FNC1 and the same cells decode as an ordinary Data Matrix symbol.
Inside the data stream, FNC1 also serves as a separator between variable-length AIs (such as (10) Batch/Lot or (21) Serial), just as in GS1-128.
Symbol structure
A Data Matrix ECC 200 symbol is built from three layers placed on a square (or rectangular) grid of modules. The standard square sizes range from 10×10 to 144×144 in steps of 2.
Finder pattern - the L pattern: two solid edges of dark modules along the left and bottom of each data region. Used by the scanner to locate the symbol and determine its orientation.
Clock track: the top and right edges of each data region, alternating dark and light modules. Used by the scanner to count rows and columns and lock onto the module grid.
Data region(s): the interior cells between the finder/clock borders, carrying the encoded data and Reed-Solomon error-correction codewords. Sizes 32×32 and above split the interior into multiple data regions, each with its own L + clock border - this keeps the clock track close to every data module to maintain decodability on warped surfaces.
Quiet zone: at least 1× X-dimension of clear space on all four sides - one of the smallest quiet-zone requirements of any 2D symbology.
Square symbol sizes
ECC 200 also defines six rectangular sizes (8×18 up to 16×48); the table below covers the 14 square sizes that account for ~99% of production GS1 DataMatrix labels. Data codewords carry the encoded payload; error-correction codewords are Reed-Solomon parity that can recover from smudges, damage or DPM marking defects. Numeric capacity assumes pure-digit ASCII compaction; alphanumeric capacity assumes mixed ASCII.
Symbol size
Data codewords
EC codewords
Capacity (digits)
Capacity (ASCII)
10×10
3
5
6
3
12×12
5
7
10
6
14×14
8
10
16
10
16×16
12
12
24
16
18×18
18
14
36
25
20×20
22
18
44
31
22×22
30
20
60
43
24×24
36
24
72
52
26×26
44
28
88
64
32×32
62
36
124
91
36×36
86
42
172
127
40×40
114
48
228
169
44×44
144
56
288
214
48×48
174
68
348
259
Source: ISO/IEC 16022:2006 Annex C, cross-checked against the canonical encoder tables in @rfid-me/epc-parser (DM_SIZES in src/barcode/encoders/datamatrix-tables.ts).
Encoding pipeline (ECC 200)
ECC 200 encoding turns a payload string into a placed module grid through four well-defined stages:
Compaction - pack the payload into 8-bit data codewords using one or more of the ECC 200 compaction modes: ASCII (default), C40 (efficient for uppercase + digits), Text (lowercase biased), X12 (EDI character set), EDIFACT, and Base-256 (for binary). For GS1 DataMatrix the stream begins with the FNC1 codeword (value 232) and stays in ASCII mode for typical AI payloads.
Padding - append PAD codewords (using the standard pad-codeword randomiser) to fill the data region of the chosen symbol size.
Reed-Solomon - generate n EC codewords over GF(256) with primitive polynomial 0x12D. For symbol sizes above 26×26, the data + EC stream is interleaved across multiple RS blocks so a localised defect spans fewer codewords per block.
Placement - map each 8-bit codeword onto the symbol's module grid using the Annex M "utah" placement algorithm: codewords occupy L-shaped tiles that snake diagonally across the data region, with explicit corner cases at the four corners of the matrix.
Error correction
ECC 200 always uses a fixed amount of Reed-Solomon parity for each symbol size (no user-selectable level). The number of EC codewords (see the table) lets the scanner recover from up to n/2 codeword erasures or roughly n/2 fully corrupt codewords. In practice this gives ~25–30% byte-level recovery, which is what allows DataMatrix to keep decoding under DPM conditions where individual cells are missing or filled-in.
The same Reed-Solomon code over GF(256) is shared with QR Code; the difference is the primitive polynomial (0x12D for DataMatrix, 0x11D for QR) and the block-interleaving rules.
X-dimension and quiet zone
GS1 General Specifications set the printed X-dimension for GS1 DataMatrix at 0.255–0.495 mm for retail use, with finer values (down to 0.100 mm for DPM) permitted in healthcare and DPM. Quiet zones are 1× X on all four sides - the same minimum used by ECC 200 itself.