Data Matrix Generator
Make a Data Matrix code from any text, or a GS1 DataMatrix with GTIN, expiry, batch and serial number. GS1 fields are checked as you type. Free PNG and SVG.
Loading the barcode engine…
Made in your browser: the value you type is not sent anywhere. Scan a test print before you print in bulk.
Need a code your customers can scan with a phone?
A QR code opens straight in the phone camera. Make it dynamic and you can change where it points after printing.
- Update destination anytime
- Never reprint physical materials
- Pay once, own for life
How to Make a Data Matrix Code
1. Choose plain or GS1
Plain Data Matrix for any text, part number or link. GS1 DataMatrix for products and medicines, with fields like GTIN, expiry and batch.
2. Enter the data
For GS1, write each field as its number in brackets followed by the value. The GTIN check digit, dates and field lengths are checked as you type.
3. Download PNG or SVG
SVG for print, labels and laser marking files; PNG for documents and label software.
What a Data Matrix code is
Data Matrix is a square 2D barcode. Two sides have a solid L-shaped border that tells the scanner where the code is and which way up it is; the other two sides alternate dark and light so the scanner can count the grid. Built-in Reed-Solomon error correction lets it be read even when part of it is scratched. The smallest Data Matrix is 10×10 squares and the largest 144×144, which holds up to 2,335 letters or 3,116 digits.
Because it stays readable at very small sizes, it is used where space is tight: circuit boards and electronic parts, metal parts marked by laser or dot-peen, and medicine packs.
GS1 DataMatrix: GTIN, expiry, batch and serial
GS1 DataMatrix is a Data Matrix whose content follows GS1 rules, so any system that reads it knows which number is the product, which is the expiry date and so on. Medicine packs in the EU and the US carry one with the product code, batch, expiry and a unique serial number. Each field starts with its GS1 Application Identifier (AI):
| AI | Field | Format |
|---|---|---|
| (01) | GTIN | 14 digits, with a valid check digit |
| (17) | Expiry date | YYMMDD, e.g. 271125 for 25 Nov 2027 |
| (10) | Batch or lot | Up to 20 characters |
| (21) | Serial number | Up to 20 characters |
| (11) | Production date | YYMMDD |
Type them one after another, for example (01)03453120000011(17)271125(10)ABCD1234(21)XYZ987. The brackets are not stored in the code; the generator adds the special separator characters GS1 requires between fields. If a GTIN has a wrong check digit, a date is impossible or a field is too long, you'll see the error before anything is drawn.
For regulated labels
This tool makes a correctly encoded code. Pharmaceutical and medical-device labels usually also need the printed result graded with a barcode verifier, which measures print quality on the actual label. Use the generated SVG as your artwork, then verify the printed labels as your quality process requires.
Data Matrix or QR code?
Both are square 2D codes. Data Matrix is smaller for short data and is the standard for parts marking and medicines. QR codes are what phone cameras are built to look for, so for anything customers will scan (a website, menu or manual), use a QR code from the free QR code generator. For linear barcodes, see the barcode generator.
Frequently Asked Questions
Is this Data Matrix generator free?
Yes. Plain and GS1 Data Matrix codes are free to make and download as PNG or SVG, with no account and no watermark. Codes are made in your browser and the data is not sent to a server.
What is the difference between Data Matrix and GS1 DataMatrix?
They look the same. Plain Data Matrix can hold any text. GS1 DataMatrix holds GS1 fields, such as GTIN (01), expiry (17), batch (10) and serial number (21), with special separator characters, so pharmacy, hospital and warehouse systems can read each field.
How do I enter an expiry date?
Use AI (17) followed by the date as YYMMDD. For 25 November 2027, write (17)271125. The generator rejects impossible dates such as month 13.
Can a phone scan a Data Matrix code?
Many barcode scanner apps read Data Matrix. Phone camera apps are built mainly for QR codes, so if consumers need to scan the code, use a QR code instead.
How small can a Data Matrix code be?
It depends on how much data it holds and how well it is printed or marked. Short data gives a smaller grid, which can be printed smaller. Test with the scanner your users will have before printing in bulk.
Recommended Guides
Technical best practices and printing guidelines from our engineering team.
QR Codes on Product Packaging: Design, Size and Compliance
Master QR code implementation on retail boxes, bottles, pouches, and cartons: substrate absorption, curved surface distortion, regulatory compliance, and dynamic manuals.
Product Authenticity QR Codes: How Serial QRs Help Catch Counterfeits
A hologram sticker can be reprinted. A serial QR code that counts its own scans can’t be copied without giving itself away. Here’s how authenticity QR codes work, and what they can and can’t do.
How to Test a QR Code Before Printing: A Checklist
Avoid catastrophic print reruns with our 7-point pre-flight checklist: 100% scale proofing, multi-device camera verification, glare tests, and destination flexibility.
More Free QR Tools
Explore our suite of client-side QR utilities.
Free QR Code Generator
Generate instant static QR codes for URLs, Wi-Fi, contacts, SMS, and text.
QR Code Scanner Online
Scan and decode QR codes directly in your browser from an image or live camera.
Can You Change This QR Code?
Upload any QR code to find out if its destination can be updated after printing.
QR Code Size Calculator
Calculate the minimum and recommended physical print size based on scan distance.