What Is GS1 DataMatrix? A Plain-English Guide
There is a small square barcode on the side of almost every prescription medicine pack sold in Europe. It looks like a QR code but is not one, and it carries far more than a product number. Here is what it is, what is inside it, and how to read one.
Pick up a box of prescription medicine and look at the side panel. Next to the ordinary striped barcode there is a small square of dots — usually no bigger than a fingernail. Most people assume it is a QR code. It is not. It is a GS1 DataMatrix, and unlike the barcode next to it, it does not just say what the product is. It says which individual pack you are holding, which batch it came from, and when it expires.
That distinction is why this particular symbol has quietly become mandatory across pharmaceuticals, medical devices, and a growing slice of manufacturing. This guide covers what it is, how it differs from a QR code, exactly what is encoded inside one, and how to read it yourself.
What Is GS1 DataMatrix?
A Data Matrix is a two-dimensional barcode standardised under ISO/IEC 16022. The version in use everywhere today is called ECC 200, which uses Reed–Solomon error correction so the code still reads when part of it is scratched, smudged, or printed imperfectly.
A GS1 DataMatrix is that same symbol used according to GS1 rules. The difference is not visual — you cannot tell the two apart by looking. The difference is a special character called FNC1 placed in the first position of the data. That character is a flag that tells the scanner: what follows is structured GS1 data, not free text.
This is the single most commonly missed point about the format, and it matters practically. A plain Data Matrix on an engineering part might contain PART-4471-REV-C — just a string, meaningful only to the company that printed it. A GS1 DataMatrix on a medicine carton contains a structured record that any compliant scanner anywhere in the world can break into labelled fields.
How to recognise one
A Data Matrix looks different from a QR code once you know what to look for:
- QR code: three large concentric squares in three of the four corners. These are the finder patterns.
- Data Matrix: a solid L-shaped border down two adjacent sides, with a dashed "clock track" of alternating light and dark modules along the opposite two sides.
If you see two solid edges meeting in a corner rather than three chunky squares, you are looking at a Data Matrix. For a broader tour of the formats you will meet in the wild, see our guide to the different types of barcodes.
What Is Actually Inside One
GS1 data is structured using Application Identifiers (AIs) — short numeric prefixes that announce what the next chunk of data means. A typical pharmaceutical GS1 DataMatrix contains four fields:
| AI | Meaning | Example |
|---|---|---|
| (01) | GTIN — the product identifier | 09506000134352 |
| (17) | Expiry date, always YYMMDD | 261231 |
| (10) | Batch or lot number | LOT-7 |
| (21) | Serial number — unique to this one pack | SN12345 |
Written out for humans, that record looks like (01)09506000134352(17)261231(10)LOT-7(21)SN12345.
Here is the catch that surprises everyone the first time: the brackets are not in the barcode. They are a reading convention for documentation and printed label text only. What a scanner actually hands you is:
01095060001343521726123110LOT-7<GS>21SN12345
One unbroken run of characters. The scanner can still split it correctly because GS1 defines a small, permanently fixed set of AIs whose length is predefined — AI 01 is always followed by exactly 14 digits, AI 17 by exactly 6. Fields that are not in that fixed set, such as the batch number, are variable length and must be closed with a separator character (FNC1, which scanners usually deliver as ASCII 29, the invisible Group Separator) before the next field starts.
A missing separator is the most common cause of a GS1 code decoding into nonsense: the batch number simply swallows the serial number that follows it.
Try it on a real code
If you have a pack in front of you, scan it and paste the raw string into our GS1 Barcode Decoder. It splits the string into labelled fields, recalculates the GTIN check digit, and expands the date — all in your browser, so batch and serial numbers never leave your device.
Data Matrix vs QR Code: Which One Should You Use?
Both are 2D barcodes, both hold far more than a striped barcode, and both are readable by a modern phone camera. They are optimised for different jobs.
| Data Matrix | QR Code | |
|---|---|---|
| Standard | ISO/IEC 16022 | ISO/IEC 18004 |
| Smallest symbol | 10 × 10 modules | 21 × 21 modules (version 1) |
| Finder pattern | Solid L-shape on two sides | Three corner squares |
| Error correction | Fixed, built into ECC 200 | Four selectable levels (L, M, Q, H) |
| Max numeric capacity | 3,116 digits | 7,089 digits |
| Typical reader | Industrial scanner, pharmacy terminal | Consumer phone camera |
| Best for | Tiny items, regulated data, direct part marking | Consumer-facing links, marketing, product passports |
The decisive practical difference is footprint at small payloads. Because a Data Matrix starts at a 10 × 10 grid while a QR code cannot go below 21 × 21, a Data Matrix carrying a GTIN, expiry, batch, and serial fits in noticeably less space. On a blister foil, an ampoule, a surgical instrument, or a component the size of a grain of rice, that is the whole argument.
QR codes win when a person is the scanner. They are more forgiving of awkward angles, better known to consumers, and hold much more data. If you want a shopper to reach a page, use a QR code — our barcode format comparison goes deeper on choosing between formats.
These are not mutually exclusive. Plenty of packs now carry both: a GS1 DataMatrix for the supply chain and a QR code for the customer.
Where GS1 DataMatrix Is Required
Prescription medicines in the EU
The Falsified Medicines Directive (2011/62/EU) and Delegated Regulation (EU) 2016/161 require most prescription medicine packs sold in the EU to carry a unique identifier, applied since February 2019. In practice that identifier is encoded in a GS1 DataMatrix containing the product code, a serial number, batch, and expiry date. Pharmacies scan the pack at the point of dispensing and the serial is checked against a national repository, then decommissioned so it cannot be reused.
Pharmaceuticals in the United States
The Drug Supply Chain Security Act (DSCSA) requires a product identifier on prescription drug packages carrying the product code, serial number, lot, and expiry — again typically as a 2D DataMatrix. The regulatory goals overlap with the EU scheme, but the systems are separate: a US pack and an EU pack are verified through entirely different infrastructure. In March 2026 the FDA went further, revising its drug label barcode rule to permit 2D symbols and moving the National Drug Code to twelve digits — our guide to the 12-digit NDC and 2D drug barcodes covers what changes and when.
Medical devices
Unique Device Identification schemes — the FDA UDI rule in the US and the UDI requirements under the EU Medical Device Regulation — require devices to carry a machine-readable identifier. GS1 is one of the accredited issuing agencies, and GS1 DataMatrix is the usual carrier, particularly for small or reusable instruments marked directly onto the metal.
Manufacturing and direct part marking
Outside regulated healthcare, Data Matrix dominates direct part marking, where the code is laser-etched or dot-peened straight onto a component rather than printed on a label. It survives heat, oil, and abrasion far better than a printed symbol, and reads reliably at very small sizes.
GS1 DataMatrix and Sunrise 2027
GS1 Sunrise 2027 is an industry initiative for retail point-of-sale systems to be capable of scanning 2D barcodes by the end of 2027. It is a readiness milestone rather than a single legal deadline, and it does not switch off existing striped barcodes.
For general retail checkout, the format attracting most attention is a QR code carrying a GS1 Digital Link, because the same symbol can serve a till and a shopper's phone. GS1 DataMatrix remains the practical choice where space is tight or the item is a regulated healthcare product. We cover the transition in detail in our GS1 Sunrise 2027 guide.
A related regulatory current is the EU Digital Product Passport, which will require a data carrier linking to structured product information for a widening list of categories. Different mechanism, same direction of travel: the code on the pack is becoming a pointer to a record rather than just a price lookup.
Common Mistakes
- Printing a plain Data Matrix and calling it GS1. Without FNC1 in the first position, compliant scanners will not treat the contents as GS1 data. The symbol looks identical, so this is usually caught late.
- Omitting the FNC1 separator after variable-length fields. The result decodes without an obvious error but produces a corrupted batch or serial number.
- Misreading measurement AIs. In four-digit AIs such as 3103, the last digit is the decimal position, not part of the identifier. AI 3103 with value 000123 means 0.123 kg, not 123 kg.
- Assuming an expiry day of "00" is a typo. Historically it meant the last day of that month. GS1 withdrew that allowance for regulated healthcare products from 1 January 2025, so newer packs carry a real day — but older stock in circulation may still show 00.
- Printing too small for the marking method. A symbol that reads perfectly from a laser printer proof can fail when dot-peened or printed on a flexible substrate. Always verify from the real production process.
- Skipping check digit verification. GTIN, SSCC, and GLN all end in a mod-10 check digit. Our barcode validator confirms one in a second.
Frequently Asked Questions
Is a GS1 DataMatrix the same thing as a QR code?
No. They are different standards — Data Matrix is ISO/IEC 16022, QR is ISO/IEC 18004. The quickest way to tell them apart is the finder pattern: a Data Matrix has a solid L-shaped border on two adjacent sides, while a QR code has three large squares in its corners.
Can my phone scan a GS1 DataMatrix?
Yes, if the scanning app supports the format. Some built-in camera apps recognise QR codes only, which is why a medicine pack often appears not to scan at all. A dedicated scanner app that supports Data Matrix will read it and show you the raw payload.
What is the difference between Data Matrix and GS1 DataMatrix?
Both use the same ECC 200 symbol. A GS1 DataMatrix carries the FNC1 character in the first position, which flags the contents as structured GS1 data organised by Application Identifiers. A plain Data Matrix can contain any text a company chooses, with no standard structure.
Why does the barcode on my medicine box contain a serial number?
Because falsified-medicine rules require individual packs to be traceable, not just product lines. Under the EU Falsified Medicines Directive a pharmacy scans the pack and verifies the serial against a national repository before dispensing, then marks it as used so the same serial cannot be dispensed twice.
How much data can a Data Matrix hold?
The largest ECC 200 symbol holds up to 3,116 numeric digits or 2,335 alphanumeric characters. That is well below a QR code's maximum, but far more than the small structured records Data Matrix is normally used for.
Can I generate my own GS1 DataMatrix?
Technically yes, with software that supports FNC1. But a compliant code needs a GTIN issued to you through GS1 membership — you cannot invent a product number, because it must be globally unique and resolvable to your company.
What does the invisible character between fields mean?
It is the FNC1 separator, usually delivered by scanners as ASCII 29, the Group Separator. It marks the end of a variable-length field such as a batch number. Fixed-length fields like the GTIN and expiry date need no separator because their length is already defined by the standard.
Does a GS1 DataMatrix contain a website link?
Normally no — it contains structured identifiers, not a URL. The GS1 format designed to carry a web address is GS1 Digital Link, which is usually encoded in a QR code so that both a till and a shopper's phone can use the same symbol.
The Short Version
GS1 DataMatrix is a compact 2D barcode carrying a structured record — product, expiry, batch, and often a serial number unique to the individual pack — flagged as GS1 data by an FNC1 character you never see. It is the mandated carrier for prescription medicines in the EU and US and for much of the medical device world, and it is the format of choice anywhere the item is too small for a QR code.
If you work with these codes regularly, the useful habit is to stop treating the payload as an opaque string. Scan it, look at the fields, and check that the GTIN check digit and the expiry date are what the spec sheet says they should be. Most GS1 problems are visible the moment the string is broken into its parts.