Random NHS Number Generator

 
NHS Number generated locally in your browser with the Web Crypto API.

Checksum-valid UK NHS Number

Generate a random, format-shaped UK NHS Number — the 10-digit patient identifier used across the NHS — shown grouped as NNN NNN NNNN. The first nine digits are random and the tenth is a correct Modulus-11 check digit, so each value passes the validation real NHS systems apply. Useful for seeding EHR forms, exercising validators, and building healthcare demos.

How the check digit works

An NHS Number is ten digits. The first nine are drawn with browser randomness, then each (1-indexed) is multiplied by the weight 11 − position, giving weights 10, 9, 8, 7, 6, 5, 4, 3, 2. The weighted sum is taken modulo 11 and the check digit is 11 − remainder, where 11 maps to 0. A remainder that would produce a check digit of 10 is invalid, so that draw is discarded and a new one taken — every value Rangdom shows has a valid check digit.

When to use it

Use this generator to fill NHS Number fields in EHR forms, patient seed data, and test fixtures, and to exercise validators that apply the Modulus-11 check. These are format/checksum fixtures only — they are not allocated by the NHS and are not tied to a real patient. This is the NHS Number (patient ID), not the UK National Insurance Number.