en

Language

18 May 2026 in Document verification

How Barcode Reading Works for ID Cards, Passports, and Driver’s Licenses

Ihar Kliashchou

Chief Technology Officer

Identity verification often embraces the principle of “the more, the merrier.” New elements are added, but older machine-readable features often remain because they are cheap, practical, and widely supported.

Barcodes are a good example. A barcode represents data in a visual, machine-readable form. It consists of codewords: combinations of bars, spaces, dots, or cells that correspond to numbers, letters, or other symbols. 

Unlike their more intricate counterparts, such as CRLs or lenticular images, barcodes are inexpensive, easy to add to documents, and can be read with a regular smartphone. But despite their apparent simplicity, barcodes play a crucial role in document security.

This post covers how barcodes are used in identity documents, what data they can contain, and how barcode reading software helps you processes them effectively.

In brief:

  • Barcodes in ID documents can store names, dates, document numbers, addresses, portraits, biometric data, certificates, URLs, access codes, and digital signatures.

  • Common barcode types in identity documents include PDF417, QR code, Code 128, Code 39, Data Matrix, ITF-14, and Aztec Code.

  • For identity verification, barcode data should be parsed, validated, and cross-checked against other document sources, including VIZ, MRZ, and RFID chip data when available.

What types of barcodes are used in ID documents?

Barcodes are generally categorized into two main groups: 1D and 2D. 1D barcodes are read horizontally, so only their width carries the encoded information. With 2D barcodes, both width and height matter, allowing them to store more data in a smaller space.

There are over 90 barcode types in total as new formats appear. In identity documents, however, the range is more conservative. According to Regula’s identity document template database, there are seven main barcode types: three from the 1D group and four from the 2D group.

Let’s have a closer look at each of them.

barcodes on id cards, passport barcodes
Subscribe

Get posts like this in your inbox with the bi-weekly Regula Blog Digest!

1D barcodes

1D barcodes, also known as linear barcodes, store data in a series of parallel lines of varying widths and spacings. This is the classic barcode format many people recognize from packaging, tickets, and labels.

In identity documents, 1D barcodes usually carry compact data, such as document numbers, dates, or other short identifiers.

Code 128

code 128 barcode sample

This barcode stands out due to its high data density and versatility. It’s often used in the shipping and packaging industries, and, of course, can be seen in identity documents too. It can encode full ASCII characters, making it suitable for encoding additional personal information.

Code 128 is the most widespread barcode type among the 1D group. It appears in almost 700 identity documents, mostly ID cards and driver’s licenses.

a Latvian ID card with Code 128

A Latvian ID card with a Code 128 barcode.

Code 39

code 39 barcode sample

Code 39 was invented in 1974. It can encode letters, numbers, and some special characters. Unlike Code 128, it doesn’t have a check digit, and its simplicity allows for easy scanning and decoding by any barcode reading software.

At the moment, Regula’s database of identity document templates includes about 400 documents with Code 39. Typically, they contain a number or series of numbers and dates.

code 39 in ID documents

Code 39 barcode in a Finnish driver’s license and Singapore work permit.

ITF-14

ITF-14 barcode sample

The ITF-14 barcode specializes in encoding digits, and can include a checksum as the final digit for added verification. It’s a barcode with very high data density, so it can be smaller than other codes with the same digits, meaning it can be used in limited spaces.

In the context of ID documents, ITFs are less common than the two previous types. This barcode appears in less than 50 types of documents: ID cards and driver’s licenses.

ITF-14 in ID documents

ITF-14 in Bosnia and Herzegovina ID Card (2013), reverse side.

2D barcodes

2D barcodes store information both horizontally and vertically, allowing them to hold much more data in a smaller space.

That extra capacity is why 2D barcodes are especially useful in identity documents. Depending on the document and issuing authority, they may contain personal data, document details, portraits, biometric-related data, certificates, digital signatures, URLs, or access codes.

PDF417

pdf417 barcode sample

In PDF417, PDF stands for Portable Data File, while 417 means that each pattern in the code consists of 4 bars and spaces in a pattern that is 17 units long. Introduced in 1991, this barcode is the most popular of all barcodes ever used for identity documents. It can be found in almost 900 of them. 

PDF417 is favored for its capacity to hold large amounts of data, including photographs and fingerprints. PDF417 barcodes are included in numerous passports, ID cards, and driver’s licenses. This barcode type is also the standard selected by the United States Department of Homeland Security as the machine-readable zone technology for Real ID-compliant driver licenses and state-issued identification cards. 

