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.
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.
Questions
Is the MRZ line fully valid?
It follows the ICAO 9303 layout and length but does not carry correct check digits. It is shaped for testing a parser's field extraction, not for passing a border reader.
Do these numbers correspond to real documents?
No. They are generated from the format pattern only. There is no issuing authority behind any of them.
Why are passport and licence formats so different?
They are issued by different authorities under different rules. That inconsistency is exactly why a single regex for identity documents is a bad idea.