Skip to content
CornerTools

Data Matrix Generator

Make Data Matrix, GS1 DataMatrix, PDF417 and Aztec codes at an exact print size, with GS1 data checked as you type.

Type
Shape

Your code appears here as you type.

Label sheet

Paper

The sheet fills with copies of this code. Print at 100% (actual size), not “Fit to page”.

Print size

The side of one square, X. Default 0.5 mm.

A label printer's resolution puts each module on whole dots.

Data Matrix is the small square code on medicine packs, electronic parts and medical devices; PDF417 is the wide stacked code found on boarding passes, ID cards and shipping labels; Aztec is the code with a bullseye in its centre, used on many train and plane tickets. This tool makes all three, and GS1 DataMatrix, the form that carries a product's GTIN with its expiry date, batch and serial number.

GS1 data is checked as you type and read back as named fields, with dates written out. The code is sized in millimetres, can be snapped to the dots of a 203, 300 or 600 dpi label printer, is read back by a test reader, and downloads as PNG, SVG or PDF, or as a sheet of labels. Everything runs in your browser.

How to use it

Type picks the code. Data Matrix and GS1 DataMatrix come square or Rectangular; the size is always the smallest that holds the data. PDF417 and Aztec have no options: the number of columns, the error correction and, for Aztec, the compact form are the encoder's choice.

Text takes anything, line breaks included; a line break at the end is pointed out, since the code holds it. Text in Latin-1 (English and Western European letters) is stored one byte a character. Anything beyond it, such as Greek, Hindi or an emoji, is stored as UTF-8 with an ECI marker that tells the reader so; a few older scanners show such characters as symbols.

GS1 data takes each Application Identifier in brackets followed by its value, as (01)09506000134352(17)261231(10)LOT1. Spaces around the brackets are ignored. A GTIN or SSCC typed without its check digit gets it added, and the tool says so; a wrong check digit is named with the right one. Each field is listed under the box with its name and, for dates, the date written out. Print the data under the code adds the bracketed text, one element string a line, in a sans-serif 2.8 mm font size, so the digits stand about 2 mm high as GS1 asks.

Module size is X, the side of one square, from 0.1 to 2 mm: 0.5 mm by default, and GS1's target for the use under Scanned at for GS1 DataMatrix. Below 0.25 mm the tool warns that most printers lose modules, and outside GS1's range for the chosen use it names the range. Printer set to a resolution moves X to the nearest whole number of that printer's dots, at least one, and says so; a move of more than 5% is pointed out. For GS1 DataMatrix, an X inside GS1's range stays inside it, taking the next whole dot where the nearest would fall outside.

The PDF and SVG print at exactly the size shown, quiet zone included. With a printer chosen, the PNG is made at its resolution with each module on whole dots, so it prints at the same size; with Any, the PNG is made at 300 dpi, its modules on whole pixels, kept inside GS1's range in the same way, and the tool says how far its size is from the PDF's. The label sheet fills a sheet of A4 or Letter labels with copies of the code, from the label you choose.

How the codes work

A Data Matrix is a grid of square modules inside an L-shaped finder, solid on two sides and alternating on the other two. Every symbol made today is ECC 200: its data is followed by Reed-Solomon error correction codewords, a fixed share for each size, so a damaged code can still be read. Square symbols run from 10 × 10 to 144 × 144 modules, and the six rectangles from 8 × 18 to 16 × 48; the largest rectangle holds 98 digits, the largest square 3,116.

GS1 DataMatrix is a Data Matrix that starts with the FNC1 character, which tells the reader the data is GS1 element strings; readers report it with the symbology identifier ]d2. A fixed-length AI such as (01) or (17) ends where its length ends; after a variable-length one such as (10) or (21) the encoder puts a separator when another element follows. The brackets are never encoded.

PDF417 stacks rows of codewords, each 17 modules wide, between start and stop patterns, with indicators at both ends of each row that say which row it is. Here each row is 3 modules tall, and the tool keeps 2 modules of clear space around it. Aztec grows outward in square layers around the bullseye at its centre, by which readers find it, so the tool adds no quiet zone; leave some clear space on the label anyway.

The capacities in the table come from the encoder the tool uses, each checked at its limit. Bytes are characters beyond ASCII, such as Latin-1's accented letters; plain lowercase text holds somewhere between bytes and capitals. They match GS1's Tables 5-32 and 5-33, except that from 64 × 64 to 132 × 132 the encoder fits one byte more than GS1 lists, which the test reader reads back. GS1 data spends space on FNC1 and separators, so a GS1 symbol holds a little less.

The test reader decodes the code drawn small and slightly blurred, as a phone sees it at arm's length, and compares what it read with what you entered: the bytes for text, the bracketed form for GS1 data. It speaks for that reader alone; print quality and the module size decide whether a printed code scans.

