The UK Driving Licence Number Format Explained

Reference · November 2026 · 8 min read

What each of the 16 characters on a GB driver number encodes (surname, date of birth, sex, initials), what a validator can and cannot check, how Northern Ireland differs, and how to handle licence numbers in test data.

The 16-character driver number on a GB driving licence is not random. It encodes the holder's surname, date of birth, sex and initials in a fixed layout that the DVLA publishes, which is why it is one of the few identifiers you can partly check against the person's other details without a database. This guide decodes each position, explains what the format can and cannot tell you, and sets out how to handle driving licence numbers in forms and test data.

Where the number is

On a GB photocard licence the driver number is field 5, printed under the holder's name and date of birth. It is 16 characters, usually shown in three groups:


MORGA 657054 SM9IJ

Two further characters often follow it on the card. They are the licence issue number, which increases by one each time a replacement licence is issued, and they are not part of the driver number. A form that asks for the driver number should ask for 16 characters; a form that accepts 18 should know the last two will change when the licence is renewed.

Decoding the 16 characters

Using MORGA657054SM9IJ as the example throughout (a fictional holder: surname Morgan, born 5 July 1964, recorded as female, initials S. M.):

Reading the example back: surname beginning MORGA, born in the 1960s, month 57 − 50 = 07 so July and the holder is recorded as female, day 05, year ending 4, so 5 July 1964, initials S and M.

The DVLA describes positions 15 and 16 as "computer check digits randomly generated as a secure measure". Because the algorithm is not public, a validator cannot verify them; it can only check that they are two alphanumeric characters.

What a validator can check

Quite a lot, as it turns out, which is why identity and insurance systems ask for the licence number alongside the name and date of birth rather than instead of them:

1. Shape. Five letters (or letters padded with 9), then six digits, then two letters or 9s, then a digit, then two alphanumerics. 2. Surname agreement. The first five characters should match the first five letters of the surname given, upper-cased, with 9-padding. Spaces, hyphens and apostrophes are dropped: O'Brien becomes OBRIE, Smith-Jones becomes SMITH. 3. Date of birth agreement. Positions 6 and 11 give the year's decade and unit; positions 7 and 8 give the month, minus 50 for women; positions 9 and 10 give the day. These should match the date of birth supplied, and the month must be 01 to 12 or 51 to 62. 4. Initials agreement. Positions 12 and 13 should match the first letters of the forenames.

A mismatch at steps 2 to 4 means either a typo or a number that does not belong to the person. A pass means the number is consistent with the details, not that it is a real licence.


const DRIVER_NUMBER = /^[A-Z9]{5}\d{6}[A-Z9]{2}\d[A-Z0-9]{2}$/;

function decodeDriverNumber(input) {
  const v = input.toUpperCase().replace(/\s/g, '');
  if (!DRIVER_NUMBER.test(v)) return null;
  const month = Number(v.slice(6, 8));
  const female = month > 50;
  const mm = female ? month - 50 : month;
  if (mm < 1 || mm > 12) return null;
  return {
    surnameStart: v.slice(0, 5).replace(/9+$/, ''),
    decade: v[5],
    month: mm,
    day: Number(v.slice(8, 10)),
    yearDigit: v[10],
    recordedAsFemale: female,
    initials: v.slice(11, 13).replace(/9/g, ''),
    checkCharacters: v.slice(14)
  };
}

decodeDriverNumber('MORGA 657054 SM9IJ');
// { surnameStart: 'MORGA', decade: '6', month: 7, day: 5, yearDigit: '4',
//   recordedAsFemale: true, initials: 'SM', checkCharacters: 'IJ' }

Note that the decade digit and the year digit do not give the century. A holder born in 1964 and one born in 2064 would share 6 and 4; in practice the context (a licence holder must be at least 16 or 17) resolves it.

Northern Ireland is different

Licences issued by the Driver and Vehicle Agency in Northern Ireland use an eight-digit driver number with no encoded information. A form that serves the whole UK needs to accept both: 16 characters matching the GB pattern, or 8 digits for NI. Rejecting an NI number because it is "too short" is a common and avoidable bug.

What the number does not prove

A driver number that decodes correctly and matches the name and date of birth is consistent with those details. It does not prove that the licence exists, is current, or is held by the person in front of you. The DVLA offers a View Driving Licence service through which a licence holder can generate a check code to share with an employer or hire company, and that service is the authoritative source for the licence's status, entitlements and penalty points. For identity verification, the photocard itself (or an image of it checked by a document verification service) is the evidence; the number is a reference.

Because the number encodes personal details, it is personal data in its own right and, since it reveals date of birth and recorded sex, deserves the same handling as those fields. Do not log it, do not display it in full in support tools, and do not put it in a URL.

Driving licence numbers in test data

The encoding makes licence numbers unusually easy to fabricate from a fictional person, and unusually dangerous to copy from a real one, since a real number reveals the holder's surname, birthday and sex to anyone who knows the layout.

  • Derive test numbers from fictional personas. Take a generated name and date of birth from the test data generator or the name generator, build positions 1 to 14 by the rules above, and use any two alphanumerics for positions 15 and 16. The result is internally consistent with the persona and belongs to nobody.
  • Never use a real licence number, including your own, in fixtures or demos.
  • Include the edge cases. A four-letter surname (LEE99), a single forename (J9), a female holder (month 51 to 62), a hyphenated surname, and an eight-digit Northern Ireland number.
  • Mock any lookup. If your system calls a licence checking service, mock it, as described in mocking a UK address lookup API in tests, and drive each outcome from the mock rather than from the number.

Identity documents in general, and how to test flows that check them without real identities, are covered in testing KYC and identity verification flows. For the other UK identifiers that encode or check something, see the guides to the NHS number, the National Insurance number and the VAT number.

More guides