Free Data Matrix Code Generator
Encode text, IDs or serial numbers in a tiny square. Create a Data Matrix code in seconds and download PNG or SVG for labels, parts and packaging.
选择条形码格式
输入内容
调整外观
预览条形码
贴在商品标签上的效果
Overview
What is a Data Matrix code?
A Data Matrix code is a two-dimensional barcode made of black and white square modules arranged in a square or rectangle, with an L-shaped border on two sides. It can store up to about 2,300 characters, yet a short serial number fits in a square just a few millimetres wide. Built-in error correction keeps it readable even when part of it is damaged.
Those properties make it the standard for marking small items: circuit boards, medical devices, surgical tools, pharmaceutical packs and aircraft parts. Unlike a QR code, it is rarely used for consumer links; it is an industrial and logistics code, often read by fixed scanners on production lines. GS1 DataMatrix is the variant used for healthcare and supply-chain data.
The size of the symbol grows in steps, from 10 × 10 modules up to 144 × 144, depending on how much you encode. Up to about a third of the symbol can be damaged and still read, thanks to Reed-Solomon error correction, which is why it survives scratches, dirt and curved surfaces.
Use cases
Where Data Matrix shines
Wherever space is tight and data must survive handling.
Medical devices and pharma
UDI and serialization rules require 2D codes on packs and instruments.
Electronics
Mark circuit boards and components with serial numbers in a few square millimetres.
Small labels
Fit IDs on vials, test tubes, jewelry tags and tiny packaging.
Manufacturing traceability
Track parts through every step of production and assembly.
Postage and tickets
Postal services and transport tickets encode routing and validation data.
Retail logistics
Encode lot numbers and expiry dates on cartons alongside linear codes.
How it works
How to make a Data Matrix code
Any text works: serial numbers, part IDs, short URLs.
- 1
Data Matrix is preselected
Open the Barcodes tab at the top — the format is already chosen on this page.
- 2
Enter your data
Type the serial number, ID or text. The symbol size grows automatically with the amount of data.
- 3
Download
Pick module and background colors and download PNG for labels or SVG for marking files.
Best practices
Tips for small 2D codes
Tiny codes need careful printing.
Keep a quiet zone
Leave at least one module of empty space around the square so readers find the finder pattern.
Use high contrast
Dark modules on a light background, or the reverse when laser-marking metal — but test the reader first.
Use GS1 format for supply chains
Healthcare and retail partners may require GS1 DataMatrix with application identifiers. Ask before printing large runs.
Choose square or rectangular
Square symbols are the default and read from any angle. Rectangular versions fit narrow labels such as cable tags and vial edges.
Laser marking needs testing
Direct part marking on metal or plastic changes contrast and module shape. Mark a sample, test it with your reader, then adjust size and power.
Keep data short
Short IDs give larger modules at the same printed size, which makes the code faster to read and more tolerant of damage.
FAQ
Frequently asked questions
What is a Data Matrix code?
- A Data Matrix code is a 2D barcode of square modules with an L-shaped border. It stores a lot of data in a tiny area and is widely used on electronics, medical devices and pharmaceutical packaging.
What are Data Matrix codes used for?
- Marking small parts, medical and pharma products, electronics, postage and logistics labels — anywhere items must be identified in very little space.
How do Data Matrix codes work?
- Data is encoded into modules with Reed-Solomon error correction. A reader finds the L-shaped border, reads the module grid and decodes the data even if part of it is damaged.
How do I create a Data Matrix code?
- With Data Matrix selected in the generator above, enter your text and download the PNG or SVG. It is free and needs no account.
Data Matrix vs QR code — what is the difference?
- Both are 2D codes. Data Matrix is smaller for the same short data and is preferred in industry; QR codes are better for consumer links and are read by every phone camera.
Can phones scan a Data Matrix code?
- Many phone cameras and scanner apps can, but support is less universal than for QR codes. Industrial readers read them reliably.
How much data can it hold?
- Up to about 3,100 digits or 2,300 alphanumeric characters in the largest size. In practice, codes usually hold a short ID or a GS1 data string.
What is GS1 DataMatrix?
- A version that starts with a special FNC1 character and encodes GS1 application identifiers such as GTIN, lot and expiry. It is required by many healthcare regulations.
Can I generate Data Matrix codes in Excel?
- Excel needs add-ins or fonts with encoders for 2D codes. It is easier to generate the images here and insert them.
How small can it be printed?
- It depends on the printer and reader. A 10 × 10 module code can be read at a few millimetres with good printing and an industrial reader.
Is the Data Matrix generator free?
- Yes. Unlimited codes in PNG and SVG, no watermark, no sign-up.
Can it encode a website link?
- Yes, but phone support is limited. For links that customers will scan, use a QR code instead.
What is the difference between square and rectangular symbols?
- Square symbols hold more data and are the default. Rectangular ones fit long, narrow spaces like cable tags, at the cost of capacity.
Do I need special software to read it?
- No special software, but you need a 2D-capable reader: an imaging scanner or a phone app. Old laser scanners only read linear barcodes.
Can I add a logo or colors?
- You can change module and background colors, but keep strong contrast. Logos are not part of the standard and would hide modules, so leave the symbol clean and place branding next to it.