MRZ Scan

Experience barKoder’s Machine Readable Zone

Scanning a passport, visa or IDs with a mobile device is lightning fast. More successful scans means more successful transactions.

mzr hero
Understanding MRZ
What is Machine Readable Zone?

MRZ Standards and Documents

A Machine Readable Zone (MRZ) is a section on identity documents – such as passports, ID cards, visas, residence permits, and other travel documents – that contains encoded personal information in a standardized format . The MRZ is typically located at the bottom of the document and consists of two or three lines of text printed in a special OCR-friendly font (usually OCR-B ). This format is defined by the International Civil Aviation Organization (ICAO) in its Doc 9303 standard for Machine Readable Travel Documents (MRTDs). 

The MRZ allows machines (either dedicated scanners or smartphone cameras with OCR software) to quickly and accurately read key identity data without manual entry in this sense, barKoder boasts supreme MRZ recognition capabilities.

mrz-1
ID with a 3 line MRZ

 

ICAO 9303 Standard Formats: ICAO 9303 specifies several standard MRZ formats based on document size (often referred to as TD1, TD2, TD3 for “Type” 1/2/3 documents). The most common formats include:

There are also standardized formats for machine-readable visas: MRV-A (visa format with 2 lines of 44 characters) and MRV-B (visa format with 2 lines of 36 characters), as defined in ICAO Doc 9303 Part 7. No matter the format, all MRZs use the same character set and similar data fields. Only the digits 0–9, capital letters A–Z, and the filler symbol < are allowed characters. The < character acts as a space or padding indicator in the MRZ. For example, names in the MRZ have spaces and punctuation replaced by  < (and surname is separated from given names by < < ). Non-Latin letters with diacritics are transliterated into basic Latin letters or combinations (e.g. Ü UE , ß SS ) according to ICAO rules.

Nearly all modern passports and many national IDs now include an MRZ. In fact, since 2010, ICAO has required member states to issue only machine-readable passports, and non-MRZ passports became invalid for international travel after November 2015. This ubiquity means software developers can rely on MRZ data being present for a wide range of identity documents. The MRZ serves as a universal machine-readable identity string , enabling interoperability across border control systems, airport kiosks, banking apps, and more.

MRZ Structure and Encoded Fields (ICAO 9303 Format)

Despite looking like a jumble of letters and numbers, the MRZ is highly structured. It encodes the document holder’s personal data in fixed field positions, along with check digits for error detection. According to the ICAO 9303 specification, an MRZ typically includes the following core fields :

mrz-2
VISA with a 2-line MRZ code

For example, in a typical two-line passport MRZ (known as TD3 format), the layout is as follows:

 

Other document formats use a similar concept with adjusted line lengths. For instance, an ID card in TD1 format has three lines of 30 characters: the first line contains document type, issuer, and document number; the second line contains birth date, sex, expiration date, nationality; and the third line contains the name. Visas (MRV-A or MRV-B) have two lines like passports, but may allocate different lengths for the name or optional data. No matter the format, the presence and order of fields are consistent, which allows a parser to identify and extract the data once it knows which format (2-line vs 3-line, 44 vs 36 vs 30 char) it’s dealing with.

mrz-3
Passport with a 2-line MRZ code

 

Check Digit Calculation: MRZ fields are protected by check digits to detect misreads or forgeries. The check digit for a field is computed by a specific algorithm: each character is converted to a value (0–9 as their numeric value, A–Z as 10–35, and < as 0), then each position’s value is multiplied by a weight in a repeating sequence 7-3-1. The weighted values are summed and the sum’s modulo 10 is taken – that result is the check digit. For example, if a passport number is C01X3<7 (just as an illustration), the software would calculate its check digit by applying these weights and verifying the result matches the digit provided in the MRZ. Any discrepancy means the MRZ was read incorrectly or has been tampered with. All critical fields (document number, birth date, expiry date, and often the optional number) have individual check digits, and the final overall checksum provides an extra layer of verification across the combined data. This system significantly reduces errors , ensuring that automated scans are highly reliable – a crucial feature for both security and data integrity.

Use Cases of MRZ Scanning

MRZs were originally introduced to speed up identity verification in travel, but today they are leveraged across many industries.

Travel and Border Control

The earliest and most prominent use of MRZ is in international travel. At immigration checkpoints and airport security, passports with MRZ enable fast, automated identity verification. Instead of manually typing passenger information, border agents or e-gates scan the MRZ to instantly extract the traveler’s data. This dramatically reduces waiting times and minimizes human error. Airlines also use MRZ scanning during check-in and boarding to automate passport details entry and comply with security regulations (e.g. verifying against watchlists). In short, MRZ technology has become a cornerstone of modern global travel security and passenger processing.

mrz-31
How is data extracted from a MRZ code

 

Financial Services

Banks and fintech companies use MRZ scanning to streamline Know Your Customer (KYC) and identity verification processes. When opening a bank account, applying for a loan, or performing any regulated financial transaction, customers can be asked to scan their passport or ID card using a mobile app. The MRZ data (name, DOB, document number, etc.) is extracted to verify the person’s identity and checked against sanction or PEP lists as required by Anti-Money Laundering rules. Automating KYC with MRZ OCR speeds up onboarding (no need to manually fill forms) and reduces fraud – fake IDs can be detected by verifying MRZ checksums and cross-checking the data with authorities. For example, a fintech app can instantly read a user’s passport MRZ to auto-populate their sign-up details, improving user experience while ensuring compliance.

