2D Pro plan

GS1 DataMatrix Generator API

Pharmaceutical and healthcare traceability

Sample GS1 DataMatrix barcode

Generated live by the BarGen API from (01)09521234543213(17)270630(10)LOT1

GS1 DataMatrix applies the ISO/IEC 16022 DataMatrix symbology to the GS1 General Specifications, encoding data as a string of Application Identifiers such as GTIN (01), batch or lot (10), and expiry date (17). This structured format underpins pharmaceutical serialization mandates including the US Drug Supply Chain Security Act and the EU Falsified Medicines Directive, as well as FDA Unique Device Identification for medical devices.

Send a GS1 element string to the BarGen API and it returns the encoded symbol as SVG or PNG, parsing the Application Identifiers into the correct FNC1-delimited DataMatrix structure automatically.

GS1 DataMatrix combines the Data Matrix symbology with GS1 Application Identifiers, creating a compact 2D barcode ideal for pharmaceutical and healthcare applications. It follows the same AI structure as GS1-128 but in a smaller footprint.

The barcode begins with an FNC1 character to indicate GS1 format, followed by Application Identifiers and their data. This allows encoding of GTIN, serial numbers, batch/lot numbers, and expiration dates in a very small space.

GS1 DataMatrix is the preferred format for direct part marking on small medical devices and pharmaceutical packaging. Its small size and high data capacity make it ideal for blister packs, vials, and individual doses.

Regulatory compliance drives adoption: the EU Falsified Medicines Directive (FMD), US FDA UDI requirements, and similar regulations worldwide require GS1 DataMatrix on pharmaceutical and medical device packaging for traceability and anti-counterfeiting.

Common use cases

Pharmaceutical serialization

DSCSA and FMD compliance require unit-level packs to carry a GS1 DataMatrix with GTIN, serial number, batch, and expiry for track-and-trace.

Medical device UDI

FDA and EU MDR unique device identification rules accept GS1 DataMatrix as the carrier for device identifier and production identifier data.

Food and beverage traceability

Food producers encode batch and best-before data in GS1 DataMatrix to support recall management and supply chain traceability.

Generate GS1 DataMatrix via the REST API

curl "https://api.bargen.pro/v1/barcode/gs1-datamatrix?data=%2801%2909521234543213%2817%29270630%2810%29LOT1&format=svg" \
  -H "X-API-Key: YOUR_API_KEY"

Returns the barcode as SVG; PNG, PDF and EPS are available on higher plans. See the API documentation for all options.

Frequently asked questions

What is a GS1 Application Identifier?

An Application Identifier is a numeric prefix, such as (01) for GTIN or (17) for expiry date, that tells scanning systems how to interpret the field that follows it inside a GS1 element string.

Is GS1 DataMatrix the same symbology as plain DataMatrix?

Yes, it uses the same ISO/IEC 16022 symbol structure, but the encoded data follows GS1 syntax with an FNC1 character marking it as a GS1 carrier rather than free-form text.

Why do pharmaceutical regulations require GS1 DataMatrix specifically?

Its high data density lets a single small symbol carry product code, serial number, batch, and expiry together, which is what unit-level track-and-trace regulations like DSCSA and FMD require.

Specifications

Base Symbology
Data Matrix ECC 200 with FNC1
Data Structure
Application Identifiers (AI)
Typical Size
14×14 to 26×26 modules

Availability

Available from the Pro plan.

See pricing

Start generating GS1 DataMatrix barcodes

Free tier with 1,000 API calls per month. No credit card required.