MRZ

The Anyline MRZ mode provides the functionality to scan passports and other IDs holding a Machine Readable Zone (MRZ).

For each scan result, the MRZ mode generates an Identification object, containing all relevant information as well as the image of the scanned document.

Examples

A couple of different examples can be found at Anyline Demos and Samples: MRZ.

Crop and Transform IDs

New in version 3.25.1.

Passports and IDs, which contain an MRZ can be automatically cropped and transformed to an orthogonal frontal view. This way, even if the user scans the document from the top-, side-, rotated-, or zoomed out view, the document will be returned in a standardized way.

Not cropped passport image Cropped passport image

Scannable MRZ Information

Document Type

The type of the Machine Readable Travel Document.

Example Type
Document Type String

Document Type Confidence

The confidence with which the document type was scanned.

Example Type
92 int

New in version 11.

Document Number

The document number on the Machine Readable Travel Document.

Example Type
Document Number String

Document Number Confidence

The confidence with which the document number was scanned.

Example Type
92 int

New in version 11.

Check Digit for the Document Number

A check digit which is validating the integrity of the document number field.

Example Type
Check Digit for the Document Number String

Check Digit Document Number Confidence

The confidence with which the check digit for the document number was scanned.

Example Type
92 int

New in version 11.

Date of Expiry

Represents the date the ID expires.

Example Type
Document Type String

Date of Expiry Confidence

The confidence with which the date of expiry was scanned.

Example Type
92 int

New in version 11.

Check Digit for the Date of Expiry

A check digit which is validating the integrity of the date of expiry field.

Example Type
Check Digit for the Date of Expiry String

Check Digit Date of Expiry Confidence

The confidence with which the check digit for the date of expiry was scanned.

Example Type
92 int

New in version 11.

Date of Birth

The date of birth of the ID holder.

Example Type
Date of Birth String

Date of Birth Confidence

The confidence with which the date of birth was scanned.

Example Type
92 int

New in version 11.

Check Digit for the Date of Birth

A check digit which is validating the integrity of the date of birth field.

Example Type
Check Digit for Day of Birth String

Check Digit Date of Birth Confidence

The confidence with which the check digit for the date of birth was scanned.

Example Type
92 int

New in version 11.

Issuing Country Code

The three-letter code for the issuing country of this ID. Exception: The code for Germany only contains one letter (D).

Example Type
Issuing Country Code String

New in version 3.2.1.

Issuing Country Code Confidence

The confidence with which the issuing country code was scanned.

Example Type
92 int

New in version 11.

Nationality Country Code

The three-letter country code for the nationality of the ID holder. Exception: The code for Germany only contains one letter (D).

Example Type
Nationality Country Code String

New in version 3.2.1.

Nationality Country Code Confidence

The confidence with which the nationality country code was scanned.

Example Type
92 int

New in version 11.

Surname

The surname of the holder of the ID.

Example Type
Surname String

Surname Confidence

The confidence with which the surname was scanned.

Example Type
92 int

New in version 11.

Given Names

The given names of the holder of the ID.

Example Type
Given Names String

Given Names Confidence

The confidence with which the given names were scanned.

Example Type
92 int

New in version 11.

Personal Number

Optional data at the discretion of the issuing state, e.g. a personal number. Might contain additional information.

Example Type
Personal Number String

Personal Number Confidence

The confidence with which the personal number was scanned.

Example Type
92 int

New in version 11.

Check Digit for the Personal Number

A check digit which is validating the integrity of the personal number field.

Example Type
Check Digit Final String

Check Digit Personal Number Confidence

The confidence with which the check digit for the personal number was scanned.

Example Type
92 int

New in version 11.

Optional Data

Optional data at the discretion of the issuing state. Only available for TD1 sized MROTDs an the MRZ on Swiss driving licenses. Might contain additional information.

Example Type
- String

Note

This information may only be available on TD1 sized MROTDs and the MRZ on Swiss driving licenses.

Optional Data Confidence

