How to scan a Data Matrix code
- Tap Start camera and fit the code inside the square frame, or choose Upload image for a photo.
- Hold steady with even light. Shiny or etched codes read better at a slight angle.
- Read the result: the text, symbol size, and for GS1 codes the GTIN, dates, batch and serial number.
Quick answer: a Data Matrix is a square or rectangular 2D code with a solid L-shaped edge. Scan it here with your camera or a photo. GS1 DataMatrix codes are decoded into labelled fields such as GTIN (01), expiry (17), batch (10) and serial number (21).
Where you’ll find Data Matrix codes
- Medicines: EU prescription packs carry a GS1 DataMatrix under the Falsified Medicines Directive, and the US uses it for drug serialisation under DSCSA.
- Medical devices: UDI labels often use GS1 DataMatrix or HIBC Data Matrix.
- Electronics and parts: tiny codes on circuit boards and components, often laser-marked.
- Postage: many postal services print Data Matrix indicia on letters and parcels.
Reading a GS1 DataMatrix
A GS1 DataMatrix starts with a special FNC1 character that tells the scanner the content is GS1 element strings. The scanner reports this with the symbology identifier ]d2 (plain Data Matrix is ]d1) and shows the data with each Application Identifier in brackets:
| AI | Field | Example |
|---|---|---|
(01) | GTIN, 14 digits | 09521234543213 |
(17) | Expiry date, YYMMDD | 280331 = 31 March 2028 |
(10) | Batch or lot | B4471 |
(21) | Serial number | 7Q2XK9M3 |
The scanner also checks the GTIN’s check digit and writes dates out in full. For the full list of AIs and raw bytes, see the barcode decoder.
Tips for small or etched codes
Data Matrix codes can be just a few millimetres wide. Hold the camera far enough back to focus, then use the zoom slider where available. For printed labels, even light from the front works best. For codes marked into metal or plastic, light from one side to create shadows in the marks, and try a sharp photo with the Upload image tab if the live camera struggles. To create your own, use the Data Matrix generator or the GS1 DataMatrix generator.
Frequently asked questions
How do I scan a Data Matrix code?
Tap Start camera and fit the code inside the square, or switch to Upload image and add a photo. The decoded text appears with the symbol size and, for GS1 DataMatrix, each field (GTIN, expiry, batch, serial) split out and explained.
Can a phone read a Data Matrix code?
Yes. Any phone camera that can focus on the code can read it, and no app is needed with this page. Very small codes need good light and a steady hand; move back slightly if the code looks blurry.
What is the Data Matrix code on medicine packs?
It’s a GS1 DataMatrix. In the EU, prescription medicines carry one under the Falsified Medicines Directive, holding the product code (GTIN), serial number, batch number and expiry date. US prescription drugs use the same format under DSCSA. The scanner shows each of these fields.
What’s the difference between Data Matrix and a QR code?
Both are 2D codes. Data Matrix has an L-shaped solid border and a dotted edge instead of three corner squares, fits more data into a small area, and is the standard for industrial parts marking and healthcare. QR codes are more common for consumer links.
Can it read Data Matrix codes etched into metal?
Sometimes. Codes laser-marked or dot-peened onto metal (direct part marking) are low contrast and shiny, which phone cameras find hard. Light them from the side, avoid reflections, and try a photo with Upload image. Industrial DPM scanners exist for production use.
Is anything uploaded?
No. Codes are decoded on your device. That matters for serialised codes on medicines and parts, which can identify individual items.