MRZ Check Digit
An MRZ check digit is a single digit calculated from the characters of a field in a machine-readable zone, used to detect transcription and reading errors. ICAO Doc 9303 specifies the method: convert each character to a number, multiply by a repeating 7-3-1 weight, sum the products, and take the result modulo 10.
| Algorithm | Weighted modulo 10 |
| Weight sequence | 7, 3, 1 — repeating across the field |
| Digit values | 0–9 take their own value |
| Letter values | A = 10 through Z = 35 |
| Filler value | < = 0 |
| Fields guarded | Document number, date of birth, expiry date, optional data, and a composite over the whole zone |
| Specified in | ICAO Doc 9303 |
How the calculation works
Every character in the field is converted to a number. Digits keep their face value. Letters take their alphabetical position offset by nine, so A is 10 and Z is 35. The filler character used to pad short fields counts as zero.
Each value is then multiplied by a weight, cycling through 7, 3, 1 from the start of the field regardless of how long it is. The products are summed, and the final check digit is that sum modulo 10.
Take the document number L898902C3:
| Character | L | 8 | 9 | 8 | 9 | 0 | 2 | C | 3 |
|---|---|---|---|---|---|---|---|---|---|
| Value | 21 | 8 | 9 | 8 | 9 | 0 | 2 | 12 | 3 |
| Weight | 7 | 3 | 1 | 7 | 3 | 1 | 7 | 3 | 1 |
| Product | 147 | 24 | 9 | 56 | 27 | 0 | 14 | 36 | 3 |
The products sum to 316. The last digit of 316 is 6, so the check digit is 6.
The composite check digit at the end of the zone runs the same algorithm across a concatenation of several fields and their individual check digits, which catches errors that happen to leave one field internally consistent.
Why check digits matter for identity verification
Check digits exist to catch mistakes, and it is worth being precise about which mistakes.
A camera reading a worn or poorly lit machine-readable zone will occasionally confuse similar characters — an 8 for a B, a 0 for an O. Without validation, that error propagates silently into a customer record and surfaces weeks later as a failed compliance check. With check digits, the field fails arithmetic immediately and the capture can be retried while the user is still present.
The weighting is what makes this work. A plain sum would be blind to transposition, because swapping two characters leaves the total unchanged. Cycling 7-3-1 means adjacent characters are weighted differently, so a transposition changes the result — and transposition is one of the commonest human and optical errors.
There is a fraud dimension too. Crude forgeries frequently carry MRZs where the printed digits do not match the data, because the forger copied a layout without recomputing the arithmetic. That mismatch is a cheap, instant signal available before any cryptographic check runs, which is why check digit validation sits early in every identity document verification pipeline.
What a check digit proves, and what it doesn’t
| Question | Does the check digit answer it? |
|---|---|
| Was the field read correctly? | Yes — this is what it is for |
| Was a character transposed? | Yes — the weighting is designed to catch this |
| Was the MRZ altered after printing? | Only if the forger failed to recompute it |
| Was the document genuinely issued? | No — requires chip authentication |
| Does the MRZ match the printed page? | No — requires cross-matching |
| Is the holder the rightful owner? | No — requires biometric matching |
Common pitfalls
The algorithm is trivially reproducible. It is published, unkeyed, and takes a few lines of code. A competent forger recomputes check digits after altering data, so a passing check is weak evidence of authenticity on its own.
Not every field is guarded. Names carry no check digit. Neither does the issuing country code. Errors there survive validation entirely.
Filler characters count. Treating the padding character as whitespace rather than zero is the single commonest implementation bug, and it produces check digit failures on entirely valid documents.
Some issuers get it wrong. A small number of real, legitimately issued documents carry incorrect check digits from the issuing authority. A verification flow that hard-fails on any mismatch will reject genuine customers, which is why this should be a risk signal rather than a blocking rule. Perfect-looking data deserves the same scepticism — flawless reproduction is often its own tell.
Frequently asked questions
What does it mean if a check digit fails?
Most often a reading error — poor lighting, a worn document, a smudged character. Retry the capture before treating it as fraud. Repeated failures on a clean, well-lit image are the case worth escalating.
Why 7, 3, 1 specifically?
The weights are co-prime with 10 and differ between adjacent positions, which is what allows the algorithm to catch both single-character substitutions and transpositions. A uniform weight would miss transpositions entirely.
How many check digits does a passport MRZ have?
A TD3 passport carries five: one each over the document number, date of birth, and expiry date, one over the optional data field, and a final composite covering the combination.
Can a forged passport have valid check digits?
Yes, easily. The algorithm is public and unkeyed. Valid check digits mean the data is internally consistent, not that the document was issued by anyone. Proof of issuance comes from the chip signature.