PDF417 barcode generator

PDF417 is not a matrix code. It is a short linear barcode stacked on itself: every row is a run of bars and spaces that a beam can sweep the way it sweeps a shop barcode, and the rows are numbered so a decoder can put the pieces back in order after reading them out of sequence. The name is a description of the building block — each codeword is four bars and four spaces spanning seventeen modules, four and seventeen. That structure is why PDF417 ended up in documents rather than on posters: it can be read by laser scanning equipment that has no camera in it at all.

Appearance
Size
Colours

321 × 182 px in the PNG

Size units

Specification

Character set
any data
Length
from 1 to 1850 characters
Check digit
not used by this symbology

Where it is used

  • Identity documents, where the machine-readable block on the back of a card holds the same fields as the printed face for anyone with a reader
  • Printed boarding passes and travel documents, where the whole itinerary record travels on the paper rather than in a lookup against a server
  • Transport and dispatch paperwork — consignment notes, delivery notes, manifests — where a form is scanned as a document rather than picked off a shelf
  • Forms that must survive being printed, filled in and posted, and then read back in a batch scanner without anyone retyping the fields

How it compares

Data Matrix and QR Code are matrix symbologies: the data lives in a two-dimensional grid, and reading one requires an imager that can capture the whole area at once. PDF417 is stacked linear, and the difference is not academic — a raster laser scanner, which sees only a line at a time, can read PDF417 and cannot read a matrix code at all. That single property decided where each format ended up. The standards that specify PDF417 for identity cards, tickets and transport documents were written for scanning estates built around lasers, and those estates outlive any individual scanner. The cost of the stacking is width. Each row spends four codewords on structure before it carries anything: a start pattern, a row indicator on each side, and a stop pattern, so a row is seventeen modules times the number of data columns plus four, and one module more for the closing bar. With two data columns that is 103 modules across, of which 34 carry your data. Data Matrix has no such per-row tax, which is why it wins outright on small parts, and QR wins outright when the reader is a phone. Reach for PDF417 when the receiving end scans documents, or when the format of the payload is dictated by a standard that already names PDF417.

Common mistakes

  • Letting the payload grow until the rows collapse. The symbol drawn here keeps the same overall height whatever you type, so more data means more rows squeezed into it, and the row indicators stop being distinguishable long before the data does. The sample value comes out nine rows tall with rows about six modules high. At 200 characters it is twenty rows and the rows are down to 2.8 modules — already under the three-module floor the format is drawn for. At the 1850-character ceiling the symbol is 52 rows and 18 data columns wide, and each row is roughly one module tall: a picture of a barcode rather than a barcode. Either cut the payload or give the placed file more height in your layout, because the vector will stretch and the ratio is what matters.
  • Choosing PDF417 for something short. The per-row overhead is fixed, so a small payload pays for structure it does not need — two data columns means two-thirds of every row is start pattern, row indicators and stop pattern. A URL or a serial number is the wrong job for this symbology; it starts paying its way when the payload is a record with many fields.
  • Trimming the artwork to the ink. PDF417 asks for two modules of quiet zone on all four sides, half of QR's four, and therefore easy to mistake for slack in the layout. The start and stop patterns sit right on that boundary, and they are what tells a beam it has crossed a whole row rather than part of one — clip them and a scan that looks successful can return a truncated row.
  • Rebuilding a payload read out of somebody else's document. The bytes inside an identity card or a boarding pass follow a data format set by the body that issues the document, not by the symbology, and this page will happily encode an edited version of that string into a technically perfect symbol. The barcode being valid says nothing about the document being genuine, and the two should not be confused.

Frequently asked questions

How much data does PDF417 hold?
At the top of the format, 1850 characters of text, 2710 digits or 1108 bytes — this field stops at 1850. The three figures differ because there are three ways of packing data into codewords: text compaction fits two characters per codeword, numeric compaction a little under three digits, and byte compaction only 1.2 bytes. That is measurable here. Two hundred Latin letters come out six data columns wide and twenty rows tall; the same two hundred characters in Cyrillic fall out of text compaction into byte mode and come out twelve columns and thirty-four rows — about three and a half times the codewords for the same number of characters.
Does PDF417 need a check digit?
No, and there is nothing to append to your data. Error correction is built into the encoding as Reed-Solomon codewords spread across the symbol, at one of nine levels: level 0 spends two codewords on correction and each step up doubles that, so level 8 spends 512. Higher levels survive more damage and make the symbol larger, which on a stacked format means more rows, and more rows in a fixed height means flatter rows.
Will a phone camera read it?
The decoding libraries that phone apps are built on include PDF417, but an app only looks for the formats it has been told to look for, and one written for QR codes will find nothing on the page. Where PDF417 lives, the reader is specified alongside the document itself, so the question does not arise. It arises when you put PDF417 somewhere the public is expected to scan it — and that is a reason to use a different symbology.
What is MicroPDF417?
A separate, compact member of the same family with a fixed set of small formats and no row indicators of the ordinary kind. It exists for exactly the case described above — a short payload that would otherwise pay the full per-row overhead — and it is a different symbology, not a setting on this one. This page produces standard PDF417.
Why does it come out as a long flat strip?
Because it is built out of rows, and a row has to be wide enough to hold the whole structure of a linear barcode. The shape is the point rather than a side effect: a long flat strip fits along the foot of a form or the back edge of a card, where a square of the same capacity would have to eat into the layout. If a wide strip is wrong for your surface, the honest answer is that PDF417 is the wrong format for it.