Skip to content

MRZ Parser - Passport Machine Readable Zone

Parse TD1/TD3 MRZ codes from passports and travel documents with per-field check-digit verification. Local-only.

Was this result helpful?

This tool runs in your browser: what you enter is processed on your device and normally never appears in a request to any server.

Usage Guide

The two rows of monospaced characters at the bottom of a passport data page are the Machine Readable Zone (MRZ) defined by ICAO Doc 9303. Manual entry into travel, visa, or frequent-traveler systems is error-prone, and the MRZ carries its own check digits. This parser handles TD3 (passport, 2×44) and TD1 (ID cards, 3×30): it extracts name, document number, nationality, birth date, sex, expiry, and recomputes every check digit (the 7-3-1 rule plus the composite). Parsing is fully local — best suited to checking your own document.

1. How to parse

Nothing leaves the browser. The name line is expanded from << into a “surname, given names” structure, and dates render as YYYY-MM-DD.

  1. Transcribe the rows character by character from the data page, including every < filler that looks like blank space; keep the line breaks.
  2. Paste and parse — the tool detects the format from row length (44 or 30) and splits fields by their ICAO positions.
  3. Results show field values, a formatted rendering (P<CHNZHANG<<SAN…), and a check-digit audit; any failure is flagged against its specific field.

2. Layout of the two formats

TD3 (MRP passports, 2 rows × 44): row 1 is P<country code + name; row 2 packs document number (9) + check digit + nationality + birth date (6) + check digit + sex + expiry (6) + check digit + optional personal number + composite check digit. TD1 (ID/residence cards, 3 rows × 30): row 1 has document type + issuing state + document number (9) + check digit; row 2 birth + check + sex + expiry + check + nationality; row 3 surname + given names + composite. Identical check logic, different field arrangement.

3. Check digits: 7-3-1 and the composite

Per-field checks multiply characters (A=10…Z=35, digits at face value, < = 0) by the repeating weights 7,3,1,7,3,1… and take the sum mod 10; the result must equal the digit printed after the field. This applies to the document number, birth date, expiry, and optional personal number. The composite check digit (end of TD3 row 2 / TD1 row 3) concatenates document number + its check + birth + its check + expiry + its check + personal number, then applies 7-3-1 over the whole string. Four field checks plus one composite make a single mis-transcribed character nearly impossible to miss.

4. Common pitfalls

  • Dropping < fillers as “spaces”: they are significant characters; wrong row length is reported immediately.
  • Hyphens in names: the MRZ transliterates them to < (WANG-XIAO → WANG<XIAO); the display layer restores them.
  • O vs 0, I vs 1: name fields use letters only, date fields digits only — a mix almost always means a misread.
  • TD2 (2×36, some visas and permits) is not supported and will be rejected as an unknown layout.

5. Compliance: parse your own documents

The tool connects to no immigration or issuance system; the output is a rule-based rendering of the string itself. It says nothing about authenticity, validity, or the holder’s identity. Use it to assist entry of your own documents; processing other people’s document data at scale constitutes personal-data processing and requires its own lawful basis under applicable data-protection law.

6. Integration notes

  • Form prefill: map parsed fields to surname/given names/document number/expiry, but keep the raw rows for audit.
  • OCR post-processing: run scans through these checks before storage — check digits are the cheapest QA an OCR pipeline can buy.

FAQ

TD3 (machine-readable passports, 2 rows × 44 characters) and TD1 (ID and residence cards, 3 rows × 30). TD2 (2×36, used by some visas and travel documents) is not supported and is rejected as an unknown layout.

Every < is a significant filler or separator — dropping one breaks the row length, which the tool reports immediately. Also watch O vs 0 and I vs 1: name segments use capitals only and date segments digits only, so a mix usually means a transcription slip.

ICAO 7-3-1 recomputation — letters score A=10…Z=35, < scores 0, weights cycle 7,3,1, summed mod 10 — covering the document number, birth date, expiry, and personal number, plus a composite digit computed over those fields joined end to end. Any failure flags the exact field, so a single mistyped character is almost always caught.

The MRZ turns hyphens into < (WANG-XIAO appears as WANG<XIAO) and uses << to separate surname from given names; the display layer renders them back into a structured name, with dates normalized to YYYY-MM-DD.

No. The tool connects to no border-control or issuing-authority system — the result is a rule-based rendering of the string itself. Authenticity and validity go through official verification, and you should parse only your own documents: batch-processing other people's documents is personal-data processing that requires its own legal basis.

No — parsing runs wholly in your local browser, and the document data stays on your device.

Related Tools

Related Articles