Map Extract
Free tool

Data Matrix code generator

Type text, a part or serial number, a web address or GS1 data with identifiers in brackets. Choose square or rectangular, set the module size in millimetres and the tool draws the code, says how many modules it uses, and exports it at an exact printed size.

Runs in your browser. Nothing you enter is uploaded.

Creating a code

  1. Pick a preset or start typing

    Presets cover a part or serial number, a GS1 medicine pack, a web address and a rectangular code for narrow parts.

  2. Enter the data

    Text, numbers or a link. For GS1 Data Matrix, tick the GS1 box and write each application identifier in brackets with its value; each field is checked and named.

  3. Square or rectangular

    Square only is ticked by default. Untick it to allow rectangular shapes, which suit long, thin labels.

  4. Set the module size

    Each square cell of the code is one module, from 0.25 mm to 1.5 mm. Larger modules scan more easily but make the code bigger.

  5. Export at size

    Save a vector SVG, a high-resolution PNG for documents or labels, or a PDF whose page matches the symbol, then print it without scaling.

Example: serialised pots of a food supplement

A small supplements brand wants each pot to carry a GS1 Data Matrix with its GTIN, a best-before date, a batch and a unique serial number. The owner ticks GS1 Data Matrix and enters the data below.

All four fields pass and are named: GTIN (product number), Expiry date 2028-03-31, Batch or lot L77 and Serial number A00412. When she first typed the 13-digit product number without its leading zero, the checker said (01) needs a 14-digit GTIN with a correct check digit and suggested adding a leading zero.

Input
GS1 Data Matrix ticked
(01)05060001234564(17)280331(10)L77(21)A00412
Result
(01) GTIN (product number): 05060001234564
(17) Expiry date: 2028-03-31
(10) Batch or lot: L77
(21) Serial number: A00412

Data Matrix, QR code or barcode?

NeedGood choice
Smallest possible mark on a part or packData Matrix
GS1 product data with serial and expiryGS1 Data Matrix
A link people will scan with a phone cameraQR code, which phones recognise most readily
A stock code read by a laser scannerCode 128

Reading the size note

Under the preview the tool gives the printed size in millimetres, including the quiet zone, and the number of modules in each direction plus the one-module margin, along with how many characters you encoded. More data means more modules, so if the code comes out too big for your label, shorten the data or reduce the module size, then test-scan a print.

Questions people ask

What is a Data Matrix code?

A two-dimensional code made of square cells in a grid, with a solid L-shaped border on two sides that scanners use to find and orient it. It can hold text, numbers or GS1 data in a very small space, and error correction lets it scan even when part is damaged.

Can phones scan Data Matrix codes?

Many phone camera apps and most barcode scanning apps can, but QR codes are recognised more widely by default. If ordinary people will scan the code to open a link, a QR code is usually the safer choice. Data Matrix suits industrial, retail and healthcare scanners.

What is GS1 Data Matrix used for?

Carrying standard product data, such as GTIN, batch, expiry date and serial number, in a small square. It is used on medicines and medical devices and increasingly on other products. The data must follow GS1 formats, which the generator checks field by field.

What module size should I choose?

It depends on the printer and scanner. Larger modules are more forgiving of low-resolution printing and older scanners; smaller ones fit tight spaces. Start with the preset's size, print one at 100% and test-scan it with the equipment that will actually be used.

Where your data goes

Codes are encoded and drawn in your browser by a WebAssembly module that ships with the page. Nothing you type is sent off, and every export file is made on your device.

Checked against the tool on

Top