Based on our experience, PDF417 is among the most demanding types among the barcodes used in ID documents. The thing is its extremely high density. Any physical bend or perspective distortion during capture can create significant reading challenges, because distinguishing its rows and columns is crucial for extracting the correct data.

With the growing popularity of smartphones, PDF417 is starting to lose its appeal because of its rectangular shape. Square barcodes are more mobile-friendly, because their centered alignment minimizes distortion during capture.

pdf417 barcode in different ID document types

Examples of ID documents with PDF417 in them: Egyptian passport, Uganda ID card, Arizona driver’s license.

QR code

QR code sample

Initially, QR codes (short for quick-response codes) were originally invented for the automotive industry to label vehicle parts. Today, they are used across advertising, payments, healthcare, product authentication, and identity documents. 

QR codes can encode a significant amount of data, including text, URLs, and other data types. In ID documents, they can contain detailed personal information, from names and dates to photographs and biometric data. Their square shape makes them convenient for mobile capture, while the design of QR codes can vary to ensure aesthetic appeal.

As of now, QR codes are present in over 600 documents, including passports, ID cards, driver’s licenses, and visas.

QR code in ID documents

QR code in an overseas Korean resident card.

Data Matrix

data matrix sample barcode

A Data Matrix code can store up to 2,335 alphanumeric characters, and they are highly efficient for several reasons. 

First, they can be used for marking small items, because they can encode fifty characters in a symbol that is readable at 2 or 3 square millimeters. Second, they can be read with just a 20% contrast ratio. Finally, they are very reliable: even if one or more cells are damaged, the message can still be read. 

When it comes to identity documents, at the current time, these codes are present in less than 100 documents. For instance, they can be found in Belgian IDs.

data matrix in a Belgian ID card

A Data Matrix barcode in a Belgian ID card (2021).

Aztec Code

Aztec code sample

Aztec codes visually resemble QR codes, but the encoded data is placed in a spiral pattern around the square core in the center, called the bull’s eye. They are compact and robust, and can encode up to 2,000 characters even when space is limited.

In identity documents, Aztec Codes are rare. As of now, they can be found in only a few ID documents, including a Nigerian ID card.

an Aztec code used in identity documents

An Aztec code used in a Nigerian ID card.

Verify IDs in seconds with Regula SDK

Powered by the world’s largest ID database.

How VDS and digital credentials are changing barcode use

Many barcode types used in identity documents have existed for decades. What is changing is not only the barcode format, but also how the data inside the barcode is structured and protected.

The ICAO introduced a new universal format of barcode encoding for use in ID documents. It can be found in a recent Icelandic ID, for example.

new barcode in an Icelandic ID

A reverse side of an Icelandic ID (2024).

Another important use case is the Visible Digital Seal, or VDS. A VDS is a QR code or Data Matrix code that contains information about a document and a digital signature to protect that data against any manipulation. 

VDS can already be found in European visas, where they store an applicant’s full name, gender, dates, visa number, passport number, and other document details.

Data matrix barcode used in ID documents

German National Visa Type D with Data Matrix barcodes used in a VDS

Barcodes are also relevant to the development of Digital Travel Authorization and Digital Travel Credentials where the data within barcodes will be digitally signed.

In foundational long-term scenarios like travels, there will likely be leveraged a DTC-PC approach. It implies using a dedicated physical component, such as a chip or a particular device. 

In short-term use cases or scenarios that play a supporting role and should be cheap (providing an access code, visas, permits, etc.), barcodes will likely be used everywhere. They even have the potential to replace MRZ in many cases. 

In other words, barcodes and barcode reading technologies are definitely here to stay.

💡Guiding Core Principles for the Development of Digital Travel Credential (DTC) by the ICAO

How barcode scanning software works in identity verification

Now, let’s have a look at how barcodes are handled during identity document verification. This process consists of three basic steps: detection, reading and decoding, and data parsing.

1. Barcode detection

If barcode reading software faces a new document type, it runs a barcode detector. The detector looks for objects that resemble barcodes, then analyzes each candidate and determines its type.

If the software already recognizes the document template, the detection step can be skipped. The system already knows where the barcode should be located and what barcode type to expect.

2. Barcode reading and decoding

Once the barcode area is found, barcode reading software fetches the data. It reads the codewords, turns them into a byte array, and checks them with an error correction algorithm to confirm that it’s the correct set of bytes that the issuer laid down.

What is error correction in barcodes?

Error correction is a mechanism used in 2D barcodes that acts as a safety net during the decoding process. It allows you to fix some errors that may arise because of capture issues or physical damage to the barcode itself.

