Skip to the tool
UPC Generator

Data Matrix generator

A Data Matrix can hold 1,556 bytes at its largest, or fit a part number in a square under 5 mm wide. Whatever you type, the smallest size that fits is picked for you and tells you how big it prints.

What goes in it

0.39 in (9.9 mm) wide by 0.39 in (9.9 mm) tall, clear space included

Data Matrix code PN 88421 REV C SN 000731

Any text is fine for your own parts and labels. GS1 product data needs a GTIN licensed to your company through GS1, and GS1 does not allow internal-range numbers in this mode. The route to a licensed number is in how to get a UPC code.

  • Module: 0.495 mm (19.5 mil)
  • Clear space: 0.019 in (0.49 mm) left, 0.019 in (0.49 mm) right at minimum
  • PNG at 300 dpi: 120 by 120 dots, module 6 dots, so it prints at 0.508 mm
More options
Show sizes in

What scanners look for in your code

  • The solid L tells a scanner where the code is and which way up it sits.
  • The dashed edges count the rows and columns, so the scanner knows the grid size.
  • Everything inside is your data, plus Reed-Solomon error correction that repairs damage.

By the UPC Generator team. Drawn by bwip-js (MIT license), matched against its raw output, with sample files read back by two decoding programs. The capacity table is what the tool itself holds. Last updated 4 November 2026. How UPC Generator pages are made.

How much a Data Matrix holds

Capacity jumps in steps, because the code can only be certain sizes. These limits are what the tool itself holds, measured one character at a time. Digits pack tightest, because the code stores them in pairs. Capitals come next, and bytes such as accented letters take the most room.

Square Data Matrix sizes and what each holds
Modules Digits Capitals Bytes
10 x 10 6 3 1
12 x 12 10 6 3
16 x 16 24 16 10
18 x 18 36 25 16
24 x 24 72 52 34
32 x 32 124 91 60
48 x 48 348 259 172
88 x 88 1,152 862 574
144 x 144 3,116 2,335 1,556

Rectangles suit narrow places such as the edge of a board, but they top out early:

Rectangular Data Matrix sizes and what each holds
Rectangle Digits Capitals Bytes
8 x 18 10 6 3
8 x 32 20 13 8
12 x 36 44 31 20
16 x 48 98 72 47

Module size and print size

The size of the whole code is modules times module size. The sample text, PN 88421 REV C SN 000731, is 24 characters and comes out at 18 x 18 modules. With a 0.495 mm module, that is 8.91 mm across, or 9.9 mm counting clear space.

GS1 sets a range for codes on trade items. For a code scanned at a retail checkout it is 0.396 mm to 0.990 mm with a 0.495 mm target. For a code that only carries a web address for shoppers it is 0.396 mm to 0.743 mm. For general distribution it is 0.743 mm to 1.5 mm. Outside GS1 use you can go smaller, as long as your printer and scanner can cope. Under about 0.25 mm, print a test before you commit.

GS1 mode, without the jargon

GS1 data is written as pairs: a short number that says what comes next, and then the value. Those short numbers are called Application Identifiers. The form builds the string for you and checks your GTIN's last digit.

GS1 application identifiers the GS1 mode accepts
Identifier What it holds Example
(01) GTIN, always 14 digits (01)09521234543213
(17) Expiry date as YYMMDD (17)281231
(10) Lot or batch, up to 20 characters (10)L2411A
(21) Serial number, up to 20 characters (21)000731

The GTIN must be one your company holds. GS1 does not allow its internal-use ranges in this format, so the form refuses them. For parts and assets of your own, use Any text. Numbers starting with 952 are GS1's own demo range, which is why the sample uses one.

Where the small size pays off

Electronics makers mark circuit boards with Data Matrix, and the Electronic Industries Alliance recommends it for small components, according to Wikipedia. It is also what you want when a QR code will not fit, because its clear space is a quarter as wide.

For long text on a label that a line scanner must read, a PDF417 code is the alternative. If you only need a short code on a stock label, a Code 128 barcode is simpler and a laser scanner can read it. Compare all of them against your own text with the barcode generator.

Getting a clean print

Keep modules square. Stretching the file to fit a space can stop a code reading. Use dark ink on a light background, and leave the 1 module of clear space all the way around. A small module on a 203 dpi printer rounds to few dots. So check the PNG readout, which says what each module becomes at your resolution.

Where Data Matrix sits among 2D codes

Data Matrix and QR Code are read as pictures rather than along a line. PDF417 is a stack of rows that some sweeping line scanners can read. What a 2D barcode is sets out which one suits which job, and why retail checkouts are being upgraded to read them. The GS1 mode produces a GS1 DataMatrix, one of the symbols in the GS1 barcode family.

Data Matrix questions

Is a Data Matrix the same as a QR code?

No. Both are square 2D codes, but a Data Matrix has a solid L on two edges where a QR code has three large squares. A Data Matrix needs only 1 module of clear space against a QR code's 4, so it fits smaller parts.

Can a phone scan a Data Matrix?

Many can, though not always with the built-in camera app, which often looks for QR codes first. A barcode scanning app reads them reliably. Test with whatever device will read your codes in daily use.

What is the difference between Data Matrix and GS1 DataMatrix?

They draw the same kind of symbol. GS1 DataMatrix starts with a special character that tells a scanner the contents follow GS1 rules. A system can then split out the GTIN, expiry date and lot. Any text mode writes plain characters with no such marker.

How small can a Data Matrix be?

That depends on your printer far more than the format. A 12 x 12 code at a 0.25 mm module is 3 mm across, and printers at 600 dpi can manage it. For GS1 product use, stay at 0.396 mm or larger.

How much damage can a Data Matrix survive?

It carries Reed-Solomon error correction, which can rebuild missing parts of the data. How much depends on the size, and the format does not offer a setting for it the way QR and PDF417 do. The solid L and dashed edges need to stay intact, so protect the outer edges.

Why do my parentheses disappear in GS1 mode?

The parentheses are only a way of writing the data for people. A scanner receives the numbers, with a separator where a variable-length item ends. People often print the same data with parentheses in text beside the code, so it stays readable.

3 source documents

  1. GS1: General Specifications, Release 26.0, sections 5.6, 5.12.3.1 and 5.12.3.2, fetched 2 November 2026
  2. bwip-js: Barcode writer library, MIT license, version 4.11.4, fetched 2 November 2026
  3. Wikipedia: Data Matrix, fetched 2 November 2026