Four two-dimensional codes, and why each exists

QR is not the only two-dimensional barcode, and in several industries it is not the usual one. The differences between the four you will meet come down to one design decision each, and that decision explains where you find them.

Updated 8 September 2026

The finder pattern is the design decision

Before a decoder can read anything it has to locate the symbol in a camera frame, work out its orientation, and establish the module grid. How a format solves that shapes everything else about it, including how much blank space it demands and how well it copes with damage.

FormatFinderQuiet zone
QRThree concentric squares in three cornersFour modules
Data MatrixA solid L on two edges, a dashed clock track on the other twoOne module
PDF417Start and stop patterns at the ends of every rowTwo modules
AztecA bullseye at the centerNone required
How each format announces itself

Read that table as a story about margins. QR wants the most blank space and gets universal recognition in exchange, because three corner squares are easy to find at any angle. Aztec wants none, because a decoder that finds itself from the middle does not care what touches the edges. That single property is why Aztec dominates ticketing, where a code is crammed against the edge of a rail ticket or a phone screen and there is nowhere to put a margin.

Capacity and shape

FormatGrid rangeNumericShape
QR21x21 to 177x177About 7,000 digitsSquare only
Data Matrix10x10 to 144x144About 3,100 digitsSquare or rectangular
PDF417Variable rows and columnsAbout 2,700 digitsWide, stacked rows
Aztec15x15 to 151x151About 3,800 digitsSquare only
Rough maxima at the largest sizes and lowest error correction

These ceilings are mostly theoretical. A symbol at maximum capacity is enormous, needs excellent print quality, and in practice you would store a link instead. The numbers matter as a ranking rather than as a target.

Shape is the more useful column. Data Matrix comes in rectangular variants, which is why it fits on cable labels, pharmaceutical blister foil and the side of a component where a square would not. PDF417 is a stack of rows and is naturally wide, which suits the back of a card.

Where each one actually lives

  • QR is the consumer format. It is the only one an ordinary phone camera reliably acts on without an app, which makes it the only real option for anything the public scans.
  • Data Matrix is the small-parts format. It stays readable at a few millimeters square and survives being etched or laser-marked directly into metal, so it marks electronic components, surgical instruments and aerospace parts. It is also standard on pharmaceutical packaging.
  • PDF417 is the identity-document format. Driving licenses in North America, boarding passes and various government documents carry it, largely because it was well established when those systems were specified and holds enough to encode a whole record offline.
  • Aztec is the ticketing format, for the quiet-zone reason above, and because it reads well off an illuminated screen at an awkward angle, which is most of what a barrier scanner sees.

Error correction differs more than you would expect

All four use Reed-Solomon coding, but they expose it differently, and that changes how you think about each one.

QR offers four fixed levels, so the choice is coarse and easy. Aztec lets you select a percentage across a wide range, which suits an application tuning symbol size against reliability. PDF417 has nine levels and the recommended one scales with how much data you are storing. Data Matrix in its modern form does not ask: ECC 200 fixes the correction level for a given symbol size, which removes a decision and is part of why it is dependable in industrial settings.

Choosing between them

In practice you rarely choose. The reading equipment chooses for you, and it is worth establishing what that equipment is before anything else.

  1. If members of the public will scan it with their own phones, use QR. Nothing else is a serious option.
  2. If it goes on something very small, or is marked directly into a surface, use Data Matrix.
  3. If it has to interoperate with an existing system, use whatever that system specifies. Transport, healthcare and identity all have settled answers you do not get to revisit.
  4. If none of the above applies and you are building both ends, use QR anyway. The tooling, the libraries and the debugging experience are better than for the others, and that is worth more than a few percent of symbol area.