Headcodes were at one time, from the steam era into the diesel-electric era indicated by a set of white discs on the front of the engine. At night lamps or lights were used.
There were four positions for the discs on the front of the engine. Three positions across the front (on the top of the frame) and one centrally above (the centre of the front of the smokebox).
Its main purpose is to assist the signaller in routing the train correctly, and it is especially useful if services are disrupted. The number is shown in the working timetable issued to staff and on systems such as TOPS; it is not normally provided to passengers. Some Train Operating Companies print the headcode on a ticket when cancelling it, for example 1V45 on a cross-country service to Plymouth, or 1F22 on a West Coast London Euston to Liverpool Lime Street train.
For operational reasons, certain trains have priority in running. To help operating staff, they are grouped into classes:
Class 0 is used for light locomotives. Newspaper and postal trains are consigned to history. The classes' definitions have changed several times since being introduced: Class 3 was formerly used for parcels trains, and Class 9 for freight trains without fitted brakes.
For long distance trains, the country is split up into areas based upon the old British Rail regions. Each one is assigned a letter as follows:
A train going from one region to another is given the letter of the destination region in its headcode.
For trains internal to a region, the remaining letters can be used to indicate either:
Some areas within the Midland region are:
Other regions can use these letters for different areas, but the inter-regional codes have the same meaning throughout the country.
In 2007 a special letter 'Q' was introduced for track recording trains, such as the Network Rail New Measurement train. The 'Q' emphasises to Signallers that the train is to run its booked route as it is recording. It is not to be diverted without the prior knowledge of the Controller.
Because there are many trains of the same type heading for similar destinations (for example, most expresses to Scotland have headcodes beginning with 1S) the last two digits are used to separate individual services, or to indicate the route (generally for suburban services).
There is sometimes duplication because there are only two digits, so it is the rule for individually-numbered trains that there must be six hours between services with the same headcode.
It is common practice for empty coaching stock (class 5) trains on the way to form a service or returning to depot having completed a service, to run with the same code as that service, with the 5 prefix. For example, 5M37 may be going to form or coming off either 1M37 or 2M37. Similarly, locomotives on the way to pick up a train or running round to change the direction of travel are given the train number but with a 0 prefix.
Eurostar trains usually run in the 9Oxx or 9Ixx range; the former for services to or from France, the latter for Belgium services. On entering the Channel Tunnel control area, and throughout the European system, these codes are translated to 90xx and 91xx respectively.
Trains with some specific requirements, such as out-of-gauge loads or the Royal Train, run with the letter X, and special trains not in the regular train service (e.g. charter services or railtours) have Z.
The four-character system was originally devised in the early 1960s. Locomotives built in the 1960s and 1970s were equipped with indicator boxes that displayed the headcode on roller blinds for visual recognition of trains by signalling staff.
However, they were found to be expensive to maintain and the days of the manually-operated, mechanical signal box were limited, so from 1976 they were taken out of use (this is why photographs from this period almost always show the blinds set to 0000, blank or two white dots). The Class 87 electric locomotives built in the early 1970s were the first built without headcode panels, although Class 312 EMUs were built with them in the late 1970s.
British Rail undertook modifications to locomotive noses to plate over the indicators and replaced them with marker lights. Some locomotives never received the modification under British Rail and continue to this day to operate with usually blank headcode panels, as the current train operating companies do not have the removal of the unused panels as a priority.
Not all locomotives carried 0000 headcodes. The Western locomotives had four digit numbering even after the introduction of TOPS, and it became a tradition to show the locomotive number on the headcodes.