The confidence with which the optional data was scanned.

Example Type
- int

New in version 11.

Sex

The sex of the ID holder. May not be present on each document.

Example Type
Sex String

Sex Confidence

The confidence with which the sex was scanned.

Example Type
92 int

New in version 11.

Check Digit Final

A check digit which is validating the integrity of the lower line (on TD2 and TD3 MROTDs), or the upper and middle line (on TD1 MROTDs).

Example Type
Check Digit Final String

Check Digit Final Confidence

The confidence with which the check digit final was scanned.

Example Type
92 int

New in version 11.

MRZ String

The full MRZ String including line breaks.

Example Type
MRZ String String

New in version 3.13.0.

MRZ String Confidence

The confidence with which the mrz string was scanned.

Example Type
92 int

New in version 11.

All Check Digits Valid

Since some countries do not fully implement the ICAO Specifications, invalid check digits do not result in an invalid result object. Instead, the allCheckDigitsValid flag is set to false if at least one of the check digits is invalid. To determine the validity of individual check digits, the ICAO check digit algorithm can be found in Doc 9303 Part 3 on the ICAO Website.
If the character at the check digit’s position is not a digit, no valid result will be returned. Exception: If the optional Personal Number field is left empty (only containing ‘<’), an empty Check Digit for the Personal Number (‘<’) is considered valid.

Example Type
True Boolean

New in version 3.2.1.

Note

For the MRZ on Swiss driving licenses, this value will always be true. In this custom MRZ, there are no check digits, so the result is always valid with respect to check digits.

Machine Readable Travel Documents

This section shows the five main types of Machine Readable Travel Documents, according to ICAO

TD3 Documents

TD3 sized Machine Readable Travel Documents consist of two lines of 44 characters each.

The full specification can be found in Doc 9303 Part 4 on the ICAO Website

A TD3 Machine Readable Travel Document MRZ Fields of a TD3 Document

TD2 Documents

TD2 sized Machine Readable Official Travel Documents consist of two lines of 36 characters each.

The full specification can be found in Doc 9303 Part 6 on the ICAO Website

A TD2 Machine Readable Official Travel Document MRZ Fields of a TD2 Document

TD1 Documents

TD1 sized Machine Readable Official Travel Documents consist of two lines of 30 characters each.

The full specification can be found in Doc 9303 Part 5 on the ICAO Website

A TD1 Machine Readable Official Travel Document MRZ Fields of a TD1 Document

MRV-A Visa

Format-A Machine Readable Visas consist of two lines of 44 characters each.

The full specification can be found in Doc 9303 Part 7 on the ICAO Website

A Format-A Machine Readable Visum MRZ Fields of a Format-A Machine Readable Visa

MRV-B Visa

Format-B Machine Readable Visas consist of two lines of 36 characters each.

The full specification can be found in Doc 9303 Part 7 on the ICAO Website

A Format-B Machine Readable Visas MRZ Fields of a Format-B Machine Readable Visa

Other Machine Readable Documents

MRZ on Swiss Driving License

The MRZ on Swiss driving licenses is not following the ICAO standards. It consists of three lines - one line of 9 and two lines of 30 characters each. The fields which can be extracted are listed below. Note that the name of the field in the Anyline result can differ from the name in the explanation image below. The following list shows the Anyline field name at first and the alternative name in brackets:

For a full specification, we refer to the ASTRA brief

MRZ on Swiss Driving Licenses MRZ Fields of a Swiss Driving License

New in version 10.2.

MRZ on US Green Card

The MRZ on US Green Cards is not following the ICAO standards. It consists of three lines of 30 characters each and has a special document type. The fields which can be extracted are listed below. Note that the name of the field in the Anyline result can differ from the name in the explanation image below. The following list shows the Anyline field name at first and the alternative name in brackets:

MRZ on US Green Card MRZ Fields of a US Green Card

New in version 20..

Scannable VIZ Information

