What is DataMatrix?
DataMatrix is a two-dimensional matrix barcode, standardised in ISO/IEC 16022, that stores data in a square or rectangular grid of dark and light modules and, thanks to Reed-Solomon error correction, stays readable when part of the symbol is damaged. A single symbol a few millimetres across can hold a product code, batch number, expiry date and serial number at the same time. That is why DataMatrix is the standard data carrier for medicines, medical devices (UDI) and codes engraved directly onto parts in manufacturing. In OT environments it is the link between the physical product and the traceability data in MES, WMS and ERP.
๐ง How is a DataMatrix symbol structured?
A DataMatrix is made up of modules: small squares or dots of equal size. The width of one module is called the X-dimension. Around the data area sits a fixed pattern that the reader uses to find and align the symbol:
- L-shaped finder pattern - two solid dark edges on the left and bottom. The reader uses them to determine orientation, size and any distortion.
- Clock track - the other two edges, with alternating dark and light modules. This track gives the number of rows and columns.
- Data regions - larger symbols are divided into several data regions, separated by internal alignment patterns. A 144ร144 symbol has 36 of them.
- Quiet zone - a light margin at least one module wide around the symbol, in which nothing else may be printed.
The current variant is called ECC 200 and always has an even number of rows and columns. Older variants (ECC 000 to ECC 140) used convolutional error correction, have an odd number of rows and are only still used in closed applications. For new applications, and for anything within GS1, only ECC 200 is permitted.
DataMatrix was developed by the US company International Data Matrix (ID Matrix). The ECC 200 version was specified by the industry association AIM in the 1990s. The first international standard, ISO/IEC 16022:2000, followed in 2000. The third edition, ISO/IEC 16022:2024, was published in May 2024.
๐ง How much data fits in a DataMatrix?
ECC 200 offers 24 square sizes, from 10ร10 to 144ร144 modules, and six rectangular sizes from 8ร18 to 16ร48 modules. The rectangular form is useful on narrow surfaces, such as the edge of a carton or the side of a circuit board. The larger the symbol, the more data it holds, but the share of error correction falls:
| Size (modules) | Data regions | Max. digits | Max. alphanumeric | Error correction share |
|---|---|---|---|---|
| 10ร10 | 1 | 6 | 3 | 62.5% |
| 24ร24 | 1 | 72 | 52 | 40% |
| 52ร52 | 4 | 408 | 304 | 29.2% |
| 144ร144 | 36 | 3,116 | 2,335 | 28.5% |
In binary mode a single symbol holds up to 1,556 bytes. In practice an ECC 200 symbol can still reconstruct its full content when about 30% of the symbol is damaged, as long as the finder pattern can still be located.
Data is encoded in one of six encodation modes: ASCII (the default, with two digits per codeword), C40, Text, ANSI X12, EDIFACT and Base 256 for binary data. An encoder switches between modes automatically to produce the smallest possible symbol. With Structured Append, up to 16 symbols can together carry one message.
๐งพ How does a GS1 DataMatrix work?
A GS1 DataMatrix is an ordinary ECC 200 DataMatrix with the special character FNC1 in the first position. This tells the scanner that the content consists of GS1 Application Identifiers (AIs): short numeric codes that indicate which data element follows. Typical content on a medicine or medical device:
(01)08711234567895(17)280930(10)BATCH1234(21)SN567890
| AI | Meaning | Length |
|---|---|---|
| (01) | GTIN, the product number | fixed, 14 digits |
| (17) | Expiry date (YYMMDD) | fixed, 6 digits |
| (10) | Batch or lot number | variable, max. 20 characters |
| (21) | Serial number | variable, max. 20 characters |
The parentheses only appear in the human-readable text below the symbol, not in the code itself. After a variable-length field such as (10), unless it is the last field, a separator (FNC1, passed on by the scanner as the ASCII character GS, value 29) is required before the next field starts. Also note the difference between (17) expiry date and (15) best before date, the best before date used in the food sector. How GTINs are issued and which AIs exist is covered in the article on GS1.
๐ญ Where is DataMatrix mandatory or widely used?
| Sector | Framework | What the DataMatrix carries |
|---|---|---|
| Prescription medicines (EU) | Delegated Regulation (EU) 2016/161, since 9 February 2019 | Product code, serial number, batch number and expiry date per pack |
| Medical devices | EU MDR (Regulation (EU) 2017/745) and the FDA UDI rule | UDI-DI and UDI-PI, on the label or directly on the device |
| Aerospace and defence | MIL-STD-130 (US), SAE AS9132 for marking quality | Permanent part identification via direct part marking |
| Electronics | Recommendation of the US EIA for small components | Serial or part number on components and circuit boards (PCBA) |
| Retail | GS1 initiative Sunrise 2027 | 2D codes alongside or instead of the EAN-13 at the checkout |
In the pharmaceutical sector, the code alone is not the point. When dispensing, the pharmacy checks the unique serial number against a European verification system. Only then is it clear whether the pack is genuine. In healthcare, HIBC is also used as a data structure alongside GS1.
๐ How does DataMatrix compare with QR Code and GS1-128?
| Feature | DataMatrix | QR Code | GS1-128 |
|---|---|---|---|
| Type | 2D matrix | 2D matrix | 1D linear |
| Smallest size | 10ร10 modules | 21ร21 modules | Length grows with the data |
| Reader | Camera (imager) only | Camera (imager) only | Laser scanner or camera |
| Direct part marking | Very suitable | Possible, less common | Unsuitable |
| Typical use | Pharma, healthcare, parts | Consumer links, GS1 Digital Link | Pallet and logistics labels with SSCC |
For small amounts of data, DataMatrix needs less space than a QR code, because it has a single finder pattern instead of three large corner blocks. A QR code, on the other hand, is more recognisable to consumers with a smartphone. GS1-128 remains common in logistics because older laser scanners can still read it. An overview of all types is in the article on barcodes.
๐ ๏ธ How do you introduce DataMatrix on a production or packaging line?
- Define the content - choose which AIs you need and keep the data short. Every extra character can result in a larger symbol.
- Choose the marking technology - thermal transfer or inkjet printing on labels and cartons, laser on plastic and metal, or dot peen on castings.
- Choose the X-dimension - for healthcare products GS1 specifies 0.254 to 0.495 mm with a target of 0.380 mm. A 24ร24 symbol including its quiet zone is then about 1 cm wide. For direct part marking on small medical instruments, the X-dimension may go down to 0.100 mm.
- Verify the quality - printed codes are graded according to ISO/IEC 15415 on a scale from 4 to 0. For healthcare products GS1 sets a minimum of 1.5; the EU medicines regulation additionally requires a print quality that keeps the code readable throughout the supply chain. For engraved codes, the guideline ISO/IEC TR 29158 applies.
- Read inline and reject - a machine vision camera reads every code immediately after printing. If a code is unreadable or incorrect, the PLC triggers a reject.
- Link to the data - the MES or a serialisation server issues serial numbers, records every code and passes the data on to ERP and external registers. In laboratories, a LIMS reads the same codes on samples and reagents. On a packaging line following PackML, this fits into the normal machine states.
In regulated GMP environments, the whole chain of issuing, printing and recording must be demonstrably reliable. That ties directly into data integrity and into tracking and tracing across the whole supply chain.
๐ What are the limitations and security risks?
- No security in the code itself - DataMatrix neither encrypts nor signs anything. Anyone can copy a code. Authenticity only follows from checking the serial number against a central database.
- Scanner as a keyboard - many scanners send scanned data to an application as keystrokes. A manipulated code can therefore inject unexpected input into an HMI or database. Always validate the content.
- Dependent on print quality - worn print heads and low contrast on metal or glossy film lead to unreadable codes and downtime.
- Camera reading only - existing laser scanners cannot read DataMatrix. A switchover requires new hardware.
- Line of sight required - where bulk reading without line of sight is needed, RFID is an alternative or complement.
โ Frequently asked questions
What is the difference between DataMatrix and a QR code?
DataMatrix and the QR code are both 2D matrix barcodes that can only be read by a camera. DataMatrix has a single L-shaped finder pattern and therefore fits on smaller surfaces, which makes it suitable for medicines and direct part marking. The QR code has three large corner blocks and is mainly used for consumer links.
How many characters can a DataMatrix hold?
A DataMatrix ECC 200 in the largest size, 144ร144 modules, holds up to 3,116 digits, 2,335 alphanumeric characters or 1,556 bytes. The smallest square size of 10ร10 modules holds only 6 digits, so the required size depends directly on the amount of data.
Can a laser scanner read a DataMatrix?
No, a classic laser scanner cannot read a DataMatrix, because it only scans a single line through the symbol. A DataMatrix has to be captured as a complete image by an imager or camera. Almost all modern handheld scanners read both 1D and 2D codes.
What is ECC 200 in DataMatrix?
ECC 200 is the current version of the DataMatrix symbology, with Reed-Solomon error correction and an even number of rows and columns. Older versions (ECC 000 to 140) used a different error correction method and are no longer recommended. GS1 permits only DataMatrix ECC 200.
What is direct part marking with DataMatrix?
Direct part marking (DPM) is the permanent application of a DataMatrix to the part itself, using a laser, dot peen, inkjet or chemical etching. This keeps a part identifiable throughout its entire life, even if a label would come off. The quality of such codes is assessed according to ISO/IEC TR 29158.
Is a DataMatrix mandatory on medicines?
Yes, since 9 February 2019 most prescription medicines in the EU must carry a unique identifier in a 2D DataMatrix under Delegated Regulation (EU) 2016/161. The code contains the product code, serial number, batch number and expiry date. The pharmacy verifies the serial number against a European verification system when dispensing.
๐ In summary
DataMatrix is a compact 2D barcode under ISO/IEC 16022 that stores up to 3,116 digits with error correction, making it the standard carrier for medicines, medical devices and directly marked parts. Introducing DataMatrix on a line means choosing the content according to GS1, the right X-dimension and marking technology, verifying print quality to ISO/IEC 15415 and linking every code to MES and ERP for complete traceability.
