Skip to content

Vehicle plate numbers

The National Road Traffic Regulations 2012 (Official Gazette No. 101) set two plate formats that naija-data checks:

Format Example Parts
standard KJA-123AB 3 letters (Local Government code), 3 digits, 2 letters
dealer DKN 135 3 D + state code (KN = Kano), 3 digits, 1 character
import { parsePlate, plateError, isValidPlate } from "naija-data";
parsePlate("kja 123 ab")?.display; // "KJA-123AB" (store or show this)
parsePlate("DKN 135 3")?.state_code; // "KN"
plateError("AB-123-CD"); // "unknown_format"
isValidPlate("KJA-123AB", ["standard"]); // true

Error codes: empty, invalid_characters, unknown_format, unknown_state (a dealer plate whose state code does not exist).

plateCategories() / plate_categories() lists the colours the Regulations set for each category, for example red lettering for commercial vehicles, blue for private, green for government.