Bulk Check
MRZ Generator
What is MRZ?
MRZ stands for Machine Readable Zone. It is the block of text at the bottom of passports, ID cards, and visas that scanners read in seconds.
ICAO 9303 defines the MRZ so every country reads the same fields in the same positions. That is why the MRZ looks similar no matter where a document is issued.
The MRZ is printed in OCR-B, a special font made for machine reading. Each character takes the same amount of space (like a typewriter), so scanners can split the line into equal boxes and read it reliably.
That fixed spacing is the reason the MRZ uses OCR-B even when the rest of the document uses a different font.
What data is encoded
Common fields include document type, issuing country, document number, name, nationality, date of birth, sex, expiry date, and optional data.
Dates are encoded as YYMMDD (for example, 12 July 1942 becomes 420712).
MRZ layouts by document type
TD1 (ID card)
TD2 (ID card)
TD3 (Passport)
MRV-A (Visa)
MRV-B (Visa)
ICAO 9303 MRZ check digits
Check digits are single numbers that help catch OCR or typing errors. Every MRZ uses the same calculation.
How the calculation works
- Convert characters to values:
0-9map to0-9,A=10throughZ=35, and<=0. - Multiply each position by repeating weights
7,3,1from left to right. - Add the products and take
mod 10; the remainder is the check digit.
Example (date): 520727 -> sum 103 -> check digit 3.
Worked examples by document type
TD1 (ID card, 3 x 30)
Composite check digit uses L1[6-30] + L2[1-7] + L2[9-15] + L2[19-29].
Line 1: I<YTOD231458907<<<<<<<<<<<<<<<
Line 2: 3407127M9507122YTO<<<<<<<<<<<2
Line 3: ERIKSSON<<ANNA<MARIA<<<<<<<<<< Computed composite check digit: 2.
TD2 (ID card, 2 x 36)
Composite check digit uses L2[1-10] + L2[14-20] + L2[22-35].
Line 2: HA672242<6YTO5802254M9601086<<<<<<<8 Computed composite check digit: 8.
TD3 (passport, 2 x 44)
Composite check digit uses L2[1-10] + L2[14-20] + L2[22-43].
Line 2: HA672242<6YTO5802254M9601086<<<<<<<<<<<<<<08 Computed composite check digit: 8.
MRV-A (visa, 2 x 44)
Document number XK9305487 -> check digit 5; birth date 850221 -> 2; expiry 270314 -> 3.
Line 2: XK93054875BRA8502212F2703143R5T6U7V8W9<<<<<< MRV-B (visa, 2 x 36)
Document number L23456789 -> check digit 7; birth date 920101 -> 7; expiry 270630 -> 6.
Line 2: L234567897DEU9201017F2706306QW12ER34 Privacy
This tool runs entirely in your browser. MRZ text and document images are processed locally and are not uploaded for validation.
Processed locally on your device
- MRZ lines you paste or type.
- Images you choose for MRZ OCR.
- Generated samples and exports.
Network activity
- When the site loads, your browser downloads the app files (HTML, CSS, JS, WASM, and OCR data) from this website.
- No MRZ text or document images are sent to a validation server.
Exports
TXT/XML/JSON exports are created in your browser and saved locally.