2D Free plan

DataMatrix Generator API

High-density code for industrial marking

Sample Data Matrix barcode

https://bargen.pro

Generated live by the BarGen API from https://bargen.pro

DataMatrix is a compact two-dimensional matrix barcode defined by ISO/IEC 16022, capable of packing up to 2,335 alphanumeric characters into a symbol only a few millimeters wide. Its high data density and strong error correction under the ECC200 scheme make it the standard choice wherever printed real estate is scarce, from electronic component markings to direct laser etching on metal parts.

To generate a DataMatrix symbol, call the BarGen REST API with the payload text and target module size; the response returns an SVG for vector printing workflows or a PNG for raster placement. The service handles ECC200 encoding and symbol sizing automatically.

Data Matrix is a two-dimensional barcode consisting of black and white cells arranged in a square or rectangular pattern. Developed in 1989, it is widely used for marking small items and in industrial settings.

The code can store up to 2,335 alphanumeric characters or 3,116 numeric digits. It uses Reed-Solomon error correction, allowing up to 30% of the code to be damaged while still being readable.

Data Matrix is particularly popular for direct part marking (DPM)—permanently marking components with laser etching, dot peen, or chemical etching. The electronics, automotive, and aerospace industries use it extensively for component traceability.

The United States Electronic Industries Alliance (EIA) recommends Data Matrix for marking small electronic components. It is also used for postal marking, document management, and pharmaceutical packaging (often with GS1 identifiers).

Common use cases

Electronics component marking

PCB manufacturers etch or print DataMatrix codes directly onto small components for traceability through assembly and rework.

Aerospace direct part marking

Aerospace and defense supply chains use laser-etched DataMatrix codes to track individual parts across their service life.

Document and mail management

Postal and document scanning systems embed DataMatrix codes on forms and envelopes for automated routing and archival lookup.

Generate Data Matrix via the REST API

curl "https://api.bargen.pro/v1/barcode/datamatrix?data=https%3A%2F%2Fbargen.pro&format=svg" \
  -H "X-API-Key: YOUR_API_KEY"

Returns the barcode as SVG. See the API documentation for all options.

Frequently asked questions

How small can a DataMatrix symbol be printed?

DataMatrix symbols can be produced down to roughly 2-3mm square while remaining scannable, which is why they are common on individual electronic components and pharmaceutical blister packs.

What is ECC200?

ECC200 is the Reed-Solomon based error correction scheme used by all current DataMatrix symbols, replacing the older convolutional ECC000-140 schemes and offering more reliable recovery from print defects.

Is plain DataMatrix the same as GS1 DataMatrix?

No. Plain DataMatrix carries any free-form text or binary data, while GS1 DataMatrix wraps the same symbology around GS1 Application Identifiers for structured supply-chain data such as batch and expiry.

Specifications

Capacity
Up to 2,335 alphanumeric characters
Error Correction
Reed-Solomon (up to 30%)
Size
10×10 to 144×144 modules

Availability

Available from the Free plan.

See pricing

Start generating Data Matrix barcodes

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