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
- Map each character to a number:
0–9stay as themselves,A=10 … Z=35, filler<=0. - Multiply position-by-position using the repeating weights
7, 3, 1. - 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.
Related tools
Validate ICAO 9303 MRZ lines and every check digit.
Read MRZ text from a passport or ID photo.
Convert MRZ between TD1, TD2 and TD3.
Validate many MRZ records at once.
Read PDF417, QR and other codes from an image.
Check if a passport meets destination validity rules.