AAMVA DL/ID Barcode Versions 1–10 Explained

How AAMVA card barcode versions differ, how to read the version from the ANSI header, and why parsers must handle old and new cards.

The header

Every AAMVA barcode starts with a compliance indicator and the word ANSI, then a six-digit issuer identification number, the AAMVA version, the jurisdiction version, and the number of subfiles.

Extracting It Automatically

When you read this data from photos, the Driver License PDF417 OCR API returns it as structured JSON, and you can apply the rules on this page as validation. Try it with the free scanner.

Where This Fits

  • Subfiles: A directory lists subfiles such as DL (license), ID (identification card), and jurisdiction-specific Z subfiles, with their offsets and lengths.
  • Why versions matter: Field names, name layout, and truncation indicators changed across versions, and cards stay in circulation for years, so a parser sees many versions at once.
Need more testing? Create a free account to get 200 free credits (equals 100 Passport scans).

Extract It with the API

Read the document from a photo and validate the returned fields.

Prerequisite: Python 3.9+, `pip install requests`, and a STRUCTOCR_API_KEY

PYTHON EXAMPLE
import base64
import os
import requests

with open("license-back.jpg", "rb") as image_file:
    image = base64.b64encode(image_file.read()).decode("ascii")

response = requests.post(
    "https://api.structocr.com/v1/driver-license-pdf417",
    headers={"x-api-key": os.environ["STRUCTOCR_API_KEY"]},
    json={"img": image},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]
print("document_kind:", data.get("document_kind"))
print("document_number:", data.get("document_number"))
print("date_of_birth:", data.get("date_of_birth"))
print("region:", data.get("region"))

Technical Specs

  • •Endpoint: POST https://api.structocr.com/v1/driver-license-pdf417
  • •Authentication: x-api-key request header
  • •Inputs: JPG, PNG, or WebP as Base64 JSON; maximum 4.5MB
  • •Price: 2 credits per successful request; failed requests are not billed
  • •Free trial: 200 free credits on sign-up, no credit card required

Key Features

  • •Subfiles: A directory lists subfiles such as DL (license), ID (identification card), and jurisdiction-specific Z subfiles, with their offsets and lengths.
  • •Why versions matter: Field names, name layout, and truncation indicators changed across versions, and cards stay in circulation for years, so a parser sees many versions at once.
  • •Validate after OCR: Apply these rules to API output before storing it.

Reference Summary

Key facts from this page in structured form, for quick lookup.

{
  "The header": "Every AAMVA barcode starts with a compliance indicator and the word ANSI, then a six-digit issuer identification number, the AAMVA version, the jurisdiction version, and the number of subfiles..",
  "Subfiles": "A directory lists subfiles such as DL (license), ID (identification card), and jurisdiction-specific Z subfiles, with their offsets and lengths..",
  "Why versions matter": "Field names, name layout, and truncation indicators changed across versions, and cards stay in circulation for years, so a parser sees many versions at once.."
}

Frequently Asked Questions

Which versions does StructOCR support?

Versions 1 through 10, normalized into one schema, with document_kind telling licenses from ID cards.

What happens with a non-AAMVA barcode?

The API returns AAMVA_NOT_VALID so your flow can ask for the correct side of the card.

You May Also Like

Related tutorials, platform guides, and comparisons

Country Tutorial

Kenya Driver License OCR: Extract Fields with Python

Extract visible fields from Kenya driver license images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.

Python · Driver License
Country Tutorial

Virginia Driver License OCR: Extract Fields with Python

Extract visible fields from Virginia driver license images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.

Python · Driver License
Tutorial

Delaware Driver License & ID Card PDF417 API

Decode the PDF417 barcode on Delaware driver licenses and state ID cards into AAMVA JSON, with document_kind to tell licenses from ID cards.

Driver License
Country Tutorial

Philippines Driver License OCR with Python SDK

Extract structured fields from a Philippines LTO driver's license with the StructOCR Python SDK and FastAPI.

Python · Driver License
Tutorial

Driver License PDF417 Glare and Blur Capture Guide

Design a better driver license barcode capture flow by controlling glare, motion blur, distance, perspective, and image compression.

Driver License
Country Tutorial

Canada Driver License OCR with Python SDK

Extract structured fields from a Canada provincial driver licence with the StructOCR Python SDK and FastAPI.

Python · Driver License
Tutorial

Alabama Driver License & ID Card PDF417 API

Decode the PDF417 barcode on Alabama driver licenses and state ID cards into AAMVA JSON, with document_kind to tell licenses from ID cards.

Driver License
Country Tutorial

Canada Driver License OCR with Node.js SDK

Extract structured fields from a Canada provincial driver licence with the StructOCR Node.js SDK and TypeScript + Express.

Node.js · Driver License
Country Tutorial

Philippines Driver License OCR with Node.js SDK

Extract structured fields from a Philippines LTO driver's license with the StructOCR Node.js SDK and TypeScript + Express.

Node.js · Driver License
Tutorial

Acura VIN Location and VIN OCR API

Where to find the VIN on a Acura, what its first characters mean, and how to read it from a photo with an API and decode the model year.

VIN
Tutorial

ZXing Alternative: PDF417 Barcode OCR API

ZXing compared with the StructOCR REST API for driver license pdf417 extraction: deployment, pricing model, and when each fits.

Driver License

Technical Comparisons & Integrations

Explore platform integrations and competitive analysis

From tutorial to production in 5 minutes.

You've seen the code. Now get your API key, grab your 200 free credits, and see it work with your own images. No credit card required.

Instant Access Cancel Anytime No Credit Card