What a Data Matrix code is
A Data Matrix is a two-dimensional barcode: instead of a row of bars it stores data in a grid of small square cells, called modules, each either dark or light. You can recognize one by its border. Two neighboring sides are solid dark lines that form an L, which tells the reader where the code is and how it is turned, and the two opposite sides alternate dark and light like the marks on a ruler, which tells it how many rows and columns there are. Inside that frame sits your data, plus error-correction data calculated from it.
That error correction is the reason Data Matrix became the standard for marking things that get dirty or scratched. A code with a smudge, a scratch or a damaged corner usually still reads, because the reader rebuilds the missing modules from the extra data. The version in use today is called ECC 200, and it comes in square sizes from 10 × 10 modules up to 144 × 144, plus rectangular shapes for long, narrow spaces (this generator makes the square sizes). Codes marked straight onto metal or plastic with a laser or a dot-punching pin, common in factories, follow their own rules; this generator makes codes for printing on labels, tags and packaging.
Data Matrix, QR code or a 1D barcode
QR codes and Data Matrix codes look alike at first glance, but they were built for different jobs. A QR code has three large squares in its corners so that a phone camera can find it in a busy picture, and the smallest QR code is 21 × 21 modules with a light margin four modules wide. A Data Matrix starts at 10 × 10 modules and needs only a narrow margin, so for a short serial number it takes a fraction of the space. That is why Data Matrix turns up on electronics, tools and medicine packs, and QR codes on posters, menus and anything the public is meant to scan.
The practical rule follows from who will do the scanning. If customers will point their phone at the code, use the QR code generator, because that is the code phone cameras look for. If your staff or your customers' systems will scan it with a barcode scanner, and the space is small or the data longer than a few characters, Data Matrix is the better fit.
A 1D barcode such as Code 128 still has one advantage: nearly every scanner can read it, including laser scanners that sweep a single red line and can't read matrix codes such as Data Matrix or QR. If your warehouse or shop still uses those, a Code 128 label works with what you have, while a Data Matrix needs an imaging scanner, the kind that takes a picture. The barcode generator makes both, so you can compare the sizes for your own data.
Plain Data Matrix or GS1 DataMatrix
Both types on this page draw the same kind of symbol, and the difference sits at the very start. A GS1 DataMatrix begins with a special signal called FNC1, which tells the receiving system that the content follows the GS1 rules: a series of fields, each introduced by an application identifier, a short number such as (01) for the product number or (17) for the expiry date. The brackets you type, like the ones printed beside the code for people to read, aren't stored in the code itself. A plain Data Matrix has no such signal, so typing (01) into it just stores ordinary text and doesn't make it a GS1 code.
You need GS1 DataMatrix when someone else's system will read your code and expects GS1 data, which is the case on medicine packs and medical devices and wherever a customer's supplier requirements ask for it. On medicine packs in many countries it carries the product number, the expiry date, the batch and a serial number unique to each pack, for example (01)09501101530003(17)261231(10)AB-123(21)0001. The number in (01) has to be a GTIN licensed from GS1. For tool tracking, your own serial numbers and anything else that stays inside your business, a plain Data Matrix is simpler.
The field builder helps you put the GS1 version together. You pick each field from the list, and the generator checks lengths, the check digit of numbers like the GTIN and the YYMMDD format of dates. It also pays to put fields with a fixed length, such as (01) and (17), first and variable ones, such as batch and serial number, last, because a variable-length field in the middle of the code needs an extra separator after it.
How much it holds and how big it gets
At its largest size a Data Matrix holds up to about 3,100 digits or 2,300 letters. The generator here accepts up to 1,000 characters per code, which is still far more than a label needs, since every character makes the code grow. Extra rows and columns of modules make the square bigger at the same print size, so the useful question is not how much fits but how small you want the code to be. The answer is usually a short key, such as a serial number your system can look up, rather than a whole record that would also need a new code every time it changed.
What you store changes the size as well. Digits take the least room, because the code packs them in pairs, while letters and punctuation take more, and accented letters or other alphabets take the most. A code of 16 × 16 modules, for example, holds about two dozen digits. With modules of half a millimeter, the starting size on this page, it is 8 mm across, or about 10 mm with its light margin of two modules on every side; with modules of a quarter millimeter the same code is about 5 mm across, margin included.
Printing small codes that still read
Small Data Matrix codes depend on the printer more than on anything else. Every module has to come out as a clean square, and printers build squares from whole dots: a 203 dpi thermal printer makes dots of about 0.125 mm, so modules of two dots (0.25 mm) or four dots (0.5 mm) come out even, while a module of 0.3 mm would mix two-dot and three-dot cells. Choose your printer in the size settings and the generator snaps the module width to whole dots for 203, 300 or 600 dpi. A 300 or 600 dpi printer can go smaller, but the label stock matters too, since ink that spreads on soft paper fills in the light modules.
Contrast comes next: print dark modules on a light background. The scan check warns when it is the other way round, because although many 2D readers handle a light code on a dark background, plenty of setups don't. For very small codes matte labels are safer than glossy ones, since a reflection across a few modules can hide them from a reader held at the wrong angle.
The last check is the reader itself. Data Matrix needs an imaging scanner or a phone with a barcode-scanning app, and red-line laser scanners can't read it at all. Before you print a whole roll, print one label and scan it with the scanner that will really be used, at the distance and angle it will be held. When it reads well, Print on labels takes the code to the label editor at the module width you set, for example on a 2×1″ thermal label, and the page on barcode labels covers the label side.
Make your barcode and put it on labels
Make the barcode at the top of this page, check that it scans, then press Print on labels: the free label editor opens with it on the label you pick, ready to print on a sticker sheet or a label printer.
Make a barcode ↑FAQ
Does a Data Matrix code need a check digit?
Not for the code itself, because its error correction already catches and repairs reading errors. Numbers stored inside it can still carry their own check digit, such as the GTIN in a GS1 DataMatrix, and the generator checks that one for you. For your own serial numbers in a plain Data Matrix, a check digit is optional.
Can I put accented letters or other alphabets in a Data Matrix?
Yes. Text in other scripts is stored as UTF-8, which most phone apps read correctly, though some readers show the wrong characters, so test with the scanner that will read it. Some older handheld scanners only understand plain ASCII, meaning unaccented letters, digits and common punctuation, so keep to those when the code will be read by scanners you don't control.
Can I make a Data Matrix for every serial number in a list?
Yes. Switch the generator to Many barcodes, keep Data Matrix as the type, and paste your serial numbers, open a spreadsheet or let the generator number them for you, for example from SN-000001 upwards. You can download every code in one ZIP file or send the list to the label editor with one label per row; printing a whole list there needs a free account.
Does it matter which way round the code is printed?
No. Readers find the code by its solid L-shaped edge, so it reads upside down, sideways or at an angle. That makes Data Matrix a good choice for labels on round parts or tags that hang at random angles, as long as the code itself lies flat and isn't stretched.
Related pages
Updated 9 November 2026