Skip to content
UPC Maker

Data Matrix Generator

Data Matrix packs a part number, a serial or a whole line of text into a square a few millimetres across. Type your content and download a code that stays readable when it is tiny, curved or partly scratched.

Your barcode appears here.

Free, no sign-up, no watermark. Barcodes are drawn in your browser and nothing you type is uploaded.

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.
Square Data Matrix code with a solid L-shaped border on the left and bottom edges encoding a part number and lot
A Data Matrix holding a part number and lot. The solid L on two sides is how a reader finds it.

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.

GridDigits onlyLetters and digits
10 x 1063
12 x 12106
14 x 141610
16 x 162416
18 x 183625
20 x 204431
24 x 247252

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.

Frequently asked questions

How is Data Matrix different from a QR code?

Both are 2D codes. Data Matrix is smaller for short content and is the standard for marking parts, medical devices and electronics. QR codes are built for phone cameras and web links. If a person with a phone will scan it, use QR. If a machine on a production line will scan it, use Data Matrix.

How small can a Data Matrix be printed?

It depends on the printer and the reader more than the code. Industrial readers handle cells of around 0.25 mm, which puts a short part number in a square of about 3 mm. For an office printer and a phone camera, keep the whole code at least 10 mm wide.

How much can a Data Matrix hold?

The largest symbol holds up to 2,335 letters and digits. In practice, keep content short. Every extra character makes the cells smaller at a given print size, which makes the code harder to read.

What does ECC 200 mean?

It is the current version of Data Matrix, using Reed-Solomon error correction. A code can lose a meaningful part of its area to dirt or damage and still decode. Every Data Matrix made here is ECC 200.