NINO generator and validator

NINO generator for tests: samples with a valid check digit and the algorithm worked out.

loading NINO generator and validator
About this tool

NINO: what it is and how to test it

The NINO is the National Insurance number of the United Kingdom, issued to people who work or claim benefits. It has two letters, six digits and a final letter, and unlike most documents it has no check digit: it can only be validated by its structure and by the prefixes that are never issued.

For tests only. These numbers have a correct format and check digit but belong to no real person or account. Never use them to deceive, to open accounts or to bypass a check. The numbers on this page come from the same generator as the tool, with a fixed seed so that the examples do not change; the tool creates new ones at every click.

Structure of the number

9 characters written in pairs, AB 12 34 56 C: a 2-letter prefix, 6 digits and a suffix letter from A to D. The suffix is not a check character: it only has to be one of A to D.

The check digit, step by step

There is no check digit to compute. Validation is a set of structural rules: the first letter is never D, F, I, Q, U or V; the second is never D, F, I, O, Q, U or V; the prefixes BG, GB, NK, KN, TN, NT and ZZ are not issued; there are exactly six digits; and the last letter is A, B, C or D. The table below shows how the rules apply to the example.

Worked example with CB 18 32 65 D:

PartValue in the exampleRule
PrefixCBtwo letters; the first never D F I Q U V, the second never D F I O Q U V; BG GB NK KN TN NT ZZ are not issued
Number183265six digits, in pairs
SuffixDone letter from A to D

Valid examples

Five numbers generated by the tool with a fixed seed, each one accepted by its validator:

Example (formatted)Without maskValidator
CB 18 32 65 DCB183265Dvalid
TG 79 10 45 DTG791045Dvalid
KW 31 61 82 BKW316182Bvalid
GG 49 07 86 CGG490786Cvalid
GW 69 13 09 DGW691309Dvalid

How the validator answers

The same first example, one with a changed ending and one truncated, checked by the validator:

ValueResultReason
CB 18 32 65 Dvalid-
DB183265Dinvalidwrong format: this prefix is never issued
CB18326invalidwrong format: 2 letters, 6 digits and a suffix letter A to D

Common mistakes

  • Looking for a check digit that does not exist: a validator that "checks" a NINO beyond its structure is guessing. Be careful with services that promise to verify a NINO: only HMRC or the DWP can confirm that one exists.
  • Temporary numbers that start with "TN" are not national insurance numbers for a form that expects a permanent one: the validator rejects them on purpose.

Frequently asked questions

Does a NINO have a check digit?

No. The only checks are structural: the allowed letters, the six digits and the suffix. That is why random sequences that follow the rules look valid even if nobody holds them.

Can a NINO be checked online?

Only by HMRC, through its own services and for the holder or an employer. A validator can only tell whether the number is well formed, never whether it was issued.

Can I use a NINO number generated here in a real system?

No. A number such as CB 18 32 65 D has a correct format and check, but nobody was issued it, and it may coincide with a real holder by chance. Use it in test environments, demos and automated tests that never leave your control.

Report a problem