IdScanner

IdScanner/Guides/Licence barcodes

What is actually in a driver's licence barcode?

The black rectangle on the back of every US and Canadian licence is a PDF417 barcode holding a structured copy of the card's own data. Knowing what is in it — and what is not — explains most of what an ID scanner can and cannot do.

PDF417, and the standard behind it

PDF417 is a two-dimensional barcode format. It is not specific to identity documents; what makes a licence barcode a licence barcode is the standard that defines the data inside it — the AAMVA DL/ID Card Design Standard, published by the American Association of Motor Vehicle Administrators.

AAMVA is a North American standard. It covers US states and territories and Canadian provinces. It does not cover Europe, Asia, Latin America or anywhere else — a point with practical consequences at the end of this page.

The data elements

Inside the barcode, data is stored as three-letter element codes followed by a value. These are the ones a door actually cares about:

CodeMeaning
DCSFamily name (surname)
DACFirst name
DADMiddle name
DBBDate of birth
DBAExpiry date
DBDIssue date
DAQLicence or ID number
DAJJurisdiction — the state or province code
DCGCountry (USA or CAN)
DAKPostal code
DBCSex

There is more — height, eye colour, address, endorsements, restrictions — but the list above is what an age check runs on.

The date-format trap

This is the detail that breaks naive scanner implementations, and it is worth knowing about even if you never write one.

Dates in an AAMVA barcode are eight digits, but the order depends on the country and the spec version:

So 01021990 is 2 January 1990 on a Canadian card read one way, and an invalid date read the other. A scanner that assumes one format silently produces wrong ages for every card from the other group — and it will look like it is working, because most of the dates it produces are plausible.

Why this matters at a door: a wrong-by-a-format age is not a visible failure. Nothing errors, nothing flashes red — the card simply gets an age that is wrong, sometimes by decades, sometimes by a few days in exactly the range that matters.

What the barcode does not contain

Passports and ID cards: the MRZ instead

Documents outside North America have no AAMVA barcode. What they have is the machine-readable zone — the two or three lines of chevron-padded monospaced text at the bottom of a passport's photo page, defined by ICAO 9303.

The MRZ carries the same essentials — name, document number, nationality, date of birth, sex, expiry — in fixed character positions. It adds something AAMVA does not have: check digits, small arithmetic checksums over the document number, the birth date and the expiry date. A failed check digit means the line was altered or misread, and it can be detected on the spot.

Two formats matter in practice: TD3, two lines of 44 characters, used by passports; and TD1, three lines of 30 characters, used by ID cards.

What this means for European documents

The practical upshot, and the most common support question we get:

So at a European door, the passport or the national ID card is the document that scans. The driving licence generally is not.

How IdScanner reads both

IdScanner parses AAMVA PDF417 and ICAO 9303 MRZ into the same result, handles the date-format difference by country and spec version, and surfaces MRZ check-digit failures as integrity flags on the verdict screen. Parsing happens entirely on the phone — no document data is uploaded anywhere.