Table of contents
- Introduction
- What Is the MRZ?
- History and Standards
- MRZ Formats: TD1, TD2, TD3, MRV
- Field Structure and Filler Rules
- The Check Digit Algorithm
- Parsing an MRZ in Practice
- Common OCR Errors and Corrections
- MRZ vs. Visual Inspection Zone
- MRZ vs. Chip Data (eMRTDs)
- Fraud Signals Only MRZ Can Surface
- What MRZ Validation Cannot Prove
- Where MRZ Fits in Real Workflows
- Best Practices
- Veridexa Analysis
- Conclusion
- Frequently Asked Questions
Introduction
The Machine Readable Zone — the two or three lines of monospaced characters at the bottom of a passport photo page or across an identity card — is one of the most quietly powerful anti-fraud features ever standardised. It compresses the most important identity fields into a rigid, machine-checkable format, and it carries check digits that make casual tampering trivial to detect.
This guide explains what the MRZ is, how the check-digit algorithm actually works, which errors OCR routinely introduces, and how the MRZ should be cross-validated against the visual inspection zone and, when available, the chip. It closes with how Veridexa uses MRZ validation as one signal inside a multi-source, evidence-based fraud detection pipeline.
What Is the MRZ?
The Machine Readable Zone is a fixed-length text region printed in the OCR-B typeface, designed to be readable by both humans and simple optical scanners without a full document understanding stack. It carries the document type, issuing country, document number, holder name, nationality, date of birth, sex, expiry date, optional data, and a set of check digits.
Because the format is public and standardised, any conforming reader on any border post in the world can extract the same identity fields from the same document. And because the check digits are deterministic, a receiving system can verify that the MRZ has not been casually tampered with, without needing to consult any external register.
History and Standards
The MRZ is specified by ICAO Document 9303, the international standard for machine readable travel documents. The standard originated in the 1980s to accelerate border processing and has been revised repeatedly to accommodate biometric passports, national ID cards, residence permits, and visas.
- ICAO 9303 Part 3 defines the common technical specifications.
- Part 4 covers passports (TD3 format).
- Part 5 covers size 1 official travel documents (TD1, common for ID cards).
- Part 6 covers size 2 official travel documents (TD2).
- Part 7 covers machine readable visas (MRV-A, MRV-B).
MRZ Formats: TD1, TD2, TD3, MRV
TD3 — Passports
Two lines of 44 characters each. Line one carries the document type, issuing state, and full name. Line two carries the document number, nationality, date of birth, sex, expiry, personal number, and check digits — including a composite check digit over the whole numeric portion.
TD2 — ID Cards and Older Documents
Two lines of 36 characters each. Same core fields as TD3 but with a shorter name field and shorter optional data.
TD1 — ID Cards and Residence Permits
Three lines of 30 characters each. The additional line length gives room for longer document numbers and optional data on the front of the card while keeping the name on the third line.
MRV-A and MRV-B — Visas
Two lines of 44 or 36 characters. Structurally similar to TD3 and TD2 but with different optional data semantics for visa-specific fields.
Field Structure and Filler Rules
Every MRZ position is meaningful. Unused positions are padded with the filler character <, chosen because it does not appear in normal Latin transliterations of names or numbers.
- Names use uppercase A–Z, with
<<separating surname from given names and single<separating individual name parts. - Non-Latin scripts are transliterated according to the issuing state's convention.
- Dates use YYMMDD; centuries are inferred from context (birth in the past, expiry in the future).
- Sex is
M,F, or<for unspecified. - Document and personal numbers use A–Z and 0–9 with
<padding.
The Check Digit Algorithm
MRZ check digits use a weighted sum with the repeating weight sequence 7-3-1. Each character contributes a value: digits are their own value, letters map to A=10 through Z=35, and the filler < is 0. The weighted values are summed and reduced modulo 10; the result is the check digit.
Every checked field has its own check digit — document number, date of birth, expiry, optional data — and the TD3 line two ends with a composite check digit computed over the entire numeric portion of the second line. A single tampered character almost always breaks at least one of these digits.
- Field check digits catch alterations within a single field.
- Composite check digits catch attempts to swap fields between documents.
- Both must pass for the MRZ to be considered internally consistent.
- A failing composite with passing field digits is a strong tampering signal.
Parsing an MRZ in Practice
A robust MRZ parser is more than a substring extraction routine. It has to be format-aware, tolerant of OCR errors within a bounded budget, and honest about when the input is too noisy to trust.
- Detect the format from line count and length before parsing.
- Reject any input whose lines do not match the declared format exactly.
- Extract fields by fixed position, not by delimiter search.
- Compute all field and composite check digits deterministically.
- Attach a confidence score to every extracted field.
- Distinguish "MRZ absent" from "MRZ present but invalid" — they mean different things.
Common OCR Errors and Corrections
Even good OCR engines make characteristic mistakes on OCR-B. A production MRZ reader should know the substitution set and treat check digits as an error signal, not just a validity signal.
- 0 ↔ O, 1 ↔ I ↔ L, 2 ↔ Z, 5 ↔ S, 6 ↔ G, 8 ↔ B are the classic swaps.
- Context resolves most swaps: date positions must be digits, name positions must be letters or
<. - A failing check digit combined with exactly one plausible substitution in the field is often correctable with high confidence.
- Multiple substitutions or off-format characters should abort parsing rather than guess.
MRZ vs. Visual Inspection Zone
The visual inspection zone is the human-readable portion of the document — printed names, dates, and photograph. Cross-checking MRZ against the VIZ is one of the most productive fraud signals available, because attackers who alter the photo page frequently forget to regenerate the MRZ.
- Compare the MRZ surname and given names against the printed name after transliteration.
- Compare the MRZ date of birth against the printed date of birth.
- Compare the MRZ expiry against the printed expiry.
- Compare the MRZ document number against the printed document number.
- Any disagreement is a strong prompt for manual review.
MRZ vs. Chip Data (eMRTDs)
Electronic Machine Readable Travel Documents carry an embedded contactless chip holding a signed copy of the identity data and the facial image. Chip access is protected by Basic Access Control or Password Authenticated Connection Establishment, both of which derive keys from the printed MRZ.
- Chip reading requires physical NFC access to the document.
- The chip's identity data can be cryptographically verified against the issuing state's Document Signer Certificate.
- Disagreement between chip and printed MRZ is rare in genuine documents and highly diagnostic when it occurs.
- Chip verification is a complementary channel to image-based MRZ validation, not a replacement.
Fraud Signals Only MRZ Can Surface
- Check-digit failures inconsistent with plausible OCR errors.
- Composite check-digit failure with all field check digits passing — a fingerprint of field swapping.
- MRZ document number that does not match the printed document number.
- MRZ nationality that does not match the issuing state on the front of the document.
- Filler characters in positions that should carry data.
- Transliteration that does not match the issuing state's documented convention.
- Fonts or spacing in the MRZ region that differ from genuine specimens.
What MRZ Validation Cannot Prove
A passing MRZ is a floor, not a ceiling. It rules out casual tampering, but it cannot prove any of the following on its own.
- That the document is a genuine issue by the claimed authority.
- That the photograph has not been substituted.
- That the physical security features are present.
- That the bearer is the person named.
- That the document has not been reported lost or stolen.
Reliable identity assurance requires MRZ validation plus visual authentication, image forensics, security feature detection, and — where the workflow permits — register checks against issuing authority databases.
Where MRZ Fits in Real Workflows
KYC and Onboarding
MRZ validation is the first inexpensive check in most onboarding flows. It eliminates a large fraction of low-effort forgeries in milliseconds and produces structured identity data for downstream steps.
Border Control
MRZ parsing is used at every automated e-gate in the world, usually combined with chip reading and facial biometric matching.
Age and Right-to-Work Checks
Where a legal decision hinges on date of birth or nationality, MRZ fields provide a machine-checkable source of truth to cross-reference against the printed VIZ.
Travel and Hospitality
Airlines, hotels, and rental companies frequently ingest MRZ data to pre-populate check-in and comply with local reporting obligations.
Best Practices
- Always parse the MRZ before more expensive checks — it is fast and highly diagnostic.
- Compute every check digit, including composite, and refuse to trust partially validated data.
- Treat OCR errors as a bounded correction problem, not free substitution.
- Cross-check MRZ against the visual inspection zone in every workflow.
- Never treat a passing MRZ as proof of authenticity.
- Retain the raw MRZ text and check-digit results in the audit trail.
- Prefer chip verification when NFC access is possible and the document supports it.
Veridexa Analysis
Veridexa's MRZ pipeline detects TD1, TD2, TD3, and MRV formats, computes every field and composite check digit, and reconciles the parsed identity against the visual inspection zone extracted from the same document. Every MRZ finding — a failed check digit, a VIZ mismatch, an implausible OCR correction — is surfaced as an explainable signal that contributes to the risk score.
Crucially, MRZ validation is never the sole basis for a Veridexa decision. Because a competent counterfeiter can produce a checksum-valid MRZ, the same document is also examined for image forensics, layout consistency, metadata coherence, and security-feature indicators. Only the aggregated evidence yields the final decision, and every contributing signal is reported for human review.
Conclusion
MRZ validation is one of the highest-leverage inexpensive checks available in identity document verification. It catches a large fraction of amateur forgeries, produces clean structured identity data, and provides a cross-check against the rest of the document. It is not, on its own, proof of authenticity — but combined with forensics, cross-evidence reasoning, and, where possible, chip verification, it is an indispensable pillar of modern document fraud detection.
Veridexa integrates MRZ validation into every identity document assessment, alongside the broader evidence-based pipeline, so that every decision reflects the full body of available signals rather than any single one.
Frequently Asked Questions
What does a passing MRZ check actually prove?
A passing MRZ check proves that the MRZ characters are internally consistent — the check digits match the encoded fields and the format follows ICAO 9303. It does not prove that the document is genuine, that the photograph is authentic, or that the bearer is the person named. MRZ validation is a necessary but not sufficient condition for authenticity.
Can attackers produce an MRZ that passes checksum validation?
Yes. The MRZ specification is public, and any competent counterfeiter can compute correct check digits. That is why MRZ validation must be combined with visual inspection, image forensics, chip verification where available, and cross-evidence checks against the visual inspection zone.
How reliable is MRZ recognised from a smartphone photo?
Reliable enough for triage but not perfect. Common OCR errors include confusing 0 with O, 1 with I, 5 with S, and B with 8. A robust MRZ pipeline recognises these substitutions, retries with format-aware constraints, and uses the check digits themselves as an error-correction signal.
Does Veridexa read the MRZ chip?
Veridexa validates the printed MRZ from images and cross-checks it against the visual inspection zone and other extracted evidence. Chip reading (BAC/PACE) requires physical NFC access to the document and is a complementary channel outside the scope of image-only pipelines.
Is MRZ validation useful on documents other than passports?
Yes. TD1 and TD2 formats appear on national ID cards, residence permits, and some visas. The same checksum and field-structure rules apply, and MRZ validation is a valuable component of any identity document check.
Validate MRZ documents with Veridexa
Upload a passport, ID card, residence permit, or visa and receive an explainable fraud assessment that includes full MRZ parsing, checksum verification, and cross-evidence reasoning.
Related Knowledge Base articles
- Passport Fraud DetectionMethods, indicators and AI analysis for passport fraud.
- National ID Fraud DetectionDetecting counterfeit and altered national ID cards.
- Residence Permit Fraud DetectionVerifying residence permits and detecting impostor cards.
- Security Features in Identity DocumentsHow modern identity documents resist fraud.