Guide · 9 min read

QR vs PDF417 vs Aztec vs Data Matrix vs Code 128

The five barcode formats you will meet on tickets, compared on the things that actually matter: how much they hold, how well they survive damage, how small they print, and where each one is used.

The short answer: QR, Aztec and Data Matrix are square matrix codes; PDF417 is a stacked code shaped like a rectangle; Code 128 is a plain linear (1D) code. QR wins on universal support and capacity, PDF417 is the airline standard for printed boarding passes, Aztec is favoured by rail because it needs no surrounding margin, Data Matrix is the most compact, and Code 128 only stores a short ID. None is more secure than another — security lives in the issuer's system, not the symbol.

The three families

Every ticket barcode belongs to one of three families, and that single fact explains most of the differences:

Linear (1D)
Bars and spaces along one axis. Reads on cheap laser scanners, prints tiny, but stores only a short identifier and has no built-in error correction. Code 128 is the ticketing example.
Stacked
Several short linear rows stacked on top of one another. Holds far more than a 1D code while keeping an elongated shape. PDF417 is the example, and it is what the airline industry chose for printed boarding passes.
Matrix (2D)
A grid of square modules read by a camera. Highest capacity, strong error correction, readable at any rotation. QR, Aztec and Data Matrix are all matrix codes.

Side-by-side comparison

Comparison of QR, PDF417, Aztec, Data Matrix and Code 128
Format Family Max capacity* Error correction Standard Where you see it
QR Code2D matrix~4,296 alphanumeric4 levels (7–30%)ISO/IEC 18004Events, mobile wallets, transit
PDF4172D stacked~1,850 text9 levelsISO/IEC 15438Printed boarding passes (IATA BCBP)
Aztec2D matrix~3,000 chars5–95%, tunableISO/IEC 24778Rail e-tickets, mobile boarding passes
Data Matrix2D matrix~2,335 alphanumericReed–Solomon (ECC200)ISO/IEC 16022Small labels, postal, some tickets
Code 1281D linear<48 practicalNone intrinsicISO/IEC 15417Legacy paper stock, wristbands

*Practical ceilings for the largest size at the lowest error-correction setting. Real tickets use a fraction of this. Higher error correction trades capacity for resilience to creases, dirt and cracked screens.

QR vs PDF417

This is the comparison people search for most, usually because they have an airline boarding pass (PDF417) and a concert ticket (QR) and wonder why they look so different.

  • Shape — QR is square; PDF417 is a wide rectangle that fits a boarding-pass strip.
  • Capacity — QR holds more than twice as much at maximum size, which is why mobile tickets that embed signed payloads tend to use it.
  • Compatibility — every phone camera reads QR natively. PDF417 usually needs a dedicated scanner or app, but airport and airline readers all support it, which is exactly why aviation standardised on it.
  • Resilience — QR's higher error-correction levels survive more damage; PDF417's row-based correction is good but the elongated shape is more sensitive to a fold across the middle.

Bottom line: use QR for anything consumer-facing and mobile; you only need PDF417 if you are bound by the IATA boarding-pass standard. See the airline boarding pass guide for why aviation locked in PDF417.

QR vs Aztec vs Data Matrix

All three are square matrix codes, so to the eye they look similar. The differences are in the finder pattern (how a scanner locks onto the code) and density.

QR Code
Three large squares in the corners. Most widely supported, slightly larger than the others for the same data, and unmistakable to any phone camera.
Aztec
A bullseye of concentric squares in the centre. Its biggest advantage: it needs no "quiet zone" (blank margin), so it survives being printed right to the edge of a narrow rail ticket. This is why rail operators favour it.
Data Matrix
An L-shaped solid border on two sides. The densest of the three — a payload that needs a 20 mm QR can fit in a roughly 12 mm Data Matrix — which is why it dominates small industrial labels. The trade-off is weaker support in generic camera apps.

For tickets specifically: pick QR when buyers will use mixed apps and screenshots, Aztec when print space is cramped, and Data Matrix only when physical size is the binding constraint.

Code 128 vs Data Matrix

These two get compared because they both appear on small printed stock, but they are not really interchangeable:

  • Code 128 is 1D. It stores a short ID — typically the ticket number — and relies entirely on a database lookup for everything else. No error correction; a scuff can kill it.
  • Data Matrix is 2D. It can carry the ID plus a signed payload, event details, or a URL, and its Reed–Solomon error correction recovers from significant damage.

If all you need is a number and you are printing on a laser-readable strip, Code 128 is cheaper and still defensible. The moment you want to store more than an ID, or want the code to survive real-world handling, move to Data Matrix (or QR).

Where MaxiCode fits

You may see MaxiCode grouped with the others. It is a fixed-size 2D matrix code with a distinctive central bullseye, designed by UPS for high-speed package sorting. It is essentially never used on consumer tickets — its fixed size and modest capacity make it a poor fit — so if you are comparing ticket formats you can safely ignore it.

How to tell which one is on your ticket

  • Wide rectangle of fine stacked rows → PDF417 (almost certainly a boarding pass).
  • Square with three big corner squares → QR.
  • Square with a bullseye in the middle → Aztec (often a train ticket).
  • Square with a solid L on two edges → Data Matrix.
  • Single row of vertical bars → a 1D code such as Code 128.