PDF417 Boarding Passes and Event Tickets — How the Barcode Works
When you check in for a flight, the barcode on your paper boarding pass is almost always PDF417. The same format appears on printed event tickets, transit passes, and parking permits. This guide explains why PDF417 is the dominant format for these applications, what data the barcode encodes, and how to generate and read PDF417 barcodes for ticketing use cases.
Why PDF417 for Boarding Passes?
The IATA (International Air Transport Association) Bar Coded Boarding Pass (BCBP) standard was first published in 2005. It specifies PDF417 as the barcode format for paper boarding passes and has since been adopted by nearly every major airline worldwide.
The rationale for PDF417 over simpler formats:
| Requirement | Why PDF417 | |---|---| | Large payload | Boarding pass data (name, flight, seat, PNR, security token) is 200–400 bytes — far beyond Code 128 capacity | | Adjustable error correction | Labels get folded, creased, exposed to pocket lint; PDF417's error correction survives moderate damage | | Rectangular format | Fits naturally in the narrow boarding-pass strip and on kiosk receipt paper | | Established standard | ISO/IEC 15438 + IATA BCBP provide a stable, tested specification that airports and airlines can implement uniformly |
QR codes were added to the IATA BCBP specification (for mobile boarding passes) in a later revision. Paper boarding passes at most airlines still use PDF417; mobile/digital boarding passes use either QR or Aztec Code.
What Data Is in a Boarding Pass PDF417?
The IATA BCBP format version 6 defines a structured binary string. The key fields include:
Mandatory fields (always present)
| Field | Description | Max length |
|---|---|---|
| Format code | Always M (multiple segments) or 1 | 1 char |
| Number of legs | How many flight segments | 1 char |
| Passenger name | Last/first separated by / | 20 chars |
| Electronic ticket indicator | E for e-ticket | 1 char |
| Origin IATA code | 3-letter departure airport | 3 chars |
| Destination IATA code | 3-letter arrival airport | 3 chars |
| Operating carrier designator | 2–3 char airline code | 3 chars |
| Flight number | 4-digit + suffix | 5 chars |
| Date of flight | Julian day (1–366) | 3 chars |
| Compartment code | Cabin class (F, C, Y, etc.) | 1 char |
| Seat number | 3 digits + letter (e.g., 22A) | 4 chars |
| Check-in sequence number | Order of check-in | 5 chars |
| Passenger status | 1 char (e.g., O = OK to board) | 1 char |
Conditional fields (optional per leg)
- Airline-specific data (frequent flyer number, selectee status, fast-track eligibility)
- APIS (Advance Passenger Information System) data for international flights
- Airline-defined security data (typically an HMAC token for boarding verification)
- Baggage tag information
The security token is the most important conditional field for operations — gate scanners verify this against the airline's database to confirm the pass is authentic and unused.
Example payload (simplified)
M1SMITH/JOHN EABCDEF LAXSFOBA 1234 137Y022A0100 107
This encodes: 1-segment pass, passenger John Smith, e-ticket, record ABCDEF, LAX→SFO on BA 1234, day 137, economy/Y cabin, seat 22A, sequence 100, status OK.
Real boarding passes include additional fields and the security token, bringing the total payload to 200–400 characters.
Event Tickets and Transit Passes
Event tickets (concerts, sports, theater) use PDF417 similarly:
- Payload: Order ID, event ID, seat section/row/number, purchase timestamp, cryptographic verification token
- Verification: Gate scanners compare the decoded token against the venue's ticketing system in real time to prevent duplicate scans
- Error correction: Level 3–5 is typical, since tickets spend days in wallets and pockets before use
Transit systems (bus, rail, ferry) use PDF417 on paper tickets and day passes. Some systems (BART, New York MTA) use magnetic stripe instead; others use PDF417 for the full payload or as a backup alongside magnetic stripe.
Parking permits are another high-volume use case: monthly permits or event parking vouchers use PDF417 to encode the permit number, vehicle plate, validity date, and zone — all scannable by a handheld wand at the gate.
Generating a PDF417 Boarding-Pass-Style Barcode
You can generate a PDF417 barcode with boarding-pass-format content using PDF417 Studio →:
In the web UI: 1. Select PDF417 as the barcode type 2. Paste your payload string (IATA format or your own structured string) 3. Set error correction to 3–5 (for real-world durability) 4. Set columns to 10–12 for a boarding-pass aspect ratio 5. Export as PNG or SVG
Via API:
bash
curl -X POST https://www.pdf417-studio.com/api/generate \
-H "Content-Type: application/json" \
-d '{
"payload": "M1SMITH/JOHN EABCDEF LAXSFOBA 1234 137Y022A0100 107",
"errorCorrection": 3,
"columns": 10
}'
Via Python:
```python import requests, base64
response = requests.post( "https://www.pdf417-studio.com/api/generate", json={ "payload": "M1SMITH/JOHN EABCDEF LAXSFOBA 1234 137Y022A0100 107", "errorCorrection": 3, "columns": 10 } ) data = response.json()
data["png"] contains a base64-encoded PNG
img_bytes = base64.b64decode(data["png"]) with open("boarding_pass.png", "wb") as f: f.write(img_bytes) ```
Generating IATA BCBP Compliant Barcodes
For airline or ground-handler applications, the payload must comply with the full IATA BCBP specification:
- Construct the payload string according to IATA Resolution 792 (current version). The format has fixed-width fields; pad shorter values with spaces to the correct length.
- Sign or token-append your security data (airline-specific; typically HMAC-SHA256 of the mandatory fields using your airline's key).
- Encode as PDF417 with the parameters above.
- Verify the output before printing — use a scanner or the PDF417 Studio Diagnose tool → to confirm the barcode decodes to the correct string.
Note on safety boundary: PDF417 Studio generates barcodes from any payload you provide. It does not validate, authenticate, or certify IATA or government credentials. Generating fraudulent boarding passes or identity documents is illegal. PDF417 Studio is a technical tool for lawful barcode generation, label printing, and API integration.
Scanning and Decoding Boarding Pass Barcodes
To decode the PDF417 barcode on a boarding pass:
Smartphone apps: Use a 2D barcode scanner app that explicitly supports PDF417 (ZXing/Barcode Scanner, Cognex Mobile Barcode SDK). Most generic QR scanner apps will not read PDF417.
Online: Upload an image of the barcode to PDF417 Studio Diagnose → to view the raw decoded payload.
Developer library (Python):
```python
pip install pyzbar pillow
from pyzbar.pyzbar import decode from PIL import Image
data = decode(Image.open("boarding_pass_scan.jpg")) for barcode in data: if barcode.type == "PDF417": payload = barcode.data.decode("utf-8") print("Raw payload:", payload) # Parse IATA BCBP fields from fixed-width positions passenger_name = payload[2:22].strip() origin = payload[30:33] destination = payload[33:36] print(f"Passenger: {passenger_name}, {origin} → {destination}") ```
For a complete guide to scanning and decoding, see How to scan PDF417 barcodes →.
Common Issues with Boarding Pass Barcodes
Barcode printed too small
Kiosk receipt paper is narrow (80mm). If the PDF417 is compressed into a very small area at low DPI, the module width may fall below scanner minimums (typically 7 mils for consumer hardware). If you're printing your own boarding passes, use a module width of at least 10 mils.
Thermal printer fade
Boarding passes printed on direct-thermal paper fade over time (days to weeks at room temperature, faster in heat or UV). If a boarding pass has been in a car on a sunny dashboard, the barcode may have faded enough to fail. Re-print from the airline's app.
Folding across the barcode
A horizontal crease through the barcode disrupts multiple rows simultaneously. PDF417's error correction can survive some row damage, but a deep fold through the center of the symbol frequently causes scan failures. Store boarding passes flat or rolled, not tri-folded.
Wrong scanner type
Check-in desks and gate scanners at major airports use 2D area imagers — they read PDF417 natively. If you are deploying a scanning system and see consistent failures, confirm you are not using a 1D laser scanner.
Summary
- PDF417 is specified by IATA BCBP as the standard barcode format for paper boarding passes.
- The same format is used for event tickets, transit passes, and parking permits.
- A boarding pass barcode encodes passenger name, flight details, seat, and a security token — typically 200–400 characters.
- PDF417 was chosen for its large payload capacity and adjustable error correction against real-world handling damage.
- You can generate PDF417 barcodes at PDF417 Studio → and verify them with the Diagnose tool →.
See also: - What is PDF417? → - How to scan PDF417 barcodes → - PDF417 error correction levels explained → - Parse an AAMVA driver's license barcode → - API documentation →