Every critical field in the MRZ ends with a one-digit checksum. The rule is identical everywhere — once you know it, you can verify any MRZ by hand.
The algorithm
- Map each character to a number: 0–9 stay as themselves, A=10 … Z=35, and the filler "<" equals 0.
- Multiply position by position using the repeating weights 7, 3, 1.
- Sum the products and take mod 10. The remainder is the check digit.
Worked example — date of birth 520727
Input: 5 2 0 7 2 7 Weights: 7 3 1 7 3 1 Products: 35 6 0 49 6 7 → sum = 103 103 mod 10 = 3 → check digit = 3
The composite check
For TD1, TD2 and TD3 documents there's a final composite check digit. It's computed over the document number, date of birth, expiry date and optional data segments concatenated together. This catches cases where individual fields look valid but the overall block has been tampered with or mis-paired.


