Check document fields and composite digits.
Initialising algorithm engine for Identity Card MRZ Calculator...
How Identity Card MRZ Calculator Works?
The Identity Card MRZ Calculator works by applying the ICAO 7-3-1 weighted modulo 10 rule to each field of a 3-line TD1 identity card MRZ and computing a composite digit over lines 1 and 2.
- 1Read line 1 (document code, issuing state, document number, optional data) and line 2 (dates, sex, nationality).
- 2Compute the document number check digit at line 1, position 15.
- 3Compute the birth date check digit at line 2, position 7, and the expiry date check digit at line 2, position 15.
- 4Join line 1 positions 6–30, line 2 positions 1–7, 9–15, and 19–29.
- 5Compute the composite check digit over the joined string and place it at line 2, position 30.
Identity Card MRZ Calculator Formula
The TD1 formula is Check = (Σ v(cᵢ) × (7, 3, 1)ᵢ) mod 10 for every field and for the composite string.
Field check = Σ v(cᵢ) × wᵢ mod 10, w = 7,3,1… Composite = check(L1[6–30] ‖ L2[1–7] ‖ L2[9–15] ‖ L2[19–29])
L1,L2are MRZ lines 1 and 2.
Document number D23145890 → 7 Birth date 740812 → 2 Expiry 120415 → 9 Composite → 376 mod 10 = 6 Line 1: I<UTOD231458907<<<<<<<<<<<<<<< Line 2: 7408122F1204159UTO<<<<<<<<<<<6 Line 3: ERIKSSON<<ANNA<MARIA<<<<<<<<<<
Identity Card MRZ Calculator Conversion Table
The identity card MRZ conversion table compares check digit positions in TD1, TD2, and TD3 formats.
| Format | Lines × length | Document number check | Date checks | Composite position |
|---|---|---|---|---|
| TD1 (ID card) | 3 × 30 | Line 1, pos. 15 | Line 2, pos. 7 and 15 | Line 2, pos. 30 |
| TD2 (ID / visa) | 2 × 36 | Line 2, pos. 10 | Line 2, pos. 20 and 28 | Line 2, pos. 36 |
| TD3 (passport) | 2 × 44 | Line 2, pos. 10 | Line 2, pos. 20 and 28 | Line 2, pos. 44 |
| MRV-A (visa) | 2 × 44 | Line 2, pos. 10 | Line 2, pos. 20 and 28 | None |
| MRV-B (visa) | 2 × 36 | Line 2, pos. 10 | Line 2, pos. 20 and 28 | None |
What is Identity Card MRZ Calculator?
An Identity Card MRZ Calculator is a tool that computes the field and composite check digits of a machine-readable identity card or visa. ICAO Doc 9303 parts 5 and 6 define the TD1 and TD2 formats.
Most European national ID cards use the 3-line TD1 MRZ on the back. Machine-readable visas carry field check digits but no composite digit.
What are the uses of Identity Card MRZ Calculator?
There are 3 main uses of the Identity Card MRZ Calculator, including ID scanning, travel document checks, and parser testing.
- ID scanning: Hotels and car rental desks validate ID card scans.
- Travel document checks: Border systems confirm TD1 and TD2 reads.
- Parser testing: Developers test MRZ parsers across formats.