How to use the pdf417 barcode generator
- Type or paste the text you want to encode into the Text to encode field.
- Select an Error correction level from 0 to 5. Higher levels add more redundancy for damaged prints.
- Set the Data columns value to control how wide the barcode appears. More columns mean fewer rows.
- Click Generate to render the PDF417 barcode as an SVG image.
- Copy the SVG code or save it directly for use in documents, labels or identification cards.
How PDF417 encodes text
PDF417 is a stacked linear barcode format that arranges data in a grid of rows and columns. Unlike 1D formats such as Code 128, it can store hundreds of characters by stacking multiple rows on top of each other.
The name stands for Portable Data File, and the 417 refers to the codeword structure: every codeword is built from exactly 4 bars and 4 spaces spanning 17 modules. Each codeword represents a value from 0 to 928.
The standard defines three compaction modes that turn data into codewords: text (about two characters per codeword), byte (six bytes become five codewords) and numeric (44 digits become 15 codewords). This generator uses numeric compaction for digit-only input of 13 or more digits and byte compaction for everything else, with text encoded as UTF-8. Byte compaction is a little less dense than text compaction, but every reader decodes it.
Error correction with Reed-Solomon
PDF417 uses Reed-Solomon error correction over the Galois Field GF(929). The security level you choose determines how many error correction codewords are appended to the data. Level s adds 2^(s+1) codewords.
| Level | EC Codewords | Errors correctable (up to) |
|---|---|---|
| 0 | 2 | 1 |
| 1 | 4 | 2 |
| 2 | 8 | 4 |
| 3 | 16 | 8 |
| 4 | 32 | 16 |
| 5 | 64 | 32 |
Higher levels make the barcode physically larger but allow scanners to recover data even when part of the symbol is torn, smudged or obscured. Printed identification cards often use higher levels because the card surface experiences frequent wear.
Structure of a PDF417 symbol
Every row in a PDF417 barcode contains several distinct regions read from left to right:
- Quiet zone: A blank margin of at least 2 modules on each side.
- Start pattern: A 17-module sequence (11111111010101000) that tells the scanner a row is beginning.
- Left indicator: A single codeword encoding the row number, total rows and error correction level.
- Data region: One or more data or error correction codewords.
- Right indicator: Another codeword carrying structural metadata.
- Stop pattern: An 18-module sequence marking the end of the row.
The first data codeword is always the Symbol Length Descriptor, which stores the total number of codewords in the symbol including itself. This lets the decoder know when it has captured the complete message.
Common applications
Because a PDF417 barcode generator can pack large amounts of text into a small printed area, this symbology is widely used where data must travel with a physical document rather than through a database lookup.
- Driver licenses and ID cards: The AAMVA standard in North America mandates PDF417 on the back of licenses to store name, address, date of birth and document discriminator.
- Boarding passes: Airlines use PDF417 on paper boarding passes to embed passenger name record data.
- Shipping labels: Carriers encode routing information, tracking numbers and customs declarations.
- Inventory management: Warehouses attach PDF417 labels to pallets containing serialized item lists that exceed the capacity of simpler formats like Code 39.
Choosing columns and security level
The number of data columns controls the aspect ratio of the resulting barcode. With fewer columns, the symbol grows taller; with more columns, it grows wider. The total number of rows is calculated as ceil(total_codewords / columns), where total codewords include the length descriptor, data codewords and error correction codewords.
For short strings like a URL or a sentence, 3 to 5 columns produce a compact, roughly square symbol. For long payloads such as a full AAMVA driver license record, 8 to 12 columns keep the row count manageable for handheld scanners.
Always verify the generated barcode with an independent reader application or hardware scanner before printing it on production materials. Screen rendering and printer resolution can affect scannability, especially at higher security levels where modules become very narrow.
Worked examples
| Example | Input | Result |
|---|---|---|
| Simple greeting | Text to encode: Hello PDF417; Error correction level: 2; Data columns: 3; Background: white | Encoded text: Hello PDF417; Total codewords: 21; Symbol size: 3 cols x 7 rows; Security level: 2; Compaction: Byte |
| Multi-line text | Text to encode: DL / DAQ123456789 / DCSSMITH / DDENONE; Error correction level: 4; Data columns: 5; Background: white | Encoded text: DL DAQ123456789 DCSSMITH DDENONE; Total codewords: 65; Symbol size: 5 cols x 13 rows; Security level: 4; Compaction: Byte |
| URL encoding | Text to encode: https://xerobit.dev/tools/pdf417-barcode-generator/; Error correction level: 3; Data columns: 4; Background: transparent | Encoded text: https://xerobit.dev/tools/pdf417-barcode-generator/; Total codewords: 64; Symbol size: 4 cols x 16 rows; Security level: 3; Compaction: Byte |
FAQ
What is a PDF417 barcode?
PDF417 is a two-dimensional stacked barcode format that encodes data in a grid of rows and columns. Each codeword consists of 4 bars and 4 spaces spanning 17 modules, hence the name 417.
How much data can PDF417 hold?
The PDF417 standard allows about 1,850 text characters, 2,710 digits or 1,108 bytes in one symbol, depending on the error correction level and column count. Because this generator uses byte and numeric compaction, expect roughly 1,100 bytes of text or 2,700 digits at most.
What does the error correction level do?
It determines how many Reed-Solomon error correction codewords are added. Level 0 adds 2 codewords while level 5 adds 64. Higher levels let scanners recover data from damaged or partially obscured symbols.
Is PDF417 the same as a QR code?
No. PDF417 is a stacked linear barcode made of horizontal rows of codewords. QR codes are matrix barcodes arranged in a square grid with finder patterns in three corners. They serve different use cases.
Where is PDF417 commonly used?
It is the standard format for North American driver licenses under AAMVA, and is also used on airline boarding passes, shipping labels and event tickets.
Does this pdf417 barcode generator upload my data?
No. All encoding and SVG rendering happens locally in your browser. Your text is never sent to any server.