free tool · data matrix code generator · nothing leaves your browser

Data Matrix code generator

Small, dense codes for parts, lots and packs.

A Data Matrix code fits a long lot or serial number into a few millimetres and still reads when part of it is scratched. Make plain Data Matrix codes for your own labels, or GS1 DataMatrix codes that carry a product number, batch, expiry date and serial number. Free, and nothing you type leaves your browser.

code type

Small and dense, and still reads when part of it is damaged. Needs a 2D scanner or a phone.

Printing opens your browser's print window. Choose your label printer, or “Save as PDF” to get a PDF of the labels. Set the scale to 100% (“actual size”), and print one sheet on plain paper first to check it lines up.

loading the generator…

what data matrix is

What a Data Matrix code is

Data Matrix is a 2D code: a square of small black and white cells with a solid L-shaped edge on two sides, which tells the scanner which way up the code is. Because it stores data in both directions, it holds far more than a linear barcode of the same size.

Holds
Up to 3,116 digits or 2,335 letters and digits in the largest size
Size
From 10 × 10 cells upwards. Short values make small codes
Damage
Built-in error correction rebuilds the data when part of the code is scratched, dirty or missing
Margin
A blank border at least one cell wide on every side. The generator adds it
Scanners
2D imagers and most phone scanner apps. Not older laser scanners
Standard
ISO/IEC 16022

where manufacturers use it

Where manufacturers use Data Matrix

  • Small parts and circuit boards. Where there's no room for a barcode, a Data Matrix code a few millimetres wide still carries a full serial number.

  • Marking directly on metal or plastic. Laser and dot-peen marking machines engrave Data Matrix codes because they survive handling, heat and oil better than a label. The generator makes the artwork; the marking machine does the engraving.

  • Lot and serial labels on small packs. One code can hold the lot number, the date and the serial number together.

  • Packs that need GS1 data. GS1 DataMatrix puts the product number, batch, expiry and serial number in one code, in a format buyers' systems can read.

gs1 datamatrix

GS1 DataMatrix: product number, batch, expiry and serial

Choose GS1 DataMatrix in the generator's list of code types. Type each piece of data behind its GS1 code in brackets, for example:

(01)12001234567890(17)271231(10)LOT42(21)SN0001

CodeWhat follows itFormat
(01)Product number (GTIN)14 digits, issued to your company by GS1
(17)Expiry dateYYMMDD, for example 271231
(11)Production dateYYMMDD
(10)Batch or lot numberUp to 20 letters and digits
(21)Serial numberUp to 20 letters and digits

The generator checks the GTIN's check digit and the dates, and tells you which bracketed code is wrong. The sample uses a number from GS1's in-store range, so it doesn't belong to any real product. Print your own GTINs only. To get them, read GS1 barcode registration in India.

Check your own rules first. Some products, such as medicines, have their own rules in India for what the code must hold and where it goes on the pack. This page doesn't cover them. Check the current rules for your product with the regulator, and your customer's label specification, before you print.

data matrix or qr code

Data Matrix or QR code?

Both are 2D codes. Choose by who scans it and how much room you have.

Data MatrixQR code
Size for a short valueSmallerLarger: its three corner squares need room
PhonesMost scanner apps; not every built-in cameraEvery phone camera
Best forParts, lots and packs scanned in the supply chainLinks that people open on a phone
Marking on metalCommonRare

For links to drawings, manuals or a product page, use the QR code generator.

codes that scan

Print and mark codes that scan

  • Don't stretch it. Keep the code square when you place it on a label or artwork; resize it from a corner.

  • Use the SVG for artwork and marking. It stays sharp at any size. A small PNG blown up turns blurry.

  • Give each cell enough dots. On a 203 dpi thermal printer, very small codes lose their cells. If it won't scan, make the code bigger or shorten the value.

  • Keep the border clear. Text or a pack edge touching the code makes it hard to read.

  • Test on the real surface. Shiny, curved or textured surfaces read differently from paper. Test before a full run.

more free barcode tools

questions — and what the scan connects to

Traceability is a question, not a label.

When a customer asks which heat a part came from, the code gives you a lot number. Finding the answer still means opening the lot register, the test certificate in an email and the job card on someone's desk.

We build custom systems for small and medium manufacturers that bring that trail into one place, and your team uses them through Youno, a work chat app as simple as WhatsApp. Then the answer is one scan away.

Book a call
How much can a Data Matrix code hold?

Up to 3,116 digits or 2,335 letters and digits in the largest size. Labels rarely need more than a few dozen characters, and a short value gives a smaller code that's easier to print and scan.

Can my scanner read Data Matrix?

Only if it's a 2D imager. Older laser scanners read linear barcodes only. Most phone scanner apps read Data Matrix, but not every phone's built-in camera does.

What's the difference between Data Matrix and GS1 DataMatrix?

GS1 DataMatrix is a Data Matrix code with a special first character and data in GS1's format: each piece of data sits behind a code in brackets, such as (01) for the product number and (17) for the expiry date. Use plain Data Matrix for your own labels and GS1 DataMatrix when a customer or a rule asks for GS1 data.

Do I need GS1 numbers for a Data Matrix code?

Not for plain Data Matrix: you can put your own lot or serial numbers in it. GS1 DataMatrix carries a product number (GTIN), which must be issued to your company by GS1 India.

Can I use these codes for laser marking?

Download the code as an SVG, which stays sharp at any size, and import it into your marking machine's software. Check which file formats your machine accepts, and test-mark a part before a run.

Can I make Data Matrix codes in bulk?

Yes. Switch to “Many labels” and paste a list from Excel, upload a CSV or number a run of serials. Then print the labels, or download every code in one ZIP.