Data Matrix Generator
This Data Matrix generator makes a code that packs a lot of data into a very small square, and its error correction means it still reads when part of the symbol is scratched, worn or printed badly. That combination is why it dominates electronics, aerospace and healthcare marking.
On this page
Build your Data Matrix code
Size, colour and export options
Never set this to zero. A cropped quiet zone is the most common reason a printed barcode will not scan.
Preview
What was checked
Verify any code by test scanning a printed sample before a production run. Provided as is, and used at your own risk. See the terms.
What Data Matrix is
A Data Matrix is a two-dimensional matrix code read in both directions rather than swept across like a linear barcode. The modern version is ECC 200, which uses Reed-Solomon error correction, the same family of maths that keeps a scratched CD playing.
The practical consequence is durability. A Data Matrix can lose a meaningful portion of its area and still decode, which is why it gets laser-etched directly onto surgical instruments, circuit boards and engine components where a paper label would not survive.
It is also genuinely small. Where a Code 128 carrying the same serial number would need a strip several centimetres long, a Data Matrix fits in a few millimetres square, which is often the difference between marking a part and not being able to.
GS1 DataMatrix is the same symbol carrying GS1 Application Identifier data, and it is the only 2D barcode permitted for regulated healthcare trade items.
Data Matrix specification
| Character set | Alphanumeric and raw binary |
|---|---|
| Length | Variable, up to roughly 2,335 alphanumeric characters |
| Error correction | Reed-Solomon, ECC 200, built in |
| Shape | Square or rectangular |
| Quiet zone | At least 1 module on all four sides |
| Governed by | ISO/IEC 16022 |
Size it for the reader, not the label
Data Matrix is dense, and density is a trap. Encoding a long string into a symbol printed at a small module size produces something a phone camera can technically resolve and a warehouse imager cannot read reliably at distance.
Encode the shortest identifier that does the job, usually a serial or part number rather than a full description, and test with the actual scanner that will read it in the place it will be read.
Sources
Every specification figure on this page traces to one of the following. Nothing is stated here that could not be checked against them.
- ISO/IEC 16022, Data Matrix symbology and ECC 200 error correction
- bwip-js, MIT-licensed barcode encoder implementing the ISO/IEC symbologies
Last reviewed 6 September 2026
This page is maintained by Cedrick Reese at Ready Utilities. Data Matrix structure and the ECC 200 error correction scheme are defined in ISO/IEC 16022, and encoding is performed by the MIT-licensed bwip-js library at a pinned version, which implements that specification directly. Capacity figures reflect the published maximums for the symbology. Where a figure could not be confirmed against a primary specification it is not stated here.
Common questions
How much data can a Data Matrix hold?
Up to roughly 3,116 numeric characters, 2,335 alphanumeric characters, or 1,556 bytes of binary data. In practice most industrial uses encode far less, usually a part or serial number.
Is a Data Matrix the same as a QR code?
No. Both are 2D matrix codes with error correction, but they are different symbologies with different encoding and different finder patterns. Data Matrix uses a solid L-shaped border, QR uses three corner squares. Data Matrix is generally more compact at small sizes.
Why is Data Matrix used in healthcare?
It is the 2D barcode GS1 specifies for regulated healthcare trade items, and it stays readable at the very small sizes that vials, ampoules and instruments allow.
Can a damaged Data Matrix still be read?
Often yes. ECC 200 error correction can reconstruct data from a partly damaged symbol, which is why it is used on parts that get handled, cleaned and worn.