What is GS1 DataMatrix?
DataMatrix is a 2D barcode made of square modules. GS1 DataMatrix is DataMatrix ECC 200 whose first character is FNC1, which tells the scanner that the content follows GS1 rules: a sequence of application identifiers (AIs), each followed by its data. Thanks to error correction, it stays readable even when partly damaged, and it holds a lot of data in a few millimetres — ideal for small packs.
The application identifiers you will use most
| AI | Data | Format |
|---|---|---|
| (01) | GTIN — product identification | 14 digits, fixed |
| (17) | Expiry date | YYMMDD, fixed |
| (10) | Batch / lot number | up to 20 characters, variable |
| (21) | Serial number | up to 20 characters, variable |
| (11) | Production date | YYMMDD, fixed |
| (15) | Best before date | YYMMDD, fixed |
Example for a product with GTIN 03456789012340, expiry 31 December 2027, batch A12B and serial number SN0001:
(01)03456789012340(17)271231(10)A12B(21)SN0001
The parentheses are only used in the human-readable text. In the symbol, the data is FNC1 01 03456789012340 17 271231 10 A12B GS 21 SN0001.
Separators and element order
Fixed-length fields such as (01) and (17) do not need a separator: the scanner knows where they end. Variable-length fields such as (10) and (21) need a GS separator when they are followed by another field. Best practice:
- put fixed-length fields first: (01), (17), (11)…;
- put variable-length fields last: (10), then (21);
- never add a separator after the last field.
A missing or extra separator is the most common GS1 DataMatrix error: the code scans, but the receiving system reads the wrong batch or serial number. Let your label software generate separators from the AI structure instead of typing them.
Pharmaceutical serialisation
In the European Union, the Falsified Medicines Directive (Delegated Regulation (EU) 2016/161) requires a unique identifier carried by a 2D DataMatrix on most prescription medicines: product code, serial number, batch number and expiry date, plus a national reimbursement number where required. The same data is usually printed in human-readable form next to the code. Other regions have their own serialisation rules, and medical devices use unique device identification (UDI) schemes for which GS1 is one of the issuing agencies.
Printing a readable GS1 DataMatrix
- Module size: choose it according to the scanners and the printer resolution — at 203 dpi a module of 2 or 3 dots is a minimum, higher resolutions (300 or 600 dpi) allow smaller symbols.
- Quiet zone: keep a clear margin of at least one module around the symbol.
- Native generation: let the printer generate the code in its own language (ZPL, DPL, Fingerprint) when possible, for sharp modules.
- Verification: grade print quality with a verifier according to ISO/IEC 15415, especially in healthcare.
- Human-readable text: print the element strings with parentheses near the symbol.
Generating GS1 DataMatrix automatically
Batch, expiry and serial number change constantly, so GS1 DataMatrix codes must be generated from your production or ERP data. In
LabelCross Print, the GS1 DataMatrix symbology takes the AI structure (for example
[01]03456789012340[17]271231[10]A12B) bound to your variables, adds FNC1 and separators, and prints on Zebra, Honeywell or Intermec printers,
with every print recorded in the history. For pallet labels, see our SSCC and GS1-128 guide.
References: GS1 General Specifications (GS1 DataMatrix, application identifiers); GS1 DataMatrix Guideline; Commission Delegated Regulation (EU) 2016/161.
Frequently asked questions
What is the difference between DataMatrix and GS1 DataMatrix?
GS1 DataMatrix is a DataMatrix ECC 200 symbol that starts with the FNC1 character and contains GS1 element strings (application identifiers followed by data). A plain DataMatrix can contain any data.
Which data is encoded on medicine packs in the EU?
Under the EU Falsified Medicines Directive, the unique identifier includes the product code, a serial number, the batch number and the expiry date, plus a national reimbursement number where a country requires it.
Why is a separator needed?
Batch (10) and serial number (21) have variable length. When such a field is not the last one in the symbol, a GS separator (FNC1 / ASCII 29) tells the scanner where it ends.
In which order should I put the data?
Put fixed-length element strings such as (01) and (17) first and variable-length ones such as (10) and (21) last. This reduces the number of separators and the symbol size.
Can a smartphone read GS1 DataMatrix?
Many smartphone apps read DataMatrix, but production and healthcare scanning should use industrial scanners, and print quality should be checked with a verifier according to ISO/IEC 15415.