03 Apr 20247 min readin ID verification & biometrics

How Barcode Reading Software Handles ID Documents

Ihar Kliashchou

Chief Technology Officer, Regula

Identity verification often embraces the principle of “the more, the merrier”: while new security features are consistently incorporated, the old ones are retained too. As such, barcodes have long ago entered the mainstream. 

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 to read them effectively.

Let’s get started.

Types of barcodes used in ID documents

Barcodes are a method of representing data in a visual, machine-readable form. Every barcode consists of codewords, which are combinations of bars and spaces that correspond to numbers, letters, or other symbols. 

Generally, barcodes are categorized into two main groups: 1D (one-dimensional) and 2D (two-dimensional). 1D barcodes are read horizontally, so only their width is important. With 2D barcodes, both the width and height are important. There are over 80 barcode types in total, and this number is growing, incorporating more creative designs.

Cronto Visual Cryptogram, App Clip, JAB Code barcodes

From left to right: Cronto Visual Cryptogram, App Clip, JAB Code barcodes. Source: Wikipedia

When it comes to identity documents, however, the range of barcode types is more conservative. According to the latest data from the Regula identity document template database, there are seven main barcode types: three of them are from the 1D group, and four are 2D.

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

Stay Tuned

We'll deliver hand-picked content from Regula's experts into your inbox

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 type of barcode many of us remember from years ago.

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 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.


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. This barcode type is 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. PDF417 barcodes are also included in numerous passports, ID cards, and driver’s licenses.

Based on our experience, PDF417 is among the most demanding types among the 2D barcodes used in 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 inherently 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 invented for the automotive industry in order to label vehicle parts. Now, they and their numerous versions are widely adopted in almost every sector, from advertising to product counterfeit detection, healthcare, and, of course, identity verification. 

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 even photographs and biometric data. The design of QR codes can also 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 notable for their compact size and robustness, able to encode a wealth of information—up to 2,000 characters—even when space is limited.

As of this time, Aztec codes can only be found in a few ID documents. One of them is a Nigerian ID card:

an Aztec code used in identity documents

An Aztec code used in a Nigerian ID card

The latest trends in using barcodes for identity verification

Note that most of the above-mentioned have already been with us for decades. The actual tendencies imply we’ll witness even more widespread use of barcodes thanks to the emergence of new standards.

For instance, a new universal format of barcode encoding has been introduced 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)

The modern application also uses barcodes—QR codes and Data Matrix—as Visible Digital Seals (VDS). VDS contains information about a document and a digital signature to protect that data against any manipulation. For example, VDS can already be found in European visas, where they store an applicant’s full name, gender, dates, visa number, passport number, and more.

Data matrix barcode used in ID documents

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

The future of barcode technology is referred to in connection with the development of Digital Travel Authorization (DTA) and Digital Travel Credentials (DTC) where the data within barcodes will be digitally signed.

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

In foundational long-term scenarios (e.g., travel), there will likely be leveraged a DTC-PC approach that 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 (providing an access code, visas, permits, etc.) and should be cheap—barcodes will 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.

How barcode scanning software works in identity verification

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

1. Barcode detection

If your barcode reading software faces a new document type, it runs a barcode detector. Simply put, this detector looks for objects that look like barcodes. Then, it analyzes each find and determines its type.

If your software is already familiar with a given document, the detection step can be skipped. Once it has a description of the document, the software provides you with a specific field where the barcode is located.

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.

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

Once the barcode reading software analyzes the document, it turns the array of bytes obtained at the previous stage into meaningful data fields. These can 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 300 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 ofbarcodes 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 to use barcodes for document verification

Barcodes can be divided into two groups depending on whether the encoded data is additionally protected or not. This determines the scenario of using the barcode for document verification.

There are barcodes with a digital signature inside. If you have the necessary publisher’s certificates, it is enough to check the signature to be sure of the authenticity of the data.

However, there are still plenty of barcodes where you can read the data as is. To check their authenticity, professional barcode reading technology has to rely on various indirect features: size, location, number of rows and columns, level of correction, and the format of the recorded data.

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

For instance, the Regula Document Reader SDK 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

What does it take for barcode reading software to perform effectively?

Again, there are three important aspects that majorly influence the performance of a barcode reading technology in an identity verification scenario.

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

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.

The size of the barcode

The physical size of barcodes also matters, and there are subtle distinctions here as well. For example, a document can contain a pretty large barcode, but a user may capture it from a distance. Or, it can be like with a new Austrian ID (see below):

Image of a new Austrian ID with QR

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

Barcodes in Austrian IDs are indeed large; however, they are 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 properly read such barcodes, you’ll need a very good camera.

The ability to process diverse barcode formats

The numerous existing barcode formats add to the complexity. While this discussion focuses on the seven most prevalent types found in ID documents, even they can have sub-variations. The vast array of barcodes, each with its unique characteristics and requirements, demands a versatile and adaptable barcode reading technology.

The physical dimensions of a barcode are essentially determined by the design of the given ID document. The standards that describe barcodes only specify the aspect ratio. For example, the recommended aspect ratio for PDF417 is 3:7. In practice, these standards are not always met, so barcodes can be flattened or stretched to fit or look better.

That’s where expertise and experience with identity documents is invaluable. At Regula, our experts have analyzed thousands of them. Since we know almost every ID document in the world—including the nuances of their printing techniques and the specific ways barcodes are printed within them—our reading algorithms take into account any deviations from standards. This deep background knowledge enables Regula's technology to read barcodes with unmatched efficiency.

Advanced barcode reading software for mission-critical tasks

The key to overcoming the challenges outlined above is to find a tool with the capabilities to tackle poor contrast, confidently work with rotated, bent, or skewed barcodes, and utilize a broad set of parsers for decoding a variety of data types. 

When it comes to identity verification, however, the requirements often extend beyond just a “barcode scanning SDK” — a more versatile solution is needed. This solution should integrate advanced barcode reading capabilities as an essential component within a suite of identity verification tools. 

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

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

  • Its barcode reading technology is equippedto 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 13,000 documents from 247 countries and territories.

  • With support for 295 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.

Regula Document Reader SDK

Automate identity document reading and authentication.


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 is the future of barcodes in identity documents?

The future of barcode technology is digitally signing the data within barcodes, which allows for reliable data verification. An example of this is the development of Digital Travel Authorization (DTA).

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