ScanMosaic

Where Data Matrix is used: medicines, medical devices, electronics and parts

6 min read · Updated 7 November 2026

Data Matrix is the small square 2D code you see on medicine boxes, circuit boards, car parts and some postage. It's rarely meant for the public, but whole industries depend on it. Here's why, and where.

Why Data Matrix?

  • Small. A 20-character serial number fits in 18 × 18 modules, which is 4.5 mm square at a 0.25 mm module.
  • Robust. Reed-Solomon error correction recovers data even when part of the code is scratched or missing.
  • Dense. Up to 3,116 digits or 2,335 letters in one symbol.
  • Markable. It can be printed, laser-etched or dot-peened straight onto metal and plastic, and still be read by a camera.

Medicines

Several countries require a Data Matrix on prescription medicine packs to fight counterfeits. In the EU, under the Falsified Medicines Directive, packs have carried a GS1 DataMatrix since February 2019 with the product code, a unique serial number, the batch and the expiry date. Pharmacies scan it to check the pack is genuine before handing it over. In the US, the Drug Supply Chain Security Act asks for a 2D Data Matrix with similar data on prescription drug packages.

Medical devices

Unique Device Identification (UDI) rules in the US and the EU require medical devices to carry an identifier in human-readable and machine-readable form. GS1 DataMatrix is one of the most common choices, because it fits on small devices and instruments; GS1-128 is used where there's more room.

Electronics, aerospace and automotive

Manufacturers mark circuit boards, components, engine parts and tools with Data Matrix so each part can be traced from production to repair. The code is often laser-etched or dot-peened directly onto the part (direct part marking), so it lasts as long as the part does. Fixed cameras on the production line read it at every step.

Retail and the move to 2D

GS1's "Sunrise 2027" plan aims for checkouts to read 2D codes, GS1 DataMatrix and QR codes with GS1 Digital Link, alongside the familiar EAN and UPC. Fresh food with batch and expiry data is one of the first uses. Linear barcodes aren't going away soon, but new packaging increasingly carries both.

GS1 DataMatrix vs plain Data Matrix

Plain Data MatrixGS1 DataMatrix
ContentAny text or numberGS1 Application Identifiers: (01) GTIN, (17) expiry, (10) batch, (21) serial
First characterYour dataA special FNC1 character marking GS1 data
Used forInternal part marking, documents, labelsMedicines, medical devices, retail
Who decides the contentYouGS1 rules and your regulator

Our Data Matrix generator makes plain Data Matrix (ECC 200), which is right for part numbers, serial numbers and internal labels. Pharmaceutical and medical device labels need GS1 DataMatrix made with software that follows GS1's encoding rules. If you need GS1 data in a linear barcode, use the GS1-128 generator.

Reading Data Matrix

Data Matrix needs a camera-based scanner (a 2D imager). Laser scanners can't read it, and many phone camera apps look only for QR codes, so use a barcode scanner app to test. For codes meant for the public, a QR code is usually the better choice.

Frequently asked questions

Questions

Is Data Matrix the same as a QR code?

No. Both are 2D codes, but Data Matrix has an L-shaped border instead of three corner squares, and it's smaller for the same data. Phones expect QR codes; industry prefers Data Matrix.

Can a phone read Data Matrix?

Most barcode scanner apps can. Many built-in camera apps can't, so don't use Data Matrix for codes the public will scan.

What does ECC 200 mean?

It's the current version of Data Matrix, with Reed-Solomon error correction. Older versions (ECC 000 to 140) are obsolete.

What data goes in a medicine pack's Data Matrix?

Typically the GTIN (01), expiry date (17), batch (10) and serial number (21), plus a national reimbursement number in some countries.

Make your first code in under a minute

Free, private, and checked to scan before you download.