Data Matrix

Data Matrix is the square 2D barcode on pharma vials, electronic components, surgical instruments, jet-engine blades, and pretty much anything small enough that a QR wouldn't fit. It's the only 2D symbology specified for direct-part marking (DPM), laser-etched, dot-peen, or chemically-etched straight onto metal, and the only one with an ISO standard (29158) for grading DPM-quality decodes.

Canonical spec:ISO/IEC 16022:2006, Information technology, Automatic identification and data capture techniques, Data Matrix bar code symbology specification.
DPM grading:ISO/IEC TR 29158:2020, Direct part mark (DPM) quality guideline.
Pharma application:FDA UDI Rule (2013) and EU Medical Device Regulation 2017/745, both mandate GS1-formatted Data Matrix on most medical devices.
Originator: International Data Matrix Inc, 1987. Now maintained by AIM and ISO. Royalty-free.

What it is

A square (or rectangular) matrix with an L-shaped finder pattern on two adjacent sides and a clock track (alternating black/white) on the other two. Inside that frame is a grid of data modules encoding the payload via Reed-Solomon ECC (the modern variant, ECC 200, is the only one in current use, older variants ECC 000, ECC 050, ECC 080, ECC 100, ECC 140 are deprecated).

Three properties that make Data Matrix the industrial-marking standard:

Sizes and capacity (ECC 200)

Data Matrix supports 24 square sizes from 10×10 to 144×144, plus 6 rectangular sizes from 8×18 to 16×48. Representative capacities:

Size (modules)Max numericMax alphanumericTypical use
10 × 106 digits3 charsSMT resistor, tiny electronic part
12 × 1210 digits6 charsSMT capacitor, small connector
16 × 1624 digits16 charsPharma glass vial, small IC package
20 × 2044 digits31 charsPharma blister pack, medium IC
26 × 2688 digits64 charsPharma carton with lot + expiry + GTIN
32 × 32124 digits91 charsFull GS1 element string with serial
52 × 52408 digits301 charsMaintenance tag on industrial equipment
144 × 1443,116 digits2,335 charsTheoretical max, rarely shipped

GS1 element strings, pharma + supply-chain use

In pharma and regulated supply chains, Data Matrix payloads are GS1 element strings with parentheses-wrapped Application Identifiers (AIs). Common AIs:

AINameFormatExample
(01)GTIN14 digits(01)09506000134352
(10)Batch / Lotalphanumeric, var(10)ABC123
(17)Expiry dateYYMMDD(17)270630
(21)Serial numberalphanumeric, var(21)SN00042
(240)Additional IDalphanumeric, var(240)CAT-7A

In the encoded payload, the parentheses are visualisation only, the actual symbol uses the FNC1 function character as a field separator. Encoders must emit FNC1 at the start (to signal GS1 mode) and between variable-length AIs.

Canonical test vectors

CasePayloadExpected substring
Pharma UDI (GS1 element string)(01)09506000134352(17)270630(10)ABC12309506000134352
Electronic part (plain)PN:4321-ABC SN:000012344321-ABC
Short numeric ID1234567812345678
URL (rare but valid)https://example.com/p/X42example.com/p/X42

Common pitfalls

Scanner compatibility

ReaderData Matrix supportNotes
iOS Camera (iOS 15+)NoApple has not added Data Matrix to the native Camera app. Third-party apps with Scandit or Dynamsoft SDKs work.
Android Camera (Google/Pixel)Yes (via Google Lens)Google Lens decodes Data Matrix reasonably well on high-contrast product packaging. Fails on laser-etched DPM.
Pharma / medical DPM reader (ISO 29158)Yes (canonical)Microscan, Cognex DataMan, Dynamsoft DPM readers, full support with quality grading.
Zebra / Honeywell / Datalogic industrial imagerYesEvery industrial 2D imager supports Data Matrix natively. Default symbology for their factory-automation lines.
GS1 QR-enabled POS scannerYesRetail POS scanners that accept GS1 DataBar also accept GS1 Data Matrix with FNC1 encoding.
Airline / transit gate readerNoNot used for transit. Use Aztec for boarding passes.
1D laser scannerNoData Matrix is 2D, requires an imager. Only PDF417 decodes on 1D lasers.

See also

Spec references verified 2026-04-19. ISO/IEC 16022:2006, ISO/IEC TR 29158:2020, FDA UDI Rule, EU MDR 2017/745. Next review: 2026-07-19.