Driver's license OCR: fields, the PDF417 barcode and how to automate license capture

For onboarding, KYC and loan operations teams. It covers what a US driver's license holds, how OCR and a barcode reader capture it, the checks to run on every license and the tools that automate the work.

Illustration of a driver's license with the ID number field extracted by OCR

Key takeaways

  • Driver's license OCR reads the printed fields on a license and returns them as structured data. The fields include the license number and class, the dates, and the holder's name, date of birth and address.
  • US licenses carry the same core fields in a PDF417 barcode on the back. It is written to the AAMVA card design standard, with three-letter element IDs such as DAQ for the license number and DBB for the date of birth.
  • The front and the barcode don't always use the same format. The barcode writes US dates as MMDDCCYY, which is month, day, then a four-digit year with no separators. It writes sex as 1, 2 or 9 and height in inches. Convert both copies to the same format before you compare them.
  • Checks on expiration, front against barcode, and license against the application catch misreads and mismatches. They don't prove a card is genuine.
  • Automated capture sends licenses that pass every check to the KYC system or loan origination system (LOS) through an API. It routes only the flagged fields to a person.
On this page
  1. What is driver's license OCR?
  2. Fields you can extract from a driver's license
  3. What's in the barcode on a driver's license?
  4. How to extract data from a driver's license with OCR
  5. Checks to run on every driver's license
  6. Driver's license OCR APIs, SDKs and tools
  7. How to automate driver's license capture
  8. Read both sides, then compare them
  9. Frequently asked questions

Driver's license OCR reads the printed front of a driver's license and turns it into structured data. The fields are name, date of birth, address, license number and class, plus the issue and expiration dates. On US licenses it is paired with a decoder for the PDF417 barcode on the back. That barcode stores the same core fields under AAMVA element IDs, so the two copies can be checked against each other. Banks, lenders, insurers and trucking fleets use it to fill onboarding, KYC, loan and driver records without retyping the card. Insurers and trucking fleets use it for driver records.

What is driver's license OCR?#

OCR turns the characters in an image into text. Driver's license OCR adds the part that makes the text useful. It knows which string is the license number and which date is the date of birth, and it returns each one as a named field. It's also called driving license OCR, or sold as a driver's license data extractor or parser.

A US license carries its data twice. The front is printed for people. The back has a PDF417 barcode for machines. A barcode reader decodes it, not OCR. Holograms and microprint are security features, not data to extract.

Driver's license front with five fields linked to AAMVA barcode elements DAQ, DCS, DAC, DBB and DBA from the PDF417 back
The PDF417 barcode on the back stores the same fields under AAMVA element IDs, with dates as MMDDCCYY, so values read from the front can be checked against it.

Fields you can extract from a driver's license#

The AAMVA DL/ID Card Design Standard, the North American standard for license design, sets the fields a license must show. It numbers them on the card, with 4d for the license number and 3 for the date of birth. It also gives each a three-letter element ID in the barcode.

  • Name

    Family name (field 1) and given names (2). Barcode elements DCS, DAC and DAD. Other barcode elements show whether a name was cut short.
  • Date of birth

    Field 3, written MM/DD/CCYY on US cards. Barcode element DBB.
  • Address

    Field 8 holds the street, city, state and ZIP code. Barcode elements DAG, DAI, DAJ and DAK.
  • License number and issuing state

    Field 4d is an ID each state assigns in its own format, with the state named across the top. Barcode element DAQ, with the issuer identified in the header.
  • Issue and expiration dates

    Fields 4a and 4b. Barcode elements DBD and DBA.
  • Class, endorsements and restrictions

    Fields 9 and 9a, and field 12, in the state's own codes, explained on the card. Barcode elements DCA, DCD and DCB.
  • Physical description

    Sex (15), height (16) and eye color (18). Barcode elements DBC, DAU and DAY.
  • Document discriminator

    Field 5 is a number that tells this card apart from others issued to the same person. Barcode element DCF.

