Introduction
PDF417 is a stacked linear barcode standard (ISO/IEC 15438) capable of encoding up to 1.8 KB of binary data in a single symbol. It is used on US driver licenses (AAMVA standard), boarding passes (IATA BCBP), and shipping labels (UPS MaxiCode complement). The "PDF" stands for Portable Data File, reflecting its ability to store entire documents in a barcode. This tool generates PDF417 symbols in your browser using the bwip-js library. No data is transmitted to any server.
What this tool does
- Generates PDF417 stacked 2D barcodes from text input
- Renders directly to a canvas element for immediate preview
- Supports adjustable scale (pixels per module) and data column count
- Encodes up to 1,850 bytes of data per symbol
- Uses Reed-Solomon error correction at selectable levels
How this tool works
The tool uses bwip-js to render PDF417 symbols. When you enter data, it calls bwip.toCanvas() with bcid "pdf417", the input text, a scale parameter, and a column count. The column count controls the width of the symbol: more columns produce a wider, shorter barcode; fewer columns produce a narrower, taller one. The library handles all encoding details including high-level mode switching (text, byte, numeric), Reed-Solomon error correction, and start/stop patterns. The canvas updates in real time as you type or adjust settings. The scale parameter determines physical size when printed.
How PDF417 barcodes work
PDF417 consists of 3 to 90 rows, each containing 1 to 30 data columns. Each row is a linear barcode with start and stop patterns and row indicators. The "417" refers to the encoding: each codeword is 17 modules wide and contains 4 bars and 4 spaces. PDF417 uses three compaction modes to maximize data density: text compaction (2 characters per codeword), byte compaction (1.2 bytes per codeword), and numeric compaction (2.9 digits per codeword). The encoder automatically switches between modes based on the data. Reed-Solomon error correction operates at levels 0-8, where level 5 (the default) allows recovery from up to 30% symbol damage. PDF417 was invented by Ynjiun Wang at Symbol Technologies in 1991 and standardized as ISO/IEC 15438 in 2006. The AAMVA (American Association of Motor Vehicle Administrators) standard mandates PDF417 on US driver licenses.
How to use this tool
- Type or paste the data to encode in the input box.
- Adjust the scale slider to control pixel size per module.
- Adjust the data columns slider to control symbol width.
- The PDF417 barcode renders automatically on the canvas below.
- Right-click the canvas to save the image as PNG for printing.
Real-world examples
Generating a driver license barcode (AAMVA)
US driver licenses encode personal data in PDF417 per the AAMVA standard. The data includes name, address, date of birth, and license number in a structured format. While this tool does not generate AAMVA-compliant data structures, you can encode the raw data string and adjust columns to match the physical size of a standard ID card.
Boarding pass barcode (IATA BCBP)
The IATA Bar Coded Boarding Pass (BCBP) standard uses PDF417 to encode flight information: passenger name, flight number, seat, origin, destination, and sequence number. A typical BCBP barcode encodes 60-120 characters. Set columns to 8-10 and scale to 2 for a symbol that fits on a standard boarding pass.
Shipping label with tracking data
Logistics companies use PDF417 to encode complete shipment information: tracking number, origin, destination, weight, and service level. This is more compact than multiple 1D barcodes and allows a single scan to capture all data. Encode the combined data string and adjust columns to fit the label width.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| PDF417 (ISO/IEC 15438) | Stacked linear + Reed-Solomon | Driver licenses, boarding passes |
| Data Matrix (ISO/IEC 16022) | 2D matrix + Reed-Solomon | Electronics, pharma, small labels |
| QR Code (ISO/IEC 18004) | 2D matrix + Reed-Solomon | Marketing, URLs, payments |
| Code 128 (ISO/IEC 15417) | 1D linear + checksum | Shipping, inventory |
Limitations or considerations
PDF417 symbols are larger than Data Matrix or QR codes for the same data capacity. The tool does not expose the error correction level setting; it uses the default level 5. The canvas output is raster (PNG), not vector, so it may pixelate when scaled up. For production printing, generate at a high scale (8-10x) and verify with a scanner. The tool does not validate AAMVA or IATA BCBP data structures; it encodes raw text.
Frequently asked questions
Why is PDF417 used on driver licenses instead of QR codes?
PDF417 was standardized for identification documents before QR codes became widespread. The AAMVA standard mandates PDF417 for its ability to encode structured data with error correction in a rectangular format that fits on ID cards. Government systems and scanners are built around this standard.
How much data can PDF417 hold?
Up to 1,850 bytes of binary data, 2,710 numeric digits, or 1,850 ASCII characters in the maximum symbol size (90 rows x 30 columns). The actual capacity depends on the compaction mode used and the error correction level selected.
What is the difference between PDF417 and Macro PDF417?
Macro PDF417 allows multiple PDF417 symbols to be linked together, enabling storage of files larger than 1,850 bytes. The linked symbols share a file ID and sequence information. This tool generates standard PDF417, not Macro PDF417.
Can I adjust the error correction level?
The tool uses the default error correction level (5), which provides recovery from approximately 30% symbol damage. The bwip-js library supports levels 0-8, but this tool does not expose the setting. Higher levels provide more error correction but produce larger symbols.
Conclusion
PDF417 is the standard barcode for identification documents, boarding passes, and shipping labels that need to encode large amounts of data. This tool generates PDF417 symbols in your browser using bwip-js. Adjust scale and column count for your label size, and verify with a scanner before production use.