All the codewords of a barcode either contain encoded data or information for correction. The ratio is called the level of error correction. It can vary, ranging from 0 to 9. The higher the level, the more backup codewords are included. At the highest level, you can damage a significant part of the cells and still read the barcode. 

However, this comes at a price. Increasing the level of error correction requires more codewords, which eats up capacity and can lead to either a larger barcode size or a smaller payload.

3. Barcode data parsing

After decoding, the software still has only raw data. To make it useful, it needs to parse that data into structured fields. Those fields may include text fields, images, information for fingerprint verification, electronic signatures and certificates, access codes (like a card access number, or CAN), URLs, and more. 

Regula Document Reader has over 200 parsers for data encoded according to different standards (ICAO, AAMVA, ISO, etc.) and for specific custom documents. This means it can translate the vast majority of barcodes into a set of structured information that is convenient to further work with. However, what exactly is possible to parse (or whether it’s possible at all) depends on the particular issuer. 

For example, Brazilian authorities don’t disclose decoding algorithms for their identity documents, so all you can get is a set of bytes. On the opposite pole, there are American driver’s licenses, with all barcode data recorded according to the AAMVA standard. Within their barcodes, there are certain headers that can tell you the exact version of the AAMVA standard used to record the data, as well as how to parse it.

data pulled out after barcode document scanning

Well-structured and comprehensive data parsed from Arizona driver’s license.

How is barcode data checked during document verification?

Reading a barcode is not the same as verifying it. For verification, barcodes can be divided into two broad groups: 

  • Barcodes with digitally signed data 

  • Barcodes without additional cryptographic protection

 This determines the scenario of using the barcode for document verification.

If a barcode contains a digital signature, it is enough to check the signature to be sure of the authenticity of the data. However, this requires access to the necessary publisher’s certificates.

However, many identity documents still use barcodes where the data can be read as is. In these cases, document verification software has to rely on indirect checks, such as: 

  • Expected barcode type

  • Barcode size and location

  • Number of rows and columns

  • Error correction level

  • Encoded data format

That's why it’s key to find a vendor with expertise in ID documents.

For instance, Regula has a feature called a “barcode format check.” This feature checks the barcode for any incorrect or missing information, and verifies the barcode's layout. Even if a barcode has the right data and follows the encoding standards, any unusual patterns, like an unusual number of rows or columns for this specific document, will be flagged for further investigation.

real and forged barcode in an ID card

A counterfeit barcode can appear authentic unless you know the precise size used on genuine documents.

What affects barcode reading accuracy?

Barcode reading accuracy depends on three main factors: image quality, barcode size, and support for diverse barcode formats. These factors matter even more in remote identity verification, where users capture documents with different devices, lighting conditions, and camera angles.

The contrast and image quality

Barcodes are elements that consist of tiny blocks, also known as codewords. To read barcodes, you need to accurately distinguish such codewords, so it’s crucial to have a good contrast. 

Contrast, essentially, means the width of the transition between the black parts and the white parts. If you have a low resolution, there will be transitional gray areas. This complicates things.

the low contrast of barcode

With low resolution, the barcode elements become less distinct, making its reading harder.

A significant challenge arises during remote onboarding processes, often attributed to subpar camera quality or unfavorable capturing conditions (e.g., low-light environments). Take the cheapest smartphone, shoot in dim light, and even a perfectly printed barcode, regardless of the type, will have poor contrast and, hence, plenty of blurred areas. 

This issue isn’t only caused by camera quality; older documents with visible signs of wear and tear can present difficulties as well, with barcodes that may have faded or sustained damage over time.

Barcode size and density

The physical size of a barcode matters, but size alone is not enough. A large barcode can still be hard to read if it contains a dense payload or if the user captures it from too far away.

Let’s take a look at a new Austrian ID as an example. Its QR code is large. However, they are also chock-full of information — the size of the minimal element in this barcode is only about 0.17 mm. Even if the ID fits perfectly into the camera frame in portrait mode, the minimal element will hardly exceed 2 pixels. To read such barcodes well, you’ll need a very good camera.

Image of a new Austrian ID with QR

Among other things, this QR code contains a rather high-quality portrait photo.

Support for diverse barcode formats

The numerous existing barcode formats add to the complexity. While this article focuses on the seven most prevalent barcode types, even they can have sub-variations. 

Barcode standards may define recommended proportions, but identity documents do not always follow ideal layouts. For example, the recommended aspect ratio for PDF417 is 3:7, but in practice barcodes may be flattened or stretched to fit the document design.

