Data Matrix vs PDF417: Which 2D Barcode to Use

Compare Data Matrix and PDF417 barcodes on data capacity, size, error correction, and scanning. Learn which 2D barcode format fits your labels or IDs.

Data Matrix and PDF417 are both two-dimensional barcodes, but they were built to solve opposite problems. Data Matrix packs data into the smallest possible square, the kind of mark laser-etched onto a circuit board or a surgical instrument. PDF417 stretches data across a wide rectangle, the kind printed on the back of a driver's license or a boarding pass. Picking the wrong one for your application usually shows up as either a barcode that won't fit the label, or one that can't hold everything you need to encode.

What is the difference between Data Matrix and PDF417?

Data Matrix is a true 2D matrix symbol: a grid of black and white cells bordered by a solid L-shaped finder pattern, read in two dimensions at once. PDF417 is a stacked linear symbol: it looks like several ordinary barcodes stacked in rows, each row scanned independently and then reassembled by the decoder.

That structural difference drives everything else. Data Matrix's compact, borderless grid lets it shrink down to a few millimeters square, which is why it dominates in electronics and medical device marking. PDF417's row-based layout was built to carry large amounts of structured text, which is why it became the standard for driver's licenses and other identification documents under the AAMVA DL/ID Card Design Standard. Data Matrix is standardized as ISO/IEC 16022; PDF417 is standardized as ISO/IEC 15438.

FeatureData MatrixPDF417
ShapeSquare or rectangle, matrix gridWide rectangle, stacked rows
Invented1989, RVSI Acuity CiMatrix1991, Symbol Technologies
Max data capacity~2,335 alphanumeric / 3,116 numeric~1,850 alphanumeric / 2,710 numeric
Minimum practical size~2mm x 2mmCard-width rectangle, not designed to shrink
Error correctionECC 200, fixed, ~28% recovery9 levels (0-8), configurable
Scanner typeRequires 2D imagerWorks with modified linear scanners or 2D imagers
ISO standardISO/IEC 16022ISO/IEC 15438
Typical useElectronics, pharma, aerospace markingDriver's licenses, boarding passes, shipping forms

Which holds more data, Data Matrix or PDF417?

Data Matrix's largest 144x144 symbol holds more raw characters than PDF417's largest symbol: roughly 2,335 alphanumeric or 3,116 numeric characters versus PDF417's 1,850 alphanumeric or 2,710 numeric characters. But that comparison only matters at maximum size, and the two formats rarely get pushed there for the same reason.

In real deployments, Data Matrix almost never uses its full capacity because it's chosen precisely to stay tiny; a 24x24 Data Matrix, common on small parts, holds only around 30 numeric digits. PDF417, by contrast, is routinely used closer to its real capacity because its whole purpose is carrying a document's worth of structured fields; a typical driver's license barcode encodes 300 to 500 characters of name, address, license class, and restriction data in a symbol sized to fit within AAMVA's Zone V card layout. So while Data Matrix technically caps out lower, PDF417 is the format actually built to be filled up.

How do Data Matrix and PDF417 handle error correction and damage?

Both symbologies use Reed-Solomon error correction, the same family of algorithm used on CDs and DVDs, so both can be decoded even when part of the printed or etched mark is missing. The difference is how much control you have over the trade-off between data capacity and damage tolerance.

Data Matrix uses a single fixed scheme, ECC 200, which delivers about 28% error recovery on every symbol regardless of application, per GS1's DataMatrix guideline. You don't choose a level; you get one consistent amount of protection. PDF417 instead offers nine selectable error correction levels, 0 through 8, defined in ISO/IEC 15438. Level 0 adds minimal redundancy for clean, controlled printing, while level 8 adds hundreds of extra correction codewords so the symbol can be reconstructed even after substantial damage. That flexibility is useful for PDF417 because the format is used on physical cards and paper that get folded, scratched, and carried in wallets for years, and issuers can dial in exactly how much protection that wear justifies.

When should I use Data Matrix vs PDF417?

Choose Data Matrix when the mark has to be physically small and a fixed scanner or handheld imager, not a consumer's eye, is doing the reading. Choose PDF417 when a single barcode needs to function as a portable record that a document, card, or ticket can carry on its own without a network lookup.

Data Matrix is the right call for direct part marking on electronics, aerospace components, and surgical instruments, where the code might be laser-etched into a space just a few millimeters across. It's also the mandated format for pharmaceutical serialization in many markets, since a single blister pack or vial has almost no room to spare. PDF417 is the right call anywhere a document needs to be self-contained: driver's licenses and state ID cards, military and border-crossing credentials, airline boarding passes, and shipping labels that carry full routing and handling instructions alongside a primary linear barcode. If you're choosing between more 2D options generally, see our broader guide to choosing the right barcode type.

Can smartphones scan Data Matrix and PDF417 barcodes?

Yes, but neither format is read automatically by a phone's default camera app the way QR codes are. Both require a dedicated barcode scanning app, Google Lens, or a web-based scanner such as barcodescanner.online that reads camera input or an uploaded photo.

This matters most for applications where the public is expected to scan the code themselves. Neither Data Matrix nor PDF417 is a good fit for that; both are built for environments with dedicated scanning equipment or scanning apps already in place, such as retail checkout imagers, hospital scanners, or law-enforcement ID readers, rather than for a stranger pointing an unmodified phone camera at a poster. For a comparison of Data Matrix against the format phones do scan natively, see QR Code vs Data Matrix, and for the same comparison with PDF417, see PDF417 vs QR Code.

Which is better, Data Matrix or PDF417?

There's no single winner because the two formats were designed for different jobs. Data Matrix wins on space efficiency: it can be reliably printed or etched as small as 2mm square, far smaller than PDF417 can go. PDF417 wins on structured document capacity and its long track record in government and transportation systems, where it remains the mandated format even as some agencies explore alternatives.

If you're marking a small physical part, choose Data Matrix. If you're printing a document that needs to carry hundreds of characters of self-contained data, choose PDF417. And if your existing scanning infrastructure already supports one format across your supply chain or ID systems, the cost of switching rarely outweighs the marginal benefit, so matching what your scanners and partners already use is often the deciding factor over any spec-sheet comparison. You can test either format directly with a barcode scanner before committing to one for a new label or document design.

Sources

Frequently Asked Questions

What is the difference between Data Matrix and PDF417?
Data Matrix is a true matrix symbol built from a square or rectangular grid of cells, optimized for very small labels. PDF417 is a stacked linear symbol made of multiple rows of bars, optimized for holding large blocks of structured text such as a driver's license record.
Which is better, Data Matrix or PDF417?
Neither is universally better; they solve different problems. Data Matrix wins when space is tight and machines do the scanning. PDF417 wins when a single barcode needs to carry a full document's worth of data, as on IDs, boarding passes, and shipping paperwork.
When should I use Data Matrix vs PDF417?
Use Data Matrix for direct part marking, electronics, and pharmaceutical serialization where the mark must be tiny. Use PDF417 for identification documents, boarding passes, and forms where the barcode itself needs to store hundreds of characters of offline-readable data.
Which holds more data, Data Matrix or PDF417?
PDF417 holds more raw data: up to about 1,850 alphanumeric characters or 2,710 numeric digits, versus roughly 2,335 alphanumeric or 3,116 numeric characters at Data Matrix's largest 144x144 size. In practice PDF417 fits more data into a workable printed size because it isn't trying to be tiny.