A bank's Customer Identification Program (CIP) must record certain facts about an ID it relies on. These are the document type, ID number, place of issuance, and issue and expiration dates. A driver's license carries all of them.

What's in the barcode on a driver's license?#

The barcode on the back is a PDF417, a two-dimensional barcode that every AAMVA-compliant and REAL ID-compliant card must carry. Its standard fields aren't encrypted, so any PDF417 reader can decode them. A header starts with "@" and "ANSI" and identifies the issuer by a six-digit number. Then come the fields, one after another, each opening with its element ID.

The barcode repeats the front, but not always in the same form. Convert both copies to the same format before you compare them.

FieldOn the frontIn the barcode
License numberDLN E7304158DAQE7304158
Date of birthDOB 04/22/1991DBB04221991
SexSEX FDBC2
HeightHGT 5'-06"DAU066 in
Long namesShortened to fit the cardDDE, DDF and DDG flag a truncated name

Canadian cards write barcode dates year first (CCYYMMDD). A mandatory field with no value reads "NONE", or "unavl" when the issuer doesn't have the data.

How to extract data from a driver's license with OCR#

Whatever tool you use, license capture runs through the same stages, from upload to your KYC or loan system.

  • Front photo
  • Back photo
  • Application data
API and webhooks
  1. 01Identify state and version
  2. 02Read the front
  3. 03Decode the barcode
  4. 04Cross-check
  5. 05Review exceptions
KYC system or LOS
How a driver's license moves from upload to your system
  1. Capture both sidesKeep the card flat, in focus and without flash. Glare on the laminate can wash out a field or the barcode. Phone photos work when the whole card is in frame.
  2. Identify the state and versionLayouts differ by state, and older designs stay valid after a redesign. AAMVA's standard cites estimates of well over 200 valid designs. The barcode header names the issuer and the standard version.
  3. Read the frontOCR reads the text. The software then matches each value to its field, using the label or reference number beside it.
  4. Decode the barcodeA PDF417 reader turns the back into text, and a parser splits it into fields on the element IDs.
  5. Cross-checkNormalize formats, then compare the front with the barcode and both with the application.
  6. Review and deliverUnreadable or mismatched fields go to a person with the image beside them. Clean records go to your KYC system or loan origination system (LOS) through an API.

Checks to run on every driver's license#

These are data checks. They catch misreads and mismatches between the license and what the applicant told you. Proving the card is genuine takes an identity verification tool. Confirming the state holds the same data takes a check such as AAMVA's DLDV service.

  • Not expiredThe expiration date is after the day you rely on it. The CIP rule names an unexpired government-issued photo ID, such as a driver's license, as a document banks may use.
  • Front matches barcodeLicense number, name, date of birth and expiration agree once formats are normalized. A mismatch usually means a misread, so re-read the field or send it for review.
  • Matches the applicationName and date of birth agree with the application and the rest of the file. A different address may only mean the person moved after the license was issued, so ask rather than decline.
  • License number fits the stateEach state sets its own format, so check the length and pattern for the issuing state.
  • Nothing missingBoth sides arrived, the barcode decoded and every field your records need was read.

The figure below runs the front-against-barcode check on one license.

License
FieldExtracted valueConfidence
License numberD4827-19305-66
ClassD
Issue date2021-07-15
Expiration date2029-07-22
A driver's license being read, front and back, with the barcode checked against the front.

Driver's license OCR APIs, SDKs and tools#

Three kinds of tools read driver's licenses, through an API, an SDK or both. Which one fits depends on whether you need the whole file read, the license alone, or proof that the person matches the ID.

  • Document AI platforms

    Docsumo, our product, reads the license with the rest of the file, such as the application, pay stubs and bank statements. On the Enterprise plan it also checks them against each other. Output goes through an API and webhooks. It doesn't match selfies or test a card's security features.
  • Cloud OCR APIs

    Amazon Textract (AnalyzeID), Google Document AI (US driver license parser) and Azure Document Intelligence (ID document model) return the fields as JSON. Pricing is published. You build the checks and workflow around them.
  • Identity verification platforms

    Jumio, Socure and Stripe Identity check the ID document and match a selfie to its photo while a customer signs up. They return a verification result.

