Home · Learn · GS1 DataMatrix: Pharma, UDI, and Serialization

GS1 DataMatrix: Pharma, UDI, and Serialization

GS1 DataMatrix is the 2D barcode mandated by pharma serialization (US DSCSA, EU FMD) and FDA UDI for medical devices. Same square dots as plain Data Matrix — but the data inside follows GS1's Application Identifier syntax.

UPC-A example

GS1 DataMatrix is a specific use of the ISO Data Matrix symbology, governed by GS1's Application Identifier (AI) syntax. The visual barcode is identical to any other Data Matrix square, but the encoded string starts with an FNC1 character signaling it is a GS1 payload, followed by AI-prefixed fields: (01) GTIN, (17) expiration date, (10) lot, (21) serial, (00) SSCC, and many more.

The format is mandated by the US Drug Supply Chain Security Act (DSCSA, fully enforced from May 27, 2026), the EU Falsified Medicines Directive (EU FMD), and the FDA Unique Device Identification (UDI) regulation for medical devices. Pharma manufacturers must encode a GS1 DataMatrix on every saleable unit; medical device manufacturers must encode UDI in a GS1 DataMatrix (or GS1-128) on every device.

How a GS1 DataMatrix is structured

The encoded string starts with FNC1 (an invisible function character), then concatenates AI-prefixed fields. Example for a pharma blister pack: FNC1 + (01)00312345678901 + (17)260131 + (10)LOT42 + (21)SERIAL99 — meaning GTIN 00312345678901, expires January 31 2026, lot LOT42, serial SERIAL99. AI numbers in parentheses are human-readable annotations on the printed label; the actual encoded data uses FNC1 separators between variable-length fields. The Data Matrix renderer then converts that string into the square dot pattern. Use the GS1-128 builder at /tools/gs1-128-builder to construct the AI payload, then render as Data Matrix.

GS1 DataMatrix vs plain Data Matrix vs QR Code

Visually GS1 DataMatrix is identical to plain Data Matrix — same square dot grid, same shape. The difference is what is inside. Plain Data Matrix encodes any text (a URL, a serial number, freeform data). GS1 DataMatrix encodes a structured GS1 AI string. Scanners detect the FNC1 leader and parse fields accordingly. QR Code is a different symbology entirely — larger finder squares, optimized for marketing scans by phone cameras at distance. Pharma/UDI regulations specifically mandate GS1 DataMatrix (or GS1-128), NOT QR.

DSCSA, EU FMD, and FDA UDI compliance

US DSCSA: GS1 DataMatrix encoding GTIN + lot + expiry + serial, on every saleable unit. Stabilization Period ended November 27, 2024; full DSCSA enforcement May 27, 2026. EU FMD: similar structure (GTIN + serial + batch + expiry) with national reimbursement number where applicable, since February 9, 2019. FDA UDI: UDI-DI (Device Identifier, the GS1 GTIN) and UDI-PI (Production Identifier — lot, serial, expiry, mfg date), encoded in GS1 DataMatrix or GS1-128, since 2014 for Class III and rolling out through Class I.

Application Identifiers most used in pharma/UDI

(01) GTIN-14 (always 14 digits with leading zeros for shorter GTINs). (17) Expiration date YYMMDD. (10) Lot/batch, variable length up to 20 chars. (21) Serial number, variable length up to 20 chars. (11) Production date YYMMDD. (15) Best before date YYMMDD. (00) SSCC for pallet/case. (8005) Price per unit. Variable-length AIs need FNC1 after them when followed by another AI; fixed-length AIs (01, 17, 11, 15) do not. The GS1-128 builder on this site enforces these rules.

FAQ

Is GS1 DataMatrix the same as Data Matrix?

Same symbology, different content. Data Matrix is the 2D code shape; GS1 DataMatrix is Data Matrix encoding a GS1 Application Identifier string with an FNC1 leader. Pharma scanners detect the FNC1 and parse fields automatically.

What does FNC1 mean in GS1 DataMatrix?

FNC1 (Function 1) is a special non-printable character that signals 'this is GS1 structured data, not freeform text.' It appears at the very start of the encoded string and after each variable-length AI field, telling scanners where one field ends and the next begins.

Can I use a QR code for pharma serialization instead?

No. US DSCSA, EU FMD, and FDA UDI all specifically mandate GS1 DataMatrix (or GS1-128 in some cases). QR Code is not an accepted format for pharma packaging or medical device UDI labeling.

How do I generate a GS1 DataMatrix?

Compose the AI string using the GS1-128 builder (this site has one at /tools/gs1-128-builder), then render the resulting payload as a Data Matrix barcode at /generators/data-matrix. The same AI string works for both GS1-128 and GS1 DataMatrix symbologies.

What size GS1 DataMatrix do pharma scanners need?

Minimum X-dimension (cell size) is 0.3mm for trade items; 0.495mm for outer packaging. Quiet zone of at least 1 cell on all sides. Total module count depends on data length but typically 16x16 to 26x26 for one carton's GTIN + lot + expiry + serial. GS1 publishes detailed specs at gs1.org/standards/barcodes.

Related generators

Need a real barcode now?

Generate a valid barcode in seconds — no signup, no watermark. Free for casual use; paid plans from $9/mo for higher volume.

Related topics