Data Matrix code generator
Data Matrix stores data in a square of light and dark cells framed by a solid L on two sides and a dashed clock track on the other two. It is the code you pick when the marking area is measured in millimetres. Three things get it there: the frame does the job that QR spends three corner blocks on, one module of quiet zone around the symbol is enough where QR wants four, and among the small sizes the grid steps up two modules at a time where QR steps four, so a short payload is not rounded up into a much larger square. That is why Data Matrix ends up etched on circuit boards and machined parts while QR goes on posters.
Appearance
160 × 160 px in the PNG
Specification
- Character set
- any data
- Length
- from 1 to 2335 characters
- Check digit
- not used by this symbology
Generate Data Matrix barcodes in bulk
Got a whole list of values rather than one? Generate Data Matrix barcodes in bulk
Where it is used
- Direct part marking on metal, laser etched or dot peened, so the identifier survives the oil, heat and handling that would destroy a printed label
- Electronic components and bare boards, where the entire area available for marking is a few millimetres square
- Medical device and pharmaceutical packaging, where a GTIN, expiry date, batch and serial all have to share a panel with the printed text
How it compares
QR Code is the real alternative, and capacity is rarely what decides between them. Three things do. Space: Data Matrix needs one module of quiet zone per side and spends its overhead on a border, while QR needs four modules and three corner blocks with white separators — on a short payload in a small window that gap decides whether the code fits at all. Readers: phone cameras and consumer apps are built around QR's corner squares, whereas Data Matrix is the industrial default and reading it off etched metal takes a scanner with the right illumination. Tuning: QR offers four error-correction levels to choose from, ECC 200 fixes one and spares you the decision. The rule that holds up in practice — if a person with a phone scans it, use QR; if a machine scans it off something small, use Data Matrix.
Common mistakes
- Judging a direct part mark with an ordinary scanner. An etched or peened mark has no ink contrast at all — it reads because light scatters differently out of the cells than off the surface around them. A general-purpose reader points its illumination straight at the part, gets a flat reflection back and reports a perfectly good mark as unreadable.
- Specifying a cell smaller than the marking tool itself. A dot-peen pin has a diameter and a laser has a spot; below that size neighbouring cells run into each other and the grid stops being a grid. A printed label has a floor of its own for a different reason — at 300 dpi one dot is 0.085 mm, so a two-dot cell of 0.17 mm is as fine as the printer can place reliably.
- Sending a rectangular symbol to a reader that was never told to expect one. ECC 200 defines six rectangular sizes alongside the twenty-four square ones, and rectangular decoding is a separate setting on fixed-mount readers rather than something that comes on by default.
- Treating the one-module quiet zone as a rounding error. Data Matrix asks for so little of it that a layout eats it without anyone noticing — and the solid L that tells the reader where the grid begins sits directly on that boundary, so what gets damaged is the finder itself, not a margin around it.
Frequently asked questions
- How much data fits into a Data Matrix?
- ECC 200 tops out at 3116 digits, 2335 alphanumeric characters or 1556 bytes, and that is at the largest square size of 144 by 144 modules. In practice the ceiling is irrelevant — on a small part the printable cell size runs out long before the encoding does.
- Can a damaged symbol still be read?
- Usually. ECC 200 carries Reed-Solomon error correction, so a scratched or partly covered symbol still decodes. What it cannot survive is damage to the frame: the solid L on two sides tells the reader where the grid starts, and the dashed track on the other two tells it how many cells there are.
- Why did I get a square when I wanted a rectangle?
- The encoder picks a symbol size that fits the data, and there are twenty-four square sizes running from 10 by 10 up to 144 by 144 modules. Rectangles exist, but only six of them, and an encoder falls back on a square unless it is explicitly set to produce one — rectangles are meant for a narrow marking window, not handed out by default.
- Does Data Matrix need a check digit?
- Not the way a UPC or EAN does. There is no digit you calculate and append to your data — detection and correction are built into the encoding and spread across the whole symbol, which is also why a partly damaged code still reads.