The Anyline MRZ mode also provides the functionality to scan the Visual Inspection Zone (VIZ) of passports and other IDs in parallel to the MRZ. The following fields in the VIZ are currently supported:

Address

The address of the ID holder in the VIZ.

Example Type
German ID Address String

New in version 5.

Address Confidence

The confidence with which the address was scanned.

Example Type
92 int

New in version 11.

Date of Issue

Represents the date the ID was issued in the VIZ.

Example Type
VIZ Date of Issue String

New in version 6.

Date of Issue Confidence

The confidence with which the date of issue was scanned.

Example Type
92 int

New in version 11.

Surname

The surname of the holder of the ID in the VIZ.

Example Type
VIZ Surname String

New in version 10.1.

Surname Confidence

The confidence with which the surname was scanned.

Example Type
92 int

New in version 11.

Given Names

The given names of the holder of the ID in the VIZ.

Example Type
VIZ Given Names String

New in version 10.1.

Given Names Confidence

The confidence with which the given names were scanned.

Example Type
92 int

New in version 11.

Date of Birth

The date of birth of the ID holder in the VIZ.

Example Type
VIZ Date of Birth String

New in version 10.1.

Date of Birth Confidence

The confidence with which the date of birth was scanned.

Example Type
92 int

New in version 11.

Date of Expiry

Represents the date the ID expires in the VIZ.

Example Type
Surname String

New in version 10.1.

Date of Expiry Confidence

The confidence with which the date of expiry was scanned.

Example Type
92 int

New in version 11.

VIZ Supported document types and countries

Below are tables that show which VIZ fields are supported for which countries and document types. VIZ fields might be NULL for supported countries and document types in the following cases:

  1. The field is not visible in the cutout.
  2. The quality of the scanned field is not good enough (it does not pass the validation check).

For non supported document types and countries, the fields will always be NULL.

IDs

Country Code Address
Germany D

Passports

Country Code Date of Issue Surname Given Names Date of Birth Date of Expiry
Austria AUT        
United Kingdom GBR        
Denmark DNK        
Sweden SWE        
Netherlands NLD        
Ireland IRL        
Norway NOR        
France FRA        
United States of America USA        
Germany D        
Morocco MAR        
Finland FIN        
Italy ITA        
Spain ESP        
Russia RUS        
Canada CAN        
Poland POL        
Argentina ARG        
Switzerland CHE
Czech Republic CZE        
Romania ROU        
Australia AUS        
Algeria DZA        
Ukraine UKR        
South Korea KOR        
Slovakia SVK        

MRZ Field Scan Options

New in version 10.

Starting with Anyline 10, you can configure which parts of the Visual Inspection Zone (VIZ) you want to scan.

In the mrzConfig, you can set mrzFieldScanOptions to specify the scanning behavior for individual data fields. Each field in the mrzFieldScanOptions can be set to mandatory, optional or disabled. If no scan option is set for a field, it will be set to default and the default value will be used.

mrzFieldScanOptions.vizAddress

Specifies if the address in the VIZ should be scanned. Default value: optional.

Note

The scan option mandatory only applies to the IDs of supported countries. For other IDs or types of MRZ documents it will be reset to disabled automatically.

mrzFieldScanOptions.vizDateOfIssue

Specifies if the date of issue in the VIZ should be scanned. Default value: optional.

Note

The scan option mandatory only applies to the passports of supported countries. For other passports or types of MRZ documents it will be reset to disabled automatically.

mrzFieldScanOptions.vizSurname

Specifies if the surname in the VIZ should be scanned. Default value: optional.

Note

The scan option mandatory only applies to the passports of supported countries. For other passports or types of MRZ documents it will be reset to disabled automatically.

mrzFieldScanOptions.vizGivenNames

Specifies if the given names in the VIZ should be scanned. Default value: optional.

Note

The scan option mandatory only applies to the passports of supported countries. For other passports or types of MRZ documents it will be reset to disabled automatically.

mrzFieldScanOptions.vizDateOfBirth

