PDF417
PDF417 is the stacked-linear 2D barcode that appears on the back of every US driver license, on most US passports, on FedEx/UPS airbills, and on countless government forms. It's the only 2D symbology that can be read reliably by 1D laser scanners — which is why institutions with million-dollar installed scanner bases haven't moved off it in 30 years.
AAMVA application: AAMVA Card Design Standard v10 — mandates PDF417 for US/Canadian driver licenses.
Originator: Symbol Technologies (now Zebra), 1991. Name stands for "Portable Data File, 4 bars, 17 modules."
What it is
Physically, a PDF417 symbol is a stack of horizontal rows — each row is a linear barcode. A full-size PDF417 looks like a tall narrow brick with ~3–90 rows, where each row carries a slice of the overall payload. Because every row starts with a start pattern and ends with a stop pattern, PDF417 can be decoded by a scanning laser sweeping left-to-right row by row — no 2D imager required.
Each codeword is 17 modules wide, built from 4 bars and 4 spaces (hence "4/17"). The payload is split across codewords using one of three "compaction modes":
- Text Compaction — 1.8 chars/codeword. Used for mixed alphanumerics.
- Byte Compaction — 1.2 bytes/codeword. Used for arbitrary binary.
- Numeric Compaction — 2.9 digits/codeword. Used for long numeric payloads (like AAMVA's zip+state combinations).
Capacity (rows × columns)
PDF417 size is specified as rows × data columns. Max is 90 rows × 30 data columns = 2,700 data codewords. Approximate alphanumeric capacity:
| Rows × data cols | Max alphanumeric | Typical use |
|---|---|---|
| 3 × 1 | ~3 chars | Minimum viable symbol |
| 10 × 3 | ~30 chars | Short IDs, short URLs |
| 20 × 5 | ~100 chars | Boarding pass, short AAMVA |
| 30 × 8 | ~250 chars | FedEx airbill |
| 40 × 12 | ~500 chars | Full AAMVA driver license |
| 90 × 30 | ~1,800 chars | Theoretical max — rarely used |
Error correction levels (0–8)
PDF417 defines 9 levels of Reed-Solomon error correction, adding 2, 4, 8, 16, 32, 64, 128, 256, or 512 codewords of ECC. Higher levels handle more damage but cost payload capacity.
| ECC level | ECC codewords | Typical use | % overhead |
|---|---|---|---|
| 0 | 2 | Experimental only | ~0.1% |
| 1 | 4 | Short codes, controlled environment | ~0.2% |
| 2 | 8 | Small payloads | ~0.4% |
| 3 | 16 | Medium payloads, indoor scanning | ~0.8% |
| 4 | 32 | Default for short documents | ~1.5% |
| 5 | 64 | Real-world default — airbills, boarding passes, AAMVA | ~3% |
| 6 | 128 | High-damage environments | ~6% |
| 7 | 256 | Crumpled / outdoor / industrial | ~12% |
| 8 | 512 | Extreme environments | ~25% |
Macro PDF417 (multi-symbol payloads)
When a payload exceeds the 1,800-char cap, PDF417 supports Macro PDF417 — the payload is split across up to 99,999 separate symbols, each tagged with a Macro index and File ID. The scanner reads all symbols in any order, reassembles, and emits a single decoded payload. Rare in practice outside specialist document scanning.
Canonical test vectors
| Case | Payload | Expected substring |
|---|---|---|
| GS1 airbill (FedEx-style) | 123456789012345 FEDEX 2026-04-20 | FEDEX |
| AAMVA driver license (minimal) | @\n\x1e\rANSI 636014100002DL00410241ZVZVA01DAQA123456789 | ANSI 636014 |
| Short plain URL | https://example.com/doc/X1234 | example.com/doc/X1234 |
| Long receipt / invoice | INV:2026-04-19 VENDOR:ACME TOTAL:$1,234.56 TAX:$98.76 … | ACME |
Common pitfalls
- Consumer phone cameras don't decode PDF417 reliably. iOS 17+ has a special AAMVA-aware flow (Wallet recognises US driver licenses), but treating that as "iPhone supports PDF417" is misleading — it's only for the specific AAMVA payload. Android behaviour varies wildly by OEM camera app.
- AAMVA mandates PDF417. The AAMVA Card Design Standard (CDS) requires PDF417 specifically — not QR, not Aztec. If you're generating AAMVA payloads, the standard locks you in.
- Quiet zones are 2× module width. Different from QR (4 modules) and Aztec (none). PDF417 needs at least 2 modules of white space on the left and right edges; getting the quiet zone wrong is the #1 reason legitimate PDF417 codes fail at scan time.
- Aspect ratio matters. PDF417 rows are wider than tall by design. Forcing a square aspect ratio (by scaling or by printing on a square substrate) breaks laser-scanner decoding; 2D imagers can sometimes recover.
- Truncated PDF417. Variant that omits the right row indicator + stop pattern. Saves ~12% symbol width but only decodes on 2D imagers — laser scanners need the stop pattern. Use only when you know the scanner class.
- Compaction mode auto-selection. Good encoders switch compaction mid-payload for efficiency (numeric block → text block). Manual encoders that lock a single mode waste capacity. Abundera's encoder auto-selects per codeword.
- Compaction mode and character set. Text Compaction handles printable ASCII only. Embedded NULs, Latin-1 accents, or binary data force Byte Compaction, which drops efficiency to 1.2 bytes/codeword.
- Styling disabled. QR-specific features (custom dot shapes, gradients, centre logos) don't apply. Abundera's Style panel disables itself for PDF417.
Scanner compatibility
| Reader | PDF417 support | Notes |
|---|---|---|
| iOS Camera (iOS 17+) | AAMVA-only | Native Wallet flow for US driver licenses. General PDF417 payloads don't decode. |
| Android Camera (OEM-dependent) | Partial | Samsung + Pixel stock cameras decode inconsistently. Google Lens partial. |
| Google Lens | Unreliable | Not a viable verification path for production. |
| US DMV / kiosk scanner | Yes (canonical) | This is what PDF417 was designed for — every DMV and liquor kiosk reads PDF417 natively. |
| Airline boarding-pass reader | Some carriers | Most airlines moved to Aztec; a few (ANA, JAL, legacy US carriers) still accept PDF417 boarding passes. |
| FedEx / UPS airbill reader | Yes (canonical) | Laser scanners at every sorting facility read PDF417 natively. |
| 1D laser scanner | Yes | Unique advantage vs Aztec / Data Matrix — 1D lasers CAN decode PDF417. |
| Zebra / Honeywell / Datalogic imager | Yes | Every industrial 2D imager supports PDF417. |
| Scandit / Dynamsoft SDK | Yes | Full support including Macro PDF417. |
See also
- /pdf417-barcode-generator/ — the PDF417 generator.
- AAMVA reference — the canonical PDF417 use case (US driver licenses). Mandated by spec.
- Aztec · PDF417 · Data Matrix comparison — side-by-side comparison.
- Aztec reference — the display-first sibling, for boarding passes and transit.
- Data Matrix reference — the direct-part-marking sibling.
- Standards index — back to the reference hub.