mrz calculator

MRZ Check Digit Calculator & Passport Validator

Use this tool to calculate ICAO 9303 MRZ check digits and validate a 2-line passport MRZ (TD3 format).

1) Calculate a Check Digit for Any MRZ Field

Tip: spaces will be converted to <. Allowed characters: A-Z, 0-9, <.

2) Validate a Passport MRZ (TD3: 2 lines × 44 chars)

What Is an MRZ Calculator?

An MRZ calculator is a tool that computes and verifies the check digits used in the Machine Readable Zone (MRZ) on passports and many travel documents. The MRZ is the block of OCR-friendly text at the bottom of an identity page. It is built for high-speed scanning, so it uses strict formatting rules and built-in error detection.

When immigration systems read an MRZ, they rely on check digits to detect typos, OCR mistakes, and damaged characters. A single wrong value can cause a scan failure, manual review, or a rejection. An MRZ calculator helps you quickly test whether the encoded fields are internally consistent.

Why Check Digits Matter

MRZ check digits are not just “extra numbers.” They are integrity checks defined by ICAO Doc 9303. Each important field (document number, date of birth, expiration date, optional data) has a check digit, plus a final composite check digit that covers multiple fields together.

  • Error detection: catches common entry and OCR mistakes.
  • Interoperability: ensures different border systems parse the same data reliably.
  • Automation: reduces manual interventions and queue time.
  • Data quality: useful for QA in identity verification systems.

How MRZ Check Digit Math Works

Character Values

MRZ transforms each character into a numeric value:

  • Digits 0-9 keep their numeric value.
  • Letters A-Z map to 10-35 (A=10, B=11, ... Z=35).
  • The filler character < maps to 0.

Weights

Weights repeat in this cycle across the field: 7, 3, 1.

For each character: value × weight. Sum all products, then compute:

check digit = total mod 10

Example (Conceptual)

If your weighted sum is 167, the check digit is 7. That digit should match the check position in the MRZ line. If it does not match, the field fails validation.

Fields Validated in a TD3 Passport MRZ

This page validates the standard 2-line passport format (44 characters each line). It checks:

  • Document number check digit (line 2, position 10)
  • Date of birth check digit (line 2, position 20)
  • Expiration date check digit (line 2, position 28)
  • Optional/personal number check digit (line 2, position 43)
  • Final composite check digit (line 2, position 44)

The composite check digit covers multiple blocks together and is often the strongest signal that the MRZ has been captured correctly.

Practical Uses

For Developers

  • Test OCR pipelines before production rollout.
  • Add client-side validation in onboarding flows.
  • Build unit tests for document parsing services.

For Operations Teams

  • Troubleshoot why a specific passport scan fails.
  • Identify whether the issue is formatting vs. OCR confidence.
  • Reduce manual correction effort in document review queues.

For Compliance and QA

  • Enforce strict ICAO-compatible data quality checks.
  • Spot recurring extraction errors by field.
  • Improve audit trails for identity workflows.

Common MRZ Validation Errors

  • Wrong line length: TD3 requires exactly 44 characters per line.
  • Illegal characters: only A-Z, 0-9, and < are valid.
  • Lowercase / spacing issues: MRZ is uppercase and often uses < instead of spaces.
  • Field shift: one missing character offsets every subsequent field.
  • OCR confusion: values like O/0, I/1, or B/8.

Important Notes

This calculator checks formatting and check-digit consistency. It does not verify document authenticity, issuer trust, visa status, or security features. Always combine MRZ checks with stronger identity controls (chip verification, visual checks, liveness, watchlist logic, etc.).

Quick Workflow Recommendation

  1. Capture MRZ via OCR.
  2. Normalize to uppercase and replace spaces with <.
  3. Validate each field digit and the composite digit.
  4. If validation fails, recapture image or request manual review.
  5. Log failure type for quality feedback loops.

Final Thoughts

A reliable MRZ calculator is a small tool with outsized impact. It improves user experience, lowers exception handling, and catches obvious data errors before they become downstream problems. If you work in travel tech, KYC, or digital identity, this should be part of your baseline validation stack.

🔗 Related Calculators