Did you know ... Search Documentation:
Pack uk_plate_age -- README.md

uk_plate_age (SWI-Prolog pack)

Works out when a vehicle was first registered from the age identifier on a Great Britain number plate. Same rules as our Python, D, Haxe and Racket ports, following DVLA leaflet INF104.

?- pack_install(uk_plate_age).
?- use_module(library(uk_plate_age)).

?- plate_period("AB24 CDE", Start, End).
Start = 2024-3, End = 2024-8.

?- plate_period_text("ab74cde", T).
T = "September 2024 to February 2025".

?- plate_period("P123 ABC", S, E).
S = 1996-8, E = 1997-7.

?- identifiers_for_year(2025, Ids).
Ids = [25, 75].

How the identifiers work

  • Current format (September 2001 onwards): from 1 March the two digits are the year (24 = March to August 2024). From 1 September they are the year plus 50 (74 = September 2024 to February 2025). 51 came first; 00, 01 and 50 were never issued.
  • Prefix format (August 1983 to August 2001): one letter at the start. It changed every August until 1998, then every March and September. I, O, U and Z were not used, and Q is for vehicles of unknown age.

What a plate cannot tell you

A private plate can make a car look older than it is, never newer. Dateless and Northern Ireland plates have no age identifier, and imports are dated from their first UK registration. The exact answer is the date of first registration on the V5C. plate_period/3 fails when there is no identifier.

Tests

swipl -g run_tests -t halt test/test_uk_plate_age.pl

Licence

MIT. Maintained by the CarCheckHQ team (DESKLINK LTD). The same decoder runs in the browser at https://carcheckhq.com/tools/number-plate-decoder