Parse & analyze a PDF417 driver license scan

Paste a raw barcode payload below, or focus the textarea and scan an AAMVA driver license / ID card with an HID keyboard-wedge barcode scanner. The decoder reports the parsed structure, derives the equivalent Annex F magnetic-stripe tracks, and flags anything that looks wrong — missing preamble bytes, CRLF normalization, unknown element IDs, length mismatches, and other scanner-configuration smells.

Client-side only · nothing uploads

AAMVA magnetic stripe (Annex F) encoding

Annex F of the AAMVA DL/ID Card Design Standard defines the optional magnetic stripe on the back of a driver license or ID card. It encodes cardholder data across three tracks as printable ASCII, and it exists alongside the PDF417 barcode defined in Annex D — many jurisdictions issue cards carrying both.

DLEncoder renders the magstripe byte stream live, next to the PDF417 byte stream, for the same synthetic person. Sentinels and field separators are highlighted, and each track reports its own character count. The same derivation runs in the decoder: paste a PDF417 payload and you get the equivalent Annex F tracks back.

Track layout

Annex F track structure as emitted by DLEncoder. Widths in parentheses; “V” fields are variable and space- or separator-delimited.
TrackSentinelsFields
Track 1%?State (2) · City (V, ≤13) · Name family$first$middle$suffix (V, ≤35) · Address line1$line2 (V, ≤29). A ^ separator is emitted when a variable field is under its maximum width.
Track 2;?IIN (6) · DL number (≤13, letters converted to ordinals) · = · Expiration YYMM · Date of birth CCYYMMDD · DL-number overflow (field 7, only when the DL number exceeds 13 characters).
Track 3%?CDS version (1) · Jurisdiction version (1) · Postal code (11) · Class (2) · Restrictions (10) · Endorsements (4) · Sex (1) · Height FII (3) · Weight (3) · Hair (3) · Eyes (3).

Frequently asked questions

What is an AAMVA magnetic stripe (Annex F)?

Annex F of the AAMVA DL/ID Card Design Standard defines the optional magnetic stripe on the back of a driver license or ID card. It encodes cardholder data across three tracks as printable ASCII, and it exists alongside the PDF417 barcode defined in Annex D — many jurisdictions issue cards carrying both.

What is encoded on tracks 1, 2 and 3?

Track 1 carries the jurisdiction, city, cardholder name and street address. Track 2 carries the issuer identification number (IIN), the driver license number, the expiration date as YYMM and the date of birth as CCYYMMDD. Track 3 carries the postal code, vehicle class, restrictions, endorsements, sex, height, weight, hair color and eye color. Each track opens with a start sentinel and closes with the end sentinel “?”.

How is the driver license number encoded on track 2?

Each letter in the driver license number is replaced by its two-digit position in the alphabet — A becomes 01, through Z which becomes 26 — while digits pass through unchanged and punctuation and spaces are dropped. The result is truncated to 13 characters on track 2; anything longer overflows into field 7 of the same track. For example, C2927129 encodes as 032927129.

Does the magnetic stripe output match what a real card reader returns?

Not byte for byte. DLEncoder emits the spec-compliant Annex F form rather than the output of any particular reader or jurisdiction. Three known California reader deviations are deliberately not reproduced: the track 3 start sentinel stays “%” rather than “#”, the version bytes stay “00” rather than “!!”, and sex is encoded as 1, 2 or 9 rather than M or F. Track 3 ends immediately after eye color, with no jurisdiction discretionary tail and no LRC, because neither is derivable from barcode data.

Can I decode a magnetic stripe?

No. The decoder accepts a raw AAMVA PDF417 payload — pasted, or scanned with an HID keyboard-wedge scanner — and derives the equivalent Annex F magnetic-stripe tracks from it. It does not parse raw magnetic-stripe input.

Which AAMVA versions and jurisdictions are supported?

Both v10 (2020) and v11 (2025) of the DL/ID Card Design Standard, with version-aware element gating so v10-only and v11-only elements are omitted automatically. Issuer identification numbers cover all 50 states, the District of Columbia and five territories; driver license number formats cover 51 jurisdictions; and synthetic city, ZIP and county data covers 45 states. Jurisdiction-specific Z-subfiles are supported, including the Texas LTC (ZT) subfile.

Is my data uploaded anywhere?

No. Encoding, decoding, magnetic-stripe derivation and barcode rendering all run in your browser. Nothing is sent to a server and nothing is stored.