PDF417 on a license
North American driver’s licenses carry a PDF417 2D barcode on the back. Many US cards also print a small 1D Code 128 (sometimes Code 39) — typically the license number or ICN — which Barcify can generate alongside the PDF417.
PDF417 is only the container. Contents follow the AAMVA DL/ID Card Design Standard: every field is a three-letter element ID plus a value — DAQ (DL number), DCS (last name), DBB (date of birth), and so on.
Barcify builds that payload, then renders it with bwip-js.
Verifying the barcode
- Scan with any PDF417-capable phone camera app
- Hardware ID and point-of-sale scanners
- CLI:
zbarimg barcode.png or a zxing decoder
- Review the raw AAMVA text in the Encoded payload panel
The repository includes test-roundtrip.js — encode then decode must match byte-for-byte.
Date & format rules
- US: dates
MMDDYYYY, country DCG=USA
- Canada: dates
CCYYMMDD, country DCG=CAN
- US ZIP often zero-padded to eleven characters in the barcode
- Height: US often
070 in; Canada often 178 cm
Command-line interface
node generate.js -o sample.png
node generate.js --country CAN -o ca.png
node generate.js --text "HELLO" -o hi.png
node generate.js --payload-only
Full options live in the project README on GitHub.
AAMVA element dictionary
| ID | Element | Notes |
| DAQ | DL/ID number | State-specific pattern |
| DCS / DAC / DAD | Last / First / Middle | UPPERCASE, ≤40 |
| DAE / DAF | Suffix / Prefix | JR, SR, II… |
| DBB / DBD / DBA | DOB / Issue / Expiry | US MMDDYYYY · CA CCYYMMDD |
| DBC | Sex | 1=M 2=F 9=U |
| DAY / DAZ | Eyes / Hair | ANSI D-20 codes |
| DAU / DAW | Height / Weight | “070 in” or “178 cm” |
| DAG…DAK | Address | ZIP often padded to 11 |
| DCA / DCB / DCD | Class / Restrictions / Endorsements | Jurisdiction codes |
| DCF / DCK | DD / ICN | DD unique per issue; ICN ≤25 chars — often the 1D barcode (FL, NE) |
| DDA / DDB / DBH | REAL ID / Revision / Donor | Modern cards |
| DCG | Country | USA or CAN |
Educational / QA tool. Do not use Barcify to create fraudulent identification.