Generate country-correct passport number stubs
Passport-number fields vary widely by issuing country, which makes them easy to get wrong in test data. This tool emits strings that match each country’s published length and character pattern so they pass front-end validation, while keeping the value entirely random and meaningless. It is built for testing travel-booking, KYC, and registration forms — not for producing anything that resembles a usable document.
How it works
Each country has a document-number scheme. The tool stores a representative pattern and fills it with random characters:
- United States — 9 numeric digits (newer books may start with a letter, but 9 digits is the common form).
- United Kingdom — 9 numeric digits.
- Canada — 2 letters followed by 6 digits.
- Australia — 1 letter followed by 7 digits.
- Germany / France / Spain / Italy — alphanumeric, typically 9 characters mixing letters and digits.
- India — 1 letter followed by 7 digits.
The generator picks characters from the allowed set for each position. Because the value is random, it cannot correspond to a real passport, and it will not satisfy any genuine machine-readable-zone (MRZ) check digit.
Country pattern reference
| Country | Pattern | Character set |
|---|---|---|
| United States | 9 digits | 0–9 |
| United Kingdom | 9 digits | 0–9 |
| Canada | 2 letters + 6 digits | A–Z, 0–9 |
| Australia | 1 letter + 7 digits | A–Z, 0–9 |
| Germany | 9 alphanumeric | A–Z, 0–9 |
| France | 9 alphanumeric | A–Z, 0–9 |
| India | 1 letter + 7 digits | A–Z, 0–9 |
These patterns represent the common issued format for adult passports. Emergency travel documents and older series may differ.
What these stubs are for
International booking platforms, KYC (know-your-customer) systems, and airline check-in flows all accept a passport number as a required field. Front-end validation typically checks that the string has the right length and matches the expected character set for the stated nationality. These stubs satisfy exactly those checks — they are long enough, contain only allowed characters, and follow the country’s pattern — without being tied to any real document.
What they do not do is satisfy an MRZ check digit. The machine-readable zone at the bottom of a passport page embeds its own checksum alongside the document number; a real document scanner checks that checksum. Fake stubs generated here will fail an MRZ scan by design. Use them for front-end form validation only.
Building coherent test profiles
For KYC testing the passport number is only one field. Pairing this tool with a fake address generator (matching the same country) and a fake name generator creates a complete synthetic traveller profile that exercises the whole KYC form without involving real identity data. For example, for a Canadian test profile: generate a name, a CA postal-code address, and a 2-letter + 6-digit passport number from this tool, then fill the form fields together.
Tips and notes
- Use a batch to test how your form handles different lengths and mixed alphanumeric input across countries.
- Pair with the fake address generator to build coherent test profiles per country.
- These never carry valid MRZ check digits — they exist purely to exercise format validation.
- Never store these as if they were real identity documents or use them to deceive anyone.