For a vendor-by-vendor comparison of the identity tools, see the best KYC document verification software.

How to automate driver's license capture#

A license usually comes with other documents. Docsumo reads the front with a ready-made driver's license model. A step in the workflow decodes the PDF417 barcode on the back with a barcode-reading tool. Then the front and the barcode data can be compared. Docsumo handles any other document type, so it reads the license with the rest of the loan file or onboarding packet. On the Enterprise plan, cross-document validation checks the license against the other documents. The same name and date of birth should appear everywhere, and the address should match the application.

You set a confidence threshold. Fields the model is less sure about go to your reviewers. A reviewer clicks a field to see its source line on the image. Their corrections improve the model. Results reach your KYC system or LOS through the API and webhooks. For motor carriers, driver qualification file processing flags an expiring CDL against a window you set when the record is read.

Where we land. Judge license capture by the whole file, not the single card. A license can be read perfectly and still disagree with the application, the pay stubs or the bank statements. We would put the effort into the checks between those documents. That comparison shows whether the file is consistent. Reading the card is the easier part.

  • 99%field-level accuracy across 250+ document types
  • 95%+of documents processed straight through, without manual review

Read both sides, then compare them#

A US driver's license carries its data twice. It is printed on the front and encoded in the PDF417 barcode on the back. Read both, normalize the formats, and check them against each other and the application. Send only the mismatches to a person. When you also need proof that the card is genuine, add identity verification.

Book a demo with a sample onboarding or loan file, or start a free trial.

Frequently asked questions#

What is driver's license OCR?

Driver's license OCR is software that reads the printed fields on a driver's license, such as name, date of birth, address, license number and expiration date. It returns them as structured data. On US licenses it's paired with a decoder for the PDF417 barcode on the back, so the two copies of the data can be compared.

Can OCR read the barcode on a driver's license?

No, not on its own. OCR reads printed characters. The PDF417 barcode on the back of a US license needs a barcode reader. A parser then splits the decoded text into fields by their three-letter AAMVA element IDs, such as DAQ for the license number. Use both, because the barcode is a second copy of the data to check the front against.

What happens when your driver's license is scanned?

The scanner decodes the PDF417 barcode on the back, which holds your name, date of birth, address, license number, license dates and physical description. The AAMVA standard requires that data to be unencrypted, so any compatible reader can decode it. The scan reads only what's on the card. Checking the data against state records is a separate step.

What's the difference between driver's license OCR and driver's license verification?

OCR reads the data off the card. Verification checks it. AAMVA's Driver's License Data Verification (DLDV) service, open to organizations AAMVA approves, compares the data with the records of participating issuing states. It returns a match flag for each field. Identity verification platforms test the card's security features and match a selfie to its photo. See how the pieces fit in automated KYC verification.

How do you keep driver's license data secure?

Treat license images and fields as sensitive personal data. Encrypt them in transit and at rest, and limit who can see them. Keep them only as long as you need them, and redact what a reviewer doesn't need to see. Ask any vendor for its SOC 2 Type 2 report and ISO 27001 certificate. Docsumo is SOC 2 Type 2 audited and ISO/IEC 27001:2022 certified, can find and redact sensitive data, and doesn't use customer documents to train shared or third-party models. See security.

Should you outsource driver's license processing?

Outsourcing moves the keying, and copies of your customers' IDs, to another company. Software keeps the work in-house. It reads the license, and your own staff review only the fields it flags. Docsumo works this way. It supplies the software, not a managed review team.

See Docsumo read your own documents

Bring a few real samples. We'll show the fields extracted, the checks that ran and what a reviewer would see.