Fictional identities for safe testing
When you need to populate a test database, take a clean demo screenshot, or write a fixture, using real personal data is a privacy and compliance risk. This generator builds entirely fictional but well-formed identities — names, dates of birth, addresses, National Insurance numbers, IBANs, phone numbers, and emails — that look real enough for realistic testing while corresponding to nobody.
How it works
A small seedable pseudo-random number generator (a mulberry32-style hash) drives all selection. Given a seed, the stream of random values is deterministic, so the same seed and count regenerate identical records — perfect for reproducible fixtures. With an empty seed a time-based seed is used for fresh data each run.
Each field is constructed to be format-correct:
- National Insurance number follows the
AA 00 00 00 Apattern, skips the prefixes HMRC never issues (D, F, I, Q, U, V as first letter; O as second) and uses a valid A–D suffix. - IBAN is generated for a sample country; check digits are computed with the real ISO 13616 MOD-97 algorithm so the number passes IBAN validators.
- Email is derived from the generated name plus a sample domain; phone uses a country dialling format; address is assembled from street/town word-lists.
What each field is for
| Field | Format detail |
|---|---|
| Full name | Random first + last name pair |
| Date of birth | A plausible adult age, random within range |
| National Insurance | AA 00 00 00 A, HMRC-valid prefix/suffix |
| Address | Street number + street + town, assembled from word-lists |
| IBAN | MOD-97 check-digit-correct, format-valid for a sample country |
| Phone | Correct dialling prefix and digit count |
[email protected] or similar reserved domain |
When to use a seed
The seed is a number you provide that initialises the random sequence. With the same seed and count you will always get exactly the same records — the names, addresses, NI numbers, and IBANs will be byte-for-byte identical. This matters when:
- You write an automated test that asserts
"the third record has NI number AB 12 34 56 C"— without a seed, that assertion would fail on the next run. - A colleague needs to reproduce the exact dataset you used to file a QA report.
- You want to commit a fixture file to source control that stays stable when regenerated.
Leave the seed empty when you just want a fresh, unrepeated batch for a demo or screenshot.
Privacy and compliance notes
Because all values are synthetic and structurally fictional, the output is safe to commit to version control and include in screenshots shared publicly. No GDPR subject-access right attaches to these records because they do not describe a natural person. However, you should still mark datasets as TEST DATA in any system they enter, to avoid confusion if they are later discovered in logs or backups.
Tips and notes
Use a fixed seed in automated tests so assertions stay stable across runs, and an empty seed when you just want a fresh batch for a demo. Because every value is synthetic, the output is safe to commit to source control and share publicly. Do not rely on the generated NI numbers or IBANs as if they belong to anyone — they are deliberately fictional placeholders that merely satisfy format checks.