Data Matrix Generator

Square 2D code used for direct part marking; widely required on pharmaceuticals and electronics components.

How Data Matrix is structured

Data Matrix is a grid of square modules, square symbols running from 10 by 10 up to 144 by 144 plus six rectangular variants for narrow parts. A solid L-shaped finder pattern on the left and bottom edges and dashed timing tracks on the other two let the reader establish size and orientation from any angle. Payload bytes are packed into codewords, with an ASCII, C40, Text or Base 256 mode chosen per run of data.

Data Matrix check digit

There is no check digit to print. ECC 200 error correction appends Reed-Solomon codewords — more as the symbol grows — so a reader reconstructs the payload even when part of the grid is destroyed. When the symbol carries GS1 data, an FNC1 codeword introduces the application identifier chain in the same way GS1-128 does.

Data Matrix compared with PDF417

QR Code carries more data at the same physical size and is faster for a phone camera to acquire, because its three large finder patterns are easier to spot. Data Matrix wins on density and on tolerance to being etched or dot-peened onto a small part, which is why it dominates direct part marking and pharma unit labelling. Compare the PDF417 generator page for the same breakdown of structure, check digit and use cases.

Common Data Matrix problems

The symbol is too small for the reader

Below roughly a millimetre of module pitch, camera focus and print bleed dominate. Increase the physical size or shorten the payload rather than pushing the module size down until the first scan works by luck.

Damage reaches the error correction limit

A logo, a punch mark or a scratch across the middle can exceed the ECC 200 budget for that symbol size. Move the marking away from the damage risk, or use a larger symbol so more correction codewords are available.

A QR-only reader ignores it

Phone apps and some fixed imagers are set up for QR Code first. Verify with a reader that explicitly supports Data Matrix — the failure mode is silence, not an error message, which makes it look like a print problem.

Where Data Matrix is used

Not sure this is the right symbology? The barcode format guide groups every supported 1D and 2D format by industry with its character set and limits.