What a Data Matrix code is
Data Matrix is a 2D barcode made of square cells in a grid, square or rectangular. You can spot it by the solid L-shaped border on two sides and the dotted pattern on the other two. The L shows a scanner which way up the code is, and the dotted edges set the grid size.
The modern version, ECC 200, uses Reed-Solomon error correction, so it still reads when part of the code is scratched or smudged. A single symbol holds up to 3,116 digits or 2,335 letters and numbers, though most real uses encode a serial number or short ID.
Where Data Matrix codes are used
Because the code can be marked directly onto the item, it stays readable for the life of the part, long after a paper label would have peeled off. That is why engineering and medical device standards often specify it.
- Electronics: printed or laser-etched on circuit boards and components only a few millimetres across.
- Aerospace and automotive parts: marked straight into metal by dot peen or laser for lifetime tracking.
- Healthcare and medicines: packs carry serialised codes so each box can be checked as genuine.
- Post and logistics: many postal services print Data Matrix franking and tracking marks.
How to generate a Data Matrix code
- Choose Data Matrix in the generator.
- Type your data, such as a part number and serial like PN4471-SN000213.
- Watch the preview. More characters mean more rows and columns.
- Download SVG if the code will be etched, engraved or scaled; PNG for labels and documents.
- Leave a blank margin of at least one cell width around the code, and test it at its final size.
Sizing and marking tips
- Cell size: for printed labels, cells of 0.25 mm or more read well with most imagers. Smaller needs a high-resolution reader.
- Contrast: dark on light is easiest. Laser-etched metal works, but test under the lighting where it will be scanned.
- Square or rectangle: rectangular Data Matrix suits long, narrow spaces such as a cable or tube.
- Keep the data short. A shorter string gives fewer, larger cells at the same printed size, which reads more reliably.
Data Matrix vs QR code
Both are 2D codes, but they suit different jobs. Data Matrix has no large corner squares, so for short data it is smaller than a QR code and fits on tiny parts. QR codes are better for anything the public will scan, because every phone camera app reads them. Many phones do not read Data Matrix from the camera app, though our scanner does, in the browser.
If you need a GS1 DataMatrix with application identifiers for medicine packs, note that this data matrix generator makes standard Data Matrix. GS1 formatting is not a dedicated option yet.