Access Control and Security Screening

In many secure facilities and high-security use cases, scanning an ID’s MRZ helps verify identity quickly. For instance, entry into office buildings, data centers, or secure events can be expedited by MRZ scanning. Security personnel can scan the MRZ on a visitor’s ID badge or passport to automatically log their name and details, rather than copying information by hand. In the hospitality industry, hotels often scan guest passports/IDs at check-in – MRZ readers capture the guest’s info in seconds, reducing check-in time and errors. Similarly, at large events or amusement venues, MRZ-based identity checks can help validate tickets or age (for age-restricted events) and prevent entry with fraudulent IDs. These scenarios all benefit from the speed and accuracy of MRZ scanning in verifying a person’s credentials.

Beyond these, MRZ scanning is also used in healthcare (for patient identity verification), telecommunications (SIM card registration with ID verification), car rentals, borderless kiosks, and any application where a quick, reliable read of an official ID is needed. In summary, what began as a border control technology is now a widespread standard for identity verification , appreciated for its efficiency in a broad array of business processes.

Smartphone-Based MRZ Scanning: OCR on Mobile Devices

Originally, reading MRZ data required dedicated hardware scanners or special equipment. Now, thanks to advances in mobile cameras and optical character recognition, smartphones can accurately scan MRZs using just the built-in camera and software. This has opened up new possibilities: any mobile app can incorporate passport/ID scanning functionality, making user onboarding or ID checks far more convenient.

Modern mobile MRZ scanning SDKs (Software Development Kits), such as barKoder’s MRZ Parser SDK , leverage on-device OCR to detect the MRZ in a camera frame, read the text, and parse it into structured data fields automatically. The process typically works like this: the user points their phone camera at the passport or ID; the SDK’s vision algorithm locates the MRZ zone (which has a distinctive pattern of two or three lines with high-contrast OCR font), then performs OCR to extract the text, and finally the parser splits the text into fields and validates the checksums. 

All of this can happen in a fraction of a second on a modern mobile device.

barKoder MRZ
Experience barKoder’s MRZ module.
BarKoder’s MRZ Scanner mobile technology brings you automation, speed, efficiency and excellence to all of your business processes and procedures.
Start supporting your business needs by using our API or go for our SDK licensing and integrate the scanning engine in your apps as per your requirements. Amaze your customers with the most technologically advanced user experience they've ever had.
MRZ Features
SDK Features
data-security.webp
Data Security

We do not collect personal information! The app however does need to process the personal information that is on the MRZ of the identity document. This includes privacy-sensitive information like name, date of birth, personal number and document number. In addition, the app scans via OCR technology for the date of expiry and any optional data on the document, because all these are needed for information processing.

 

The personal information is secured since all the processing is done on the phone. Confidentiality of this information is also protected by using encrypted network connections for any requested communication.

High Performance

Scanning with MRZ Scanner is way faster than manual input. Mobile OCR also removes any human error from your processes. This means the accuracy of your scans will be higher than manual verification. You can use MRZ Scanner to provide the most reliable service possible to your customers. It provides you with near instant scan results once you point your device at your target. Average scan time takes less than half a second.

 

You can optimize your company processes and procedures by adding the fastest scanning ever to your mobile app. This will also give you more time to focus on other aspects of your business.

Work Offline

MRZ Scanner works in real-time, locally on a device, without the need of internet connection. Since the scan happens right on the spot, the data never leaves your phone unless you want it to. All the processing is done at that very moment, right away. This means the results never pass any external servers. That makes MRZ Scanner the perfect tool for completing scans of sensitive information.

 

Based on your demands our software can, however, transfer data to your servers using a secured end-to-end encryption. When using our SDK (Software Development Kit) you can customize things on both ends.

Cost Reduction

MRZ Scanner works on your mobile device so there is no need to spend money on expensive external readers. This reduces the cost of equipment and employee training. MRZ Scanner's high accuracy also removes false readings from your processes. More successful scans means more successful transactions. A penny saved is a penny earned. Scanning a passport, visa, ID cards with a mobile device works lightning faster.

 

With MRZ Scanner you can drastically improve your processes and stay on top on your business at the same time.

MRZ FAQ
Frequently asked questions
What are the barKoder scanner SDK MRZ properties?
  • The barKoder MRZ SDK is capable of scanning all variant of MRZ codes that are currently officially used. However, the same SDK is designed to easily recognize future MRZ codes.
  • The SDK can extract photos from MRZ documents.
  • The SDK can extract signatures
  • The SDK can extract whole document image
Technology used?

Machine learning - features detection on image

Drawbacks?

Bigger SDK size due to necessary models for Machine Learning model prediction and also OCR

Can be slow on older hardware which is not optimized for ML Prediction

What is the minimum hardware required to run this technology optimally?

It's tested on Android devices using API level 5 and higher. API level 8 is recommended as well as arm64 CPU

iPhone 7 is oldest iOS device tested and confirmed working. However, performance is lower than devices with dedicated neural engine CPU cores

Any missing features for MRZ scanning?
  • ROI
  • weaker Signature detection
  • not implemented on other platforms than Android and iOS
Release date?

The barKoder MRZ SDK was released Late October 2024. You can find it for most supported platforms and cross-platform frameworks under the version number 1.5.x+.