Again, expertise and experience with identity documents is invaluable here. Regula’s experts have analyzed thousands of identity documents from around the world, including the specific ways barcodes are printed, positioned, sized, and encoded across different document types.

Because of this document-specific knowledge, Regula’s reading algorithms can account for known deviations from barcode standards, such as unusual proportions, placement, density, or issuer-specific formatting.

What to look for in barcode reading software for identity documents?

The key to reliable barcode processing is barcode reading software that can handle poor capture conditions, process different barcode types, confidently work with rotated, bent, or skewed barcodes, and parse issuer-specific data formats. For identity verification, however, barcode reading should also be part of a broader document verification workflow.

Regula Document Reader SDK is an example of such a solution. 

  • Regula processes barcodes from various sources, including photographs, scans, and real-time video streams. 

  • Its barcode reading technology is equipped to scan barcodes in documents under a wide range of conditions. It’s designed to handle all types of barcodes, even when they are inverted or captured in low light. 

  • The foundation of Regula’s barcode verification capabilities is the world's largest database of identity document templates, comprising over 16,000 documents from 254 countries and territories.

  • With support for 220 parsers, it can pull meaningful information from almost any barcode on ID documents globally, independent of their origin or specific format.

  • Regula Document Reader SDK works across different platforms and devices, contributing to user experience along with security.

Would you like to see it in practice? Talk to Regula’s experts or test-drive the solution right away.

Verify IDs in seconds with Regula SDK

Instantly verify passports, ID cards, driver’s licenses, and more—powered by the world’s largest database of document templates.

FAQ

Which types of barcodes are used in ID documents?

According to the latest data from the Regula identity document templates database, there are seven main barcode types used in identity documents: three of them are from the 1D category (Code 128, Code 39, ITF-14), and four are from the 2D category (QR Code, Data Matrix, PDF417, Aztec Code).

What is the most popular barcode in ID documents?

PDF417 is the most popular of all barcodes ever used for identity documents—it can be found in almost 900 of them.

What can a good barcode reading technology do?

There are three important aspects that majorly influence the performance of a barcode reading technology in an identity verification scenario: the capability to handle barcodes of low contrast or poor quality, the minimal element size it can confidently process, and how well the barcode reading solution navigates different types of identity documents and their peculiarities.

How does barcode reading software work?

The barcode reading process includes three basic steps: detecting a barcode, reading and decoding data, and parsing the data—i.e., turning bytes of data into meaningful information. Optionally, there can be a fourth step: using a barcode and its data to validate and verify the identity document it was used in.

What data can an ID barcode contain?

An ID barcode can contain personal and document data. Common examples include name, date of birth, document number, expiration date, address, gender, portrait data, biometric-related data, certificates, URLs, access codes, and digital signatures.

How to read a barcode on a passport?

To read a barcode on a passport, the verification system first needs to detect the barcode, identify its type, decode the encoded data, and parse the result into structured fields. If the barcode data is digitally signed, the system may also verify the signature using the required certificates.

Why can a barcode fail to scan during remote onboarding?

A barcode can fail to scan during remote onboarding because the captured image may not preserve enough detail for reliable decoding. Common reasons include low light, glare, blur, poor camera quality, compression, document bends, skew, perspective distortion, or a barcode that is too dense for the camera resolution. Older IDs may have faded, scratched, or damaged barcodes.

What is a passport barcode used for?

A passport barcode is used to store machine-readable data that can support document processing or verification. Depending on the passport and issuing authority, the barcode may contain document details, personal data, access information, or digitally signed data.

What does the barcode on an ID card show?

The barcode on an ID card may show personal details, document numbers, issue and expiration dates, address data, access codes, or other information defined by the issuer. In some documents, it may also contain a digital signature or data that supports biometric or electronic verification. For businesses, the important point is not only what the barcode shows, but whether the data is expected for that ID card type and whether it matches the rest of the document.

What barcode is used on driver’s licenses?

Driver’s license barcodes vary by country and issuing authority, but PDF417 is one of the most common formats, especially for US driver’s licenses and state-issued IDs. It is widely used because it can store a large amount of structured data in a compact format. Other barcode types may also appear on driver’s licenses, including QR codes, Code 128, Code 39, and ITF-14, depending on the document design and local standard.

Which barcode software is best for identity documents?

The best barcode software for identity documents is software that is document-aware, not just barcode-aware. It should support common 1D and 2D barcode types, handle poor capture conditions, parse issuer-specific formats, and validate barcode data against the expected document template.

On our website, we use cookies to collect technical information. In particular, we process the IP address of your location to personalize the content of the site

Cookie Policy rules