2512 - Validating Common British Data

National Insurance Number

NI numbers consist of two letters, followed by six numbers, followed by one letter: A, B, C or D, numbers beginning with TN are not valid. e.g. AB123456A

Driving Licence Number

S M I T H 7 0 5 1 7 5 M J 9 9 9 0 1

N N N N N Y M M D D Y I I C C C C C

N = 1ST five letters of the surname (if the surname begins MAC or MC its treated as MC for all)(If the name is less than five letters 9 is used for the "spaces"Y = YEAR of birthM = MONTH of birth (In the case of a female, the number represented by the first M will have the value 5 added e.g. a female born in November would display '61' in the MM boxes)D = DAY of month of birthI = Initial letter of the first two forenames - if only one, then 9 will replace the second IC = Computer generated

National Health Service Number

The old NHS number had many formats which could not reliably be validated, which meant that many NHS organisations just didn't use it. The old number was gradually replaced by a new 10 digit unique person identifier number where the last number acts as a check digit to guard against typographical error. A Weighted Modulus 11 algorithm is used, as with ISBN numbers with the difference that if the check digit would be 10 then the NHS number is invalid and not used (ISBN would use X)(see separate help-sheet)

Since July 1995 every new born baby has been allocated a new NHS number and everyone's old NHS number has been replaced with the new number.

e.g. 4582701086


Passport Number

New style (red passport) Must be 9 characters and all characters must be numeric.

Old style (blue passport) Must be 7 characters, first or last character is a letter, rest are numeric

Post code

Format / Example Postcode / Format / Example Postcode
AN NAA / M1 1AA / AANN NAA / DN55 1PT
ANN NAA / M60 1NW / ANA NAA / W1A 1HQ
AAN NAA / CR2 6XH / AANA NAA / EC1A 1BB

The letters Q, V and X are not used in the first position. The letters I, J and Z are not used in the second position.

The only letters to appear in the third position are A, B, C, D, E, F, G, H, J, K, S, T, U and W. The only letters to appear in the fourth position are A, B, E, H, M, N, P, R, V, W, X and Y.

The second half of the Postcode is always consistent numeric, alpha, alpha format and the letters C, I, K, M, O and V are never used.

GIR 0AA is a Postcode that was issued historically and does not confirm to current rules on valid Postcode formats, It is however, still in use

e.g. ME104PT

Car Registration Number

"Old" style Car Registration numbers consist of a letter, followed by one, two or three numerals, followed by three letters. The initial letter can not be I, O, U or Z

"New" style Car Registration numbers consist of two letters, followed by two numbers, followed by three letters. The first two letters identify the area in which the car was registered, the two numbers identify when it was registered; changing every six months in March and September, these currently alternate between numbers starting with '0' and '5'. The sequence started in September 2001 with '51'. In March 2002 it changed to '02'. In September 2002, the number became '52'. In March 2003 it became '03', and so on. After 2010, the numbers will be 10 and 61 and continue in the same way for the next ten years

1st letter / DVLA office / Local identifier
(2nd letter) / 1st letter / DVLA office / Local identifier
(2nd letter)
A / Peterborough / A - N / M / Manchester / A - Y
Norwich / O - U / N / Newcastle / A - O
Ipswich / V - Y / Stockton / P - Y
B / Birmingham / A - Y / O / Oxford / A - Y
C / Cardiff / A - O / P / Preston / A - T
Swansea / P - V / Carlisle / U - Y
Bangor / W - Y / R / Reading / A - Y
D / Chester / A - K / S / Glasgow / A - J
Shrewsbury / L - Y / Edinburgh / K - O
E / Chelmsford / A - Y / Dundee / P - T
F / Nottingham / A - P / Aberdeen / U, V, W
Lincoln / R - Y / Inverness / X, Y
G / Maidstone / A - O / V / Worcester / A - Y
Brighton / P - Y / W / Exeter / A - J
H / Bournemouth / A - J / Truro / K, L
Portsmouth / K-V & X, Y / Bristol / M - Y
Isle of Wight / W / Y / Leeds / A - K
K / Luton / A - L / Sheffield / L - U
Northampton / M - Y / Beverley / V - Y
L / Wimbledon / A - J
Stanmore / K - T
Sidcup / U - Y
Sheffield / L - U
Beverley / V - Y

R123JBP GA51CDE

Many more examples at