2D codes

Data Matrix barcode

The compact matrix code on pharmaceuticals, medical devices, electronics, and small parts.

Also known as: GS1 DataMatrix, ECC 200, ISO/IEC 16022

What is Data Matrix?

Data Matrix is a two-dimensional matrix symbology that packs a GTIN, lot, expiry, and serial number into a square a few millimetres across, with Reed-Solomon error correction that survives scratches and partial marks. GS1 DataMatrix, the version opened with FNC1, is the required carrier for US pharmaceutical serialization under the Drug Supply Chain Security Act and for medical device UDI labels, and it is one of the two GS1 2D carriers for point of sale.

Encodes: Up to 3,116 digits or 2,335 alphanumeric characters. In GS1 DataMatrix, element strings opened with FNC1 and separated with FNC1 where variable length.

GS1 DataMatrix with GTIN (01), expiry (17), lot (10), and serial (21): the four-element string on a serialized pharmaceutical pack.

Open Data Matrix in the generator

How Data Matrix is structured

The symbol structure is fixed by the standard; the data structure on a regulated product is fixed by GS1 and the regulator. A serialized pharmaceutical pack carries four element strings in a specific order.

Part Length What it means
(01) GTIN 14 digits The product. For US drugs, derived from the NDC with a leading 003 and check digit.
(17) Expiration date 6 digits, YYMMDD Fixed length, so it follows the GTIN without a separator.
(10) Batch or lot Up to 20 characters Variable length; needs a FNC1 separator if anything follows it.
(21) Serial number Up to 20 characters Unique per pack. Placed last so no trailing separator is needed.

Specifications

Capacity
Up to 3,116 numeric, 2,335 alphanumeric, or 1,556 bytes
Sizes
Square 10 × 10 to 144 × 144 modules; rectangular formats from 8 × 18 to 16 × 48
Error correction
Reed-Solomon, fixed per size, roughly 25% to 33% of codewords
Quiet zone
1 module on all sides
Finder pattern
Solid L-shaped border on two sides, alternating pattern on the other two
X-dimension
0.254 mm to 0.615 mm for healthcare items; 0.396 mm to 0.990 mm at retail POS
GS1 mode
FNC1 in first position; human-readable text with AIs in parentheses printed alongside
Standard
ISO/IEC 16022 (ECC 200); GS1 General Specifications

Dimensions are GS1 General Specifications targets. Confirm against the retailer’s current routing guide before a print run.

Where it is used

  • Serialized pharmaceutical packages under DSCSA
  • Medical device Unique Device Identification (UDI) labels
  • Direct part marking on electronics, aerospace, and automotive components
  • Small consumer items where a QR would not fit
  • 2D at point of sale alongside QR Code under Sunrise 2027
Generated per shipment

Printed on the line, one code per pack, from the batch record

A Data Matrix carrying a serial is generated by the packaging line or the labeling system at the moment the unit is made, from the lot and expiry in the batch record, and the serials are commissioned to a repository so they can be verified downstream. A static Data Matrix carrying only a GTIN can be artwork, but on regulated products that case is rare.

Retailers whose routing guides call for it

Each retailer page covers the transaction sets, labeling rules, and reported chargebacks behind the requirement.

Mistakes that cost money

No FNC1 in first position

Without it the symbol is a plain Data Matrix and no scanner will parse Application Identifiers. Pharmacy and hospital systems reject it.

Missing separator after the lot

Put fixed-length AIs first and terminate the variable-length lot with FNC1 if the serial follows, or reorder so the variable element is last.

Symbol too small for the verifier

Regulated labels are graded. An X-dimension below the standard for the item class fails verification even if a phone reads it.

Low contrast on foil, glass, or metal

Direct marks need dark-on-light or a verified inverted mark; test with the actual reader, not a phone.

Serials that disagree with the aggregation record

The serial on the unit must match the serial in the case aggregation and the 856 or EPCIS event. Two systems generating serials produce mismatches.

Choosing Data Matrix for a shopper

Phone cameras do not read Data Matrix natively. If the shopper is the audience, use QR.

How Endless handles Data Matrix

Endless carries lot, expiry, and serial on the unit and batch records that feed the label, the case aggregation, and the ASN, so what the Data Matrix says is what the trading partner receives and what the traceability query returns.

Frequently asked questions

What does DSCSA require on a drug package?

A 2D Data Matrix with the product’s GTIN, serial number, lot number, and expiration date, in GS1 format, plus the same information in human-readable text. The serialized units must be aggregated to cases and pallets and traceable through electronic records.

What is UDI?

Unique Device Identification, the FDA and EU requirement that medical device labels carry a device identifier (the GTIN) and production identifiers (lot, serial, expiry) in a barcode. GS1 DataMatrix and GS1-128 are the usual carriers.

Data Matrix or GS1-128 on a case?

GS1-128 remains the norm for logistics labels because every warehouse scanner reads it. Data Matrix wins when the case is small, the label is tiny, or the data set will not fit in a linear symbol.

Related symbologies

  • QR Code

    The camera-readable matrix code on packaging, and the carrier GS1 chose for 2D at point of sale.

  • GS1-128

    The Code 128 subset that carries GS1 Application Identifiers, the barcode on every carton and pallet shipping label.

  • NDC Barcode

    How a US drug’s National Drug Code becomes a GTIN and appears in a linear or Data Matrix barcode.

Definitions in the glossary

Browse the full barcode symbology guide.

Book an Endless Commerce demo

See it on your channels.

Spend your time on the business, not the busywork. Book a demo and watch Endless run your operations across every channel you sell on.

Get a Demo