Examples

GS1 DataMatrix for a medicine pack

Type
GS1 DataMatrix
GS1 data
(01)09506000134352(17)270531(10)A2B3C(21)7XK29Q4
Scanned at
Healthcare retail packs
(01) GTIN
09506000134352
(17) Expiry date
270531, 31 May 2027
(10) Batch or lot
A2B3C
(21) Serial number
7XK29Q4

A GTIN with an expiry date, a batch and a serial number unique to the pack, each read back as the tool lists it. They fit a 22 × 22 symbol, 11.9 × 11.9 mm with its quiet zone at GS1's target of 0.495 mm for healthcare retail packs.

PDF417 holding an address

Type
PDF417
Text
Ada Lovelace
12 St James's Square
London SW1Y 4JH

Three lines, line breaks included, make 11 rows of 137 modules: 70.5 × 18.5 mm at the default 0.5 mm module, with its quiet zone. A PDF417 grows in width as well as height, so it suits a long, low space on a label.

An Aztec code for a ticket

Type
Aztec
Text
TKT-2026-000481

A ticket reference makes a 19 × 19 Aztec code, 9.5 × 9.5 mm at the default 0.5 mm module. It needs no quiet zone, so that is the size of the symbol alone; a little clear space from the ticket's other print still helps a reader find it.

Sizes, capacities and GS1 module sizes

Square Data Matrix symbols, modules without the quiet zone, and the most each holds
SizeDigitsCapitals and digitsBytes
10 × 10631
12 × 121063
14 × 1416106
16 × 16241610
18 × 18362516
20 × 20443120
22 × 22604328
24 × 24725234
26 × 26886442
32 × 321249160
36 × 3617212784
40 × 40228169112
44 × 44288214142
48 × 48348259172
52 × 52408304202
64 × 64560418278
72 × 72736550366
80 × 80912682454
88 × 881,152862574
96 × 961,3921,042694
104 × 1041,6321,222814
120 × 1202,1001,5731,048
132 × 1322,6081,9541,302
144 × 1443,1162,3351,556
Rectangular Data Matrix symbols
SizeDigitsCapitals and digitsBytes
8 × 181063
8 × 3220138
12 × 26322214
12 × 36443120
16 × 36644630
16 × 48987247
GS1 DataMatrix module size (X) by where it is scanned, mm
Scanned atGS1 tableMinimumTargetMaximum
Healthcare retail packs10 (Table 5-56)0.3960.4950.990
Healthcare items not sold at retail6 (Table 5-52)0.2540.3800.990
Healthcare items also scanned in warehouses8 (Table 5-54)0.7500.7501.520
Shop packs, beside the EAN/UPC1 (Table 5-46)0.3960.4950.990
Shop packs also scanned in warehouses3 (Table 5-49)0.7430.9900.990
Warehouses only (outer cases)2 (Table 5-47)0.7430.7431.500
Pallets and shipments (logistic units)5 (Table 5-51)0.7430.7431.500
Assets, documents and locations9 (Table 5-55)0.3750.3750.743
Patient wristbands and service relations (GSRN)11 (Table 5-57)0.2540.3800.495
EU tobacco unit packs12 (Table 5-58)0.3800.3800.990
EU tobacco cartons and logistic units12 (Table 5-58)0.7500.7501.520
Durable labels and marking13 (Table 5-59)0.495—3.500

Where the rules come from

GS1 DataMatrix's features, sizes and capacities, its 1X quiet zone, the module sizes for each use (§5.12.3), the character set most AIs take (Table 7-20), a date's day 00 meaning the end of the month (§3.4), the century of a two-digit year (within 49 years before and 50 after the current one, §7.12) and the human-readable text (§4.14) come from the GS1 General Specifications. Each AI's format and GS1 title come from the GS1 Barcode Syntax Dictionary; BWIPP's GS1 linter, built on the same dictionary, checks lengths, dates and which AIs must or must not appear together.

The direct part marking table (7), for codes marked straight onto metal or plastic, and the tables for GS1 keys other than trade items, GSRNs, EU tobacco and durable marking are not offered.

Sources

Reviewed

Frequently asked questions

Every phone camera reads a QR code, so it suits anything the public scans, such as a link. A Data Matrix is smaller for the same data and is what industry readers expect, and GS1 approves GS1 DataMatrix for regulated healthcare items. For a link, use the QR Code Generator.
On a narrow strip, such as the edge of a pack, a tube or a cable label, where a square of the same data would be too tall. Rectangles hold at most 98 digits; longer data needs a square.
MaxiCode, a fixed-size code of hexagons made for sorting parcels, is left out, as are Micro QR and the extended rectangular Data Matrix sizes of ISO/IEC 21471. The four types here cover labels, packs and tickets.

See also