Headcodes Explained
A “headcode”, also known as a train reporting number, is a four-character identifier used across the UK rail network to identify a train service. Every scheduled service, freight movement, and light engine movement is assigned one.
History
Section titled “History”Headcodes originated around 1850 as physical oil lamps mounted on the front of locomotives. Signalmen used the lamp positions to identify the type and priority of an approaching train. Each railway company maintained its own codes until the Railway Clearing House standardised them across the network.
When the four-character alphanumeric format was introduced in 1960, it merged the older lamp-based headcode system with textual reporting numbers into a single identifier. Locomotives displayed these on roller-blind panels until 1976, when centralised power signalling made the physical display unnecessary on most routes.
Today, headcodes are no longer shown on the outside of most trains, but they remain central to timetabling, signalling systems, and delay attribution.
Structure
Section titled “Structure”A headcode follows the format: [Class][Destination][ID][ID]
For example, in 1S35:
| Position | Character | Meaning |
|---|---|---|
| 1st | 1 | Train class — express passenger |
| 2nd | S | Destination region — Scotland |
| 3rd–4th | 35 | Individual service identifier |
Train class (first digit)
Section titled “Train class (first digit)”The first digit indicates the class of service, which determines the train’s priority and permitted line speed.
| Class | Description |
|---|---|
| 0 | Light locomotives |
| 1 | Express passenger, postal/parcels, breakdown and test trains |
| 2 | Ordinary and suburban passenger, driver training |
| 3 | Rail head treatment trains, priority empty coaching stock and freight |
| 4 | Freight — up to 75 mph |
| 5 | Empty coaching stock (ECS) |
| 6 | Freight — up to 60 mph |
| 7 | Freight — up to 45 mph |
| 8 | Freight — up to 35 mph |
| 9 | Special express passenger services |
Destination letter (second character)
Section titled “Destination letter (second character)”The second character is a letter indicating the train’s destination area.
For inter-regional services, standardised letters represent broad regions:
| Letter | Region |
|---|---|
| E | Eastern |
| L | Anglia |
| M | Midland |
| O | Southern |
| S | Scotland |
| V | Western |
For intra-regional services, remaining letters indicate specific destination zones or routes within a region.
Some letters have special meanings:
| Letter | Meaning |
|---|---|
| Q | Track recording trains |
| X | Out-of-gauge loads, Royal Train, or other special requirements |
| Z | Charters, railtours, emergency trains, and other special services |
Service identifier (third and fourth digits)
Section titled “Service identifier (third and fourth digits)”The last two digits distinguish individual services sharing the same class and destination. Headcodes tend to be sequential, so consecutive numbers often represent consecutive departures on the same route.
On frequent services, numbers are reused throughout the day. For example, 1R25 might be used for the 09:00, 15:00, and 21:30 departures on the same route.
Route letters apply in both directions, with odd and even service numbers typically distinguishing the direction of travel.
Uniqueness
Section titled “Uniqueness”Headcodes are not guaranteed to be unique across the network. The same headcode can be assigned to different services in different regions, or reused at different times of day. For example, 1M11 might identify both a sleeper service and a daytime departure from the same origin.
Within signalling and timetabling systems, headcodes are combined with origin codes and timetable version identifiers to form longer unique references, but the four-character headcode alone should not be assumed to map to a single service.
Special conventions
Section titled “Special conventions”- Empty coaching stock movements use class 5 with the same last three characters as the passenger service they are forming or have completed. For example, 5M11 is the empty stock positioning move for 1M11.
- Light engine movements use class 0 with the last three characters of the service the locomotive is working towards. A freight service 6A30 running without wagons becomes 0A30.
- Freight reclassification — a freight headcode may change based on the actual load. A 6A30 (60 mph freight) could run as 7A30 if restricted to 45 mph, or as 0A30 if running light.
- Special movements often encode the locomotive class in the service digits. For example, 0Z66 is likely a Class 66 light engine movement.
- Rescue trains — the headcode 1Z99 is reserved for any train providing assistance to another, including rescue locomotives, breakdown cranes, snow ploughs, and overhead line equipment. These are given highest priority.
Usage in Headcode API
Section titled “Usage in Headcode API”The Headcode API uses the headcode as one of its primary service identifiers, allowing you to look up train services and track their progress using this familiar signalling ID.