Bulk MRZ checker (local-only)
What is MRZ?
The MRZ (Machine Readable Zone) is the block of text made of uppercase letters, digits, and the < filler character printed on many passports, ID cards, and visas. It’s standardized by ICAO 9303 so machines can read documents consistently across countries.
An MRZ checker validates the check digits embedded in the MRZ to catch typos and many OCR mistakes. It does not confirm document authenticity.
Where is the MRZ located?
- Passports (TD3): bottom of the photo/identity page (2 lines).
- ID cards (TD1/TD2): often on the back (2 or 3 lines).
- Visas (MRV): typically at the bottom (2 lines).
MRZ types (formats)
- TD3 (passport): 2 lines × 44 characters
- TD1 (ID card): 3 lines × 30 characters
- TD2 (ID card): 2 lines × 36 characters
- MRV-A / MRV-B (visa): 2 lines × 44 / 36 characters
Each type has fixed line lengths, a restricted character set (A–Z, 0–9, <), and fields at fixed positions.
What information is inside the MRZ?
Depending on the document type, the MRZ can include:
- Document code + issuing authority (issuer)
- Names (surname and given names separated by
<<) - Document number
- Nationality (3-letter code)
- Date of birth, sex, expiry date
- Optional/personal number fields
Unused characters are filled with < to keep fixed lengths.
Example (non-real)
Names are encoded as SURNAME<<GIVEN<NAMES and padded with <:
P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10
Tip: this tool includes a Sample button that loads non-real MRZ text.
How machines read MRZ codes
Typical pipeline:
- Locate the MRZ area on the document image.
- Run OCR optimized for the MRZ font (often OCR-B-like) and restricted character set.
- Split into lines, parse fields by position, and validate check digits.
MRZ check digits (why validation works)
Check digits are computed from MRZ fields using a fixed mapping of characters to numbers and a repeating weight pattern (7–3–1). If a field changes (even 1 character), the check digit usually changes too — so validation catches many OCR/typing errors.
More details: ICAO 9303 check digits.
The role of MRZ in identity verification
- Fast extraction of identity fields for KYC/KYB flows.
- Consistency checks: MRZ check digits can confirm the MRZ text was read correctly.
- Cross-checking MRZ fields against the visual zone and other data sources.
The role of MRZ in AML and fraud prevention
MRZ data is often used to reduce manual entry and enforce structured data validation before downstream screening. However, MRZ validity alone does not prove a document is genuine.
Tips for OCR
- Make the MRZ sharp and large in the image.
- Avoid glare/blur; rotate slightly if lines are skewed.
- OCR often confuses
Oand0,Band8,Iand1.
FAQ
- Is MRZ validation enough? No — it only checks check digits, not authenticity.
- Does MRZ include biometrics? No. Biometrics are stored in the chip (ePassport), not in the MRZ.
- Why do you show a country name for nationality? The MRZ contains a 3-letter code; this site expands it to a country name for readability.
ICAO 9303 MRZ check digits
MRZ check digits are a compact way to detect typing and OCR errors. They are computed from MRZ fields using a fixed character mapping and a repeating weight pattern 7–3–1.
What gets validated?
- Document number check digit
- Date of birth check digit
- Expiry date check digit
- Composite/final check digit (format-dependent)
Why it helps
If OCR misreads a character (for example O vs 0), the check digit usually stops matching. That lets you quickly spot that the MRZ text is wrong.
Privacy
Default behavior: MRZ validation and MRZ OCR run locally in your browser. This site does not need your documents to leave your device to validate MRZ check digits.
What data is processed
- MRZ text you paste/type is processed locally.
- If you upload an image, OCR runs locally (in-browser) using WASM assets served from this same website.
What is sent to a server
- Static website assets (HTML/CSS/JS/WASM) are downloaded by your browser as part of loading the site.
- By default, MRZ lines and document images are not sent to any validation server.
Paid MRZ Validation API
A minimal, privacy-first API for MRZ check-digit validation (ICAO 9303). It’s for developers who need server-side validation in their own products.
When to use it
- Validate MRZ text entered by users (reduce typos).
- Validate MRZ text produced by your own OCR pipeline.
- Quality gate before downstream KYC/AML workflows.
Endpoint
POST /api/validate
Authentication
Send your API key in the X-API-Key header.
Request
JSON body:
{"type":"td3","lines":["LINE1","LINE2"]}
type:td1,td2,td3,mrva,mrvblines: array of MRZ lines (already uppercased;<preserved)
Response
Returns a JSON object with:
okbooleanchecks: per-field check results (OK/FAIL)parsed: structured fields (names, nationality, dates)errors: input/format errors
Privacy
- Send only MRZ lines; never send document images to this API.
- Use test MRZ strings in development (don’t send real customer data).
Get access
Email info@idcheck.dev to request an API key. Include your domain/app name and expected usage.