The mailsort reference/number/code located to the right or found under an address on a paper driving licence was devised by the Royal Mail. It is used exclusively for the automated sorting of mail.
The first three digits of a mailsort code is the Residue Selection Code. It generally corresponds to one postcode area. The last two digits is the Direction Selection Code, which refers to one or more postal districts.
Mailsort codes often have a letter (A-P) prefix linked to the country’s sixteen regional divisions. It ensures that a sender’s items with the furthest to travel will be processed first by the Royal Mail and ones in the same region as the sender are handled last.
On 8 June 2015, the paper counterpart to the photocard driving licence has been replaced by an online service. The change applies to GB driving licences only. Driver licensing is a devolved issue in Northern Ireland.
To know what the various codes and categories on your licence mean, see Directgov's the photocard driving licence explained.