MRZ Calculator
Tool · ICAO 7-3-1 algorithm

MRZ Check Digit Calculator

Every check digit in a Machine Readable Zone — passport, ID card, residence permit, or visa — is calculated with the same 7-3-1 weight algorithm defined in ICAO Doc 9303. This page shows the math and gives you a calculator to verify any digit by hand.

The algorithm in 3 steps

  1. Map each character to a number: 0–9 stay as themselves, A=10 … Z=35, filler < = 0.
  2. Multiply position-by-position using the repeating weights 7, 3, 1.
  3. Sum the products, take mod 10, that's the check digit.

Worked example — document number L898902C3

Char:     L  8  9  8  9  0  2  C  3
Value:    21 8  9  8  9  0  2  12 3
Weights:  7  3  1  7  3  1  7  3  1
Products: 147 24 9 56 27 0 14 36 3   →  sum = 316
316 mod 10 = 6                       →  check digit = 6

Worked example — date of birth 740812

Input:    7  4  0  8  1  2
Weights:  7  3  1  7  3  1
Products: 49 12 0  56 3  2   →  sum = 122
122 mod 10 = 2               →  check digit = 2

The composite check digit

The final character on line 2 of a TD3 passport — or line 2 of a TD2 / line 2 of a TD1 — is the composite check digit. Its input is the concatenation of: document number + its check digit + date of birth + its check digit + expiry date + its check digit + optional data + its check digit. The same 7-3-1 weights apply.

Calculate it automatically

Skip the arithmetic — paste an MRZ into the validator and every check digit is computed, displayed, and compared to the printed digit.