Glossary · Barcodes & labeling
What is a Data Matrix code?
The small square on every medicine pack and on many components. The Data Matrix code stores a lot in a tiny area and even lasts as a laser engraving on metal. Here you will learn how it is structured, what a GS1 code on a pack contains and when it is worth using in your own warehouse.
In brief
A Data Matrix code is a two-dimensional code made of square or rectangular modules, recognizable by an L-shaped solid border. It is standardized in ISO/IEC 16022 and stores the same content in a smaller area than a QR code. As GS1 DataMatrix, it is the standard on prescription medicines and many medical devices.
Data Matrix code: definition
The Data Matrix code is a relative of the QR code, but optimized for other uses. It needs less space, tolerates direct marking by laser or dot peen and is read especially quickly by handheld scanners. That is why you find it wherever space is tight or the code has to last a product’s lifetime: on circuit boards, tools, implants and medicine packs.
Data Matrix or QR code?
| Criterion | Data Matrix | QR code |
|---|---|---|
| Distinguishing feature | L border and timing pattern | Three finder patterns |
| Space needed for short content | Smaller | Slightly larger |
| Direct marking on metal | Very well suited | Possible, but less common |
| Reading with a phone camera | With a suitable app | With any camera app |
| Typical use | Pharma, medical, industry, tools | Inventory, shelves, links |
Rule of thumb: for labels that employees scan with their phone, the QR code is the safe choice. For very small parts and engraved codes, Data Matrix has the edge.
Example: what the code on a medicine pack contains
Since February 2019, prescription medicines in the EU have carried a Data Matrix code with a serial number. In GS1 format, each piece of information is introduced by an identifier in brackets, the Application Identifier. A scanner reads, for example:
- (01) Product number, here an NTIN derived from the German PZN
04012345000016 - (17) Expiry date in the format YYMMDD
280531 → 31 May 2028 - (10) Batch number
B4471X - (21) Serial number, unique per pack
7Q2K9MZ41H
One code, four pieces of information: product, expiry, batch and the individual pack. Exactly what you need for FEFO and recalls.
Values in the example: invented, but in the real format. Under the EU Medical Device Regulation, medical devices also increasingly carry a UDI code, often as GS1 DataMatrix.
When Data Matrix pays off in your own warehouse
- Small parts: drill bits, bits, measuring tools, gauges – where there is no room for a QR code.
- Engraving: tools that would not survive a label get the code lasered on.
- Use existing codes: medicines, sterile goods and many industrial parts carry the code from the factory.
- Handheld scanners in use: with a 2D scanner, Data Matrix is read especially fast.
4 typical mistakes with Data Matrix codes
- Printing too small. Below about 10 × 10 mm, it gets difficult for office printers and phone cameras.
- Forgetting the quiet zone. Data Matrix also needs a light border, otherwise the L border cannot be found.
- Assuming every camera app reads it. For employees without a suitable app, use a QR code instead.
- Misreading GS1 content. The numbers in brackets are identifiers, not part of the data. (17) means expiry date, not item 17.
Data Matrix with Scanwiz
Scanwiz reads Data Matrix codes just like QR codes, Code 128 and EAN – with the phone camera in the app for iOS and Android or with a USB or Bluetooth handheld scanner. You can create Data Matrix labels for tools and small parts free of charge with our label generator. For medicines and sterile goods, you can manage batches with expiry dates from the Growth plan.
- Reads QR code, Data Matrix, Code 128 and EAN
- Free Data Matrix labels with the generator
- Batches with expiry dates from Growth
Frequently asked questions about the Data Matrix code
What is a Data Matrix code?
A two-dimensional code with an L-shaped finder pattern, standardized in ISO/IEC 16022. It stores numbers or text in a very small area and is also suitable for laser engraving.
What is the difference between Data Matrix and QR code?
Data Matrix is more compact for short content and is often engraved directly onto parts. The QR code can be read by any smartphone camera and is therefore usually the better choice for labels that are scanned with a phone.
Why do medicines have a Data Matrix code?
Since February 2019, prescription medicines in the EU must carry a unique code with a serial number to prevent counterfeiting. It contains the product number, batch, expiry date and serial number.
Can I create Data Matrix codes myself?
Yes. With the free Scanwiz label generator you can create up to 100 Data Matrix labels per PDF, without signing up.
Sources & methodology
- Wikipedia: Data Matrix. en.wikipedia.org, accessed 10 November 2026.
- Delegated Regulation (EU) 2016/161 on safety features on medicine packs, in force since 9 February 2019.
- GS1: Application Identifiers at a glance.
- Sample values: fictitious, created in GS1 format by Scanwiz.
Updated November 2026 · Scanwiz editorial team
More from the glossary
Related to the Data Matrix code.
Over 250 customers already trust Scanwiz
From the glossary to your warehouse – Scanwiz does the rest.
Minimum stock, stocktakes, inspection intervals and batches run automatically in Scanwiz as part of your daily work. Try it free for 14 days with your whole team – no credit card required. Or let us show you everything in a personal demo.