Specifies if the date of birth in the VIZ should be scanned. Default value: optional.

Note

The scan option mandatory only applies to the passports of supported countries. For other passports or types of MRZ documents it will be reset to disabled automatically.

mrzFieldScanOptions.vizDateOfExpiry

Specifies if the date of expiry in the VIZ should be scanned. Default value: optional.

Note

The scan option mandatory only applies to the passports of supported countries. For other passports or types of MRZ documents it will be reset to disabled automatically.

mrzFieldScanOptions.dateOfBirth

Specifies if the dateOfBirth in the MRZ should be scanned. Default value: mandatory.

New in version 23.

mrzFieldScanOptions.dateOfExpiry

Specifies if the dateOfExpiry in the MRZ should be scanned. Default value: mandatory.

New in version 23.

MRZ Minimum Confidence and Field Confidences

New in version 11.

Starting with Anyline 11, you can specify minimum mrzFieldConfidences for each data field individually to make sure that only fields with a sufficient confidence are accepted.

You can also set a general minConfidence value. It will be used for all fields for which no minimum mrzFieldConfidence is set. Per default, the minConfidence for the MRZ mode is 60.

For general details about the confidence and field confidences in the ID plugin, see ID Plugin Confidence and Field Confidences.

Have a look at the “ID Plugin MRZ Sample two” example JSON config how to configure the field confidences via JSON.

In the mrzConfig you can set the following minimum mrzFieldConfidences:

mrzFieldConfidences.DocumentType

The minimum value for the document type confidence so that the document type is accepted in the result.

mrzFieldConfidences.DocumentNumber

The minimum value for the document number confidence so that the document number is accepted in the result.

mrzFieldConfidences.CheckDigitDocumentNumber

The minimum value for the check digit document number confidence so that the check digit for the document number is accepted in the result.

mrzFieldConfidences.DateOfExpiry

The minimum value for the date of expiry confidence so that the date of expiry is accepted in the result.

mrzFieldConfidences.DateOfBirth

The minimum value for the date of birth confidence so that the date of birth is accepted in the result.

mrzFieldConfidences.IssuingCountryCode

The minimum value for the issuing country code confidence so that the issuing country code is accepted in the result.

mrzFieldConfidences.NationalityCountryCode

The minimum value for the nationality country code confidence so that the nationality country code is accepted in the result.

mrzFieldConfidences.Surname

The minimum value for the surname confidence so that the surname is accepted in the result.

mrzFieldConfidences.GivenNames

The minimum value for the given names confidence so that the given names are accepted in the result.

mrzFieldConfidences.PersonalNumber

The minimum value for the personal number confidence so that the personal number is accepted in the result.

mrzFieldConfidences.CheckDigitPersonalNumber

The minimum value for the check digit personal number confidence so that the check digit for the personal number is accepted in the result.

mrzFieldConfidences.OptionalData

The minimum value for the optional data confidence so that the optional data is accepted in the result.

mrzFieldConfidences.Sex

The minimum value for the sex confidence so that the sex is accepted in the result.

mrzFieldConfidences.CheckDigitFinal

The minimum value for the check digit final confidence so that the check digit final is accepted in the result.

mrzFieldConfidences.MrzString

The minimum value for the mrz string confidence so that the mrz string is accepted in the result.

mrzFieldConfidences.VizAddress

The minimum value for the address confidence so that the address is accepted in the result.

mrzFieldConfidences.VizDateOfIssue

The minimum value for the date of issue confidence so that the date of issue is accepted in the result.

mrzFieldConfidences.VizSurname

The minimum value for the surname confidence so that the surname is accepted in the result.

mrzFieldConfidences.VizGivenNames

The minimum value for the given names confidence so that the given names are accepted in the result.

mrzFieldConfidences.VizDateOfBirth

The minimum value for the date of birth confidence so that the date of birth is accepted in the result.

mrzFieldConfidences.VizDateOfExpiry

The minimum value for the date of expiry confidence so that the date of issue is accepted in the result.