Data Matrix generator
The small square on circuit boards, surgical instruments and pharmaceutical packaging. ECC200 with real Reed-Solomon error correction, from 10x10 modules for a single character up to 144x144, which holds 1558 characters of text or 3116 digits.
Why it is the marking symbology
Data Matrix is designed to stay readable when it is tiny and when it is damaged. It needs only a two module quiet zone, its finder is an L-shaped solid edge rather than three large corner squares, and error correction is not optional at any size. That combination is why it ends up laser-etched onto components a few millimeters across.
The size grows with the data in defined steps rather than continuously. Measured from this encoder: one character is 10x10, ten characters 16x16, a hundred 40x40, a thousand 120x120, and the largest square is 144x144. Adding one character to a full symbol jumps it to the next size, which is why capacity planning for a marking process is worth doing before the tooling is cut.
The error correction is the point
ECC200's Reed-Solomon works over the same kind of finite field a QR code uses, with a different polynomial: 0x12D here against 0x11D there, and the generator roots start at the first power rather than the zeroth. Those two differences are small to describe and total, in the sense that using QR's constants produces a symbol no Data Matrix reader will accept.
That is not a theoretical remark. This encoder had exactly that defect, with the generator polynomial reversed, and it failed the standard's own worked example for the string 123456: the specification gives error codewords 114, 25, 5, 88, 102 and we produced 242, 234, 143, 212, 28. Checking against a published test vector is what found it.
How much fits
- 1558 characters of general text, or 3116 digits, in the largest 144x144 symbol. Digits pack two to a codeword, which is where the difference comes from.
- A part number and revision, which is the common industrial case, sits comfortably in an 18x18 symbol.
- Rectangular sizes exist for labels where height is short and width is not, and the encoder will use them when a square is a poor fit.
- Past roughly 1500 characters, a QR code is the better answer. Data Matrix stops there, and that limit is enforced with a message saying so rather than a corrupt symbol.
Data Matrix, GS1 Data Matrix and QR
GS1 Data Matrix is the same symbology carrying Application Identifiers, marked by an FNC1 at the start. Healthcare uses it heavily, because a unique device identifier has to fit on an instrument. If your data is bracketed AI fields, that is the entry you want.
Against QR: a QR code is more widely readable by phones and holds more, and Data Matrix is smaller at the same data and better at surviving direct part marking. Phone camera means QR. Etched, printed small, or on a curved surface means Data Matrix.
Questions
How much data can a Data Matrix hold?
1558 characters of text or 3116 digits in the largest symbol, measured from this encoder rather than quoted. Ask for more and you get an error naming the limit, which is better than a symbol that looks right and cannot be read.
Why is my symbol bigger than the data seems to need?
Sizes are discrete. The encoder picks the smallest standard size that fits your data plus its error correction, so one character over a boundary moves you to the next step up. That is the symbology, not padding added here.
Can it be a rectangle rather than a square?
Yes. The standard defines rectangular sizes for labels that are wide and short, and the encoder uses one where it fits your data better than a square would.
Will a phone read it?
Most modern phone cameras will, though not as reliably as they read QR codes, which is what their scanning is tuned for. For a code whose audience is people with phones, use QR. For a code whose audience is an industrial reader or a vision system, Data Matrix.
More barcode generators
Aztec code generator · PDF417 generator · Pharmaceutical barcode generator · Test barcode numbers · Free barcode generator · EAN-13 barcode generator · Barcode generator · QR code generator