Skip to main content
New code
New code

Data Matrix Code: What It Is and How to Create One

A Data Matrix code (also written "datamatrix", or DMC) is a two-dimensional barcode made of square black and white modules arranged in a grid. It stores text or numbers in a small space and keeps working when part of the symbol is scratched, dirty or worn, which is why it is printed on tiny parts, medicines and electronic boards.

Create a Data Matrix code for free

How a Data Matrix code works

The most common version is ECC 200, defined in ISO/IEC 16022. Two solid edges of the grid form an "L" that tells a reader where the code starts and which way it is rotated, and the other two edges alternate dark and light modules that give the reader its timing. Inside, your data is converted to bytes, protected with Reed-Solomon error correction and written as dark and light modules. Because of that redundancy, a reader can often recover the data even if part of the symbol is damaged.

A code can be a small square of 10 by 10 modules or grow up to 144 by 144, and the largest size can hold up to 3,116 digits or 2,335 ASCII characters (1,556 bytes of data). There are also rectangular sizes. Around the symbol you need a blank border called the quiet zone, at least one module wide, so that a reader can find where the code ends.

Where Data Matrix codes are used

  • Electronics: tiny codes on circuit boards and components, where space is very limited.
  • Pharma and medical devices: serial numbers and batch data on packaging and on the devices themselves.
  • Aerospace and defense: permanent marks on parts, applied directly to the metal.
  • Logistics and industry: labels for tracking parts, tools and shipments.

If you are choosing between formats, read Datamatrix vs QR Codes. For the rules behind marking, see Datamatrix Marking and Standards.

How to create a Data Matrix code online

  1. Open the generator and type or paste your text, one code per line (ASCII text only).
  2. Pick the colors and the quiet zone if you want to change them, then preview your codes.
  3. Download a single code as a PNG, or export all of them as a PDF or a ZIP of PNG images.

This generator accepts up to 1,550 characters per code. The tool is free, needs no account and you can generate up to 500 codes in one go, so it works for a single label or for a whole batch. The PNG images have no watermark.

Keep reading

Open the Data Matrix generator