Travel document numbers vary more than you would expect — nine digits in the US, a letter-and-digits mix in Germany, a fixed sixteen-character string on a UK driving licence. Each format here follows its country's pattern so your field validation gets a real workout.
What you can control
- Six issuing countries, each with the correct pattern for both document types.
- Issue and expiry dates are ten years apart, matching the usual validity period for an adult passport.
- The optional MRZ line follows the ICAO 9303 shape, padded to 44 characters, for testing document scanners.
- Generate both document types on one row when you are seeding a full identity record.
Testing ideas
- Country formats. Generate for each issuing country you support. Passport numbers range from nine digits to mixed alphanumerics, and a single regex rarely covers them all.
- Expiry logic. Include issue and expiry dates to test warnings for documents that expire within six months — the rule many countries and airlines apply.
- MRZ parsing. Turn on the MRZ line to test OCR post-processing and parsers that expect the ICAO 9303 layout and
<fillers. - Masking. Confirm document numbers are masked in logs and support tools.
What this is not
These match the format of real document numbers without corresponding to an issued document. Presenting one as genuine identification is a criminal offence; keep them in your test environment.