Where Data Matrix is used
Data Matrix is the 2D code of industry. It was designed to be marked directly onto parts and read by fixed cameras, and it is the required format in several regulated sectors.
- Electronics: printed circuit boards and components, where there is no room for a linear barcode.
- Medical devices and medicines: device identifiers on instruments and the serialised codes on prescription packs.
- Aerospace and automotive: dot-peened or laser-etched codes on metal parts that last the life of the part.
- Laboratories: sample tubes and slides.
- Small retail items: jewellery tags, cosmetics and anything too small for a UPC.
How to read the pattern
Every Data Matrix has the same frame. Two edges are solid lines forming an L, called the finder pattern, which tells the reader where the code is and which way up. The other two edges alternate dark and light, called the clock track, which tells the reader how many rows and columns there are. Everything inside is data and error correction.
Size depends on how much you put in
The code grows in steps as content gets longer. Short content gives a small grid with large cells, which is easy to print and read.
| Grid | Digits only | Letters and digits |
|---|---|---|
| 10 x 10 | 6 | 3 |
| 12 x 12 | 10 | 6 |
| 14 x 14 | 16 | 10 |
| 16 x 16 | 24 | 16 |
| 18 x 18 | 36 | 25 |
| 20 x 20 | 44 | 31 |
| 24 x 24 | 72 | 52 |
Digits pack tighter than letters, and capitals pack tighter than mixed case. If you control the format of your part numbers, all-numeric or all-capital codes give you the smallest mark.
Printing and marking tips
- Quiet zone: leave clear space of at least one cell on every side. Two is safer.
- Cell size: match it to your reader. Phone cameras need cells of roughly 0.5 mm or larger. Industrial readers go much smaller.
- Contrast: dark on light is the default. Laser marking on metal often produces light on dark, which readers handle, but test it.
- Use the SVG: a 2D code must keep its cells square. Vector output scales cleanly, while a resized PNG can blur cell edges.
- Do not stretch it: a Data Matrix must stay square. Readers tolerate tilt and curve, but not a squashed grid.
Data Matrix or a linear barcode?
Use Data Matrix when space is the limit or when the mark has to survive damage. Use a linear barcode when the reader is a basic laser scanner, which cannot read 2D codes at all. For stockroom labels read by handheld scanners, Code 128 is usually the simpler choice. For traceability data on cartons, see GS1-128. To confirm a printed code decodes to what you expect, photograph it and use the online barcode scanner.