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.
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
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
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.
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.
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.
Philippines Driver License OCR with Python SDK
Extract structured fields from a Philippines LTO driver's license with the StructOCR Python SDK and FastAPI.
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.
Canada Driver License OCR with Python SDK
Extract structured fields from a Canada provincial driver licence with the StructOCR Python SDK and FastAPI.
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.
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.
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.
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.
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.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
Add Driver's License OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a Bolt.new app. Build car rental and mobility onboarding flows right in your browser.
Add Driver's License OCR using Cursor in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API using the Cursor AI code editor. Build car rental and mobility onboarding flows rapidly.
Add Driver's License OCR to Your Lovable.dev App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a Lovable.dev app. Build car rental and mobility onboarding flows with zero backend.
Add Driver's License OCR to Your Replit App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a Replit application. Build car rental and mobility onboarding flows using Replit Agent and Secrets.
Add Driver's License OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a v0 by Vercel app. Build car rental and mobility onboarding flows with zero backend.
OpenALPR vs. StructOCR API for VIN Decoding
Why traditional License Plate Recognition (ALPR) engines are not suitable for scanning Vehicle Identification Numbers (VINs).
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.