A class of locomotives is a group of locomotives built to a common design, typically for a single railroad or railway. Often members of a particular class had detail variations between individual examples, and these could lead to subclasses.  Sometimes technical alterations (especially rebuilding, superheating, re-engining, etc.) move a locomotive from one class to another. Different railways had different systems, and sometimes one railway (or its successors) used different systems at different times and for different purposes, or applied those classifications inconsistently. Sometimes therefore it is not clear where one class begins and another ends. The result is a classic example of the Lumper splitter problem.

US-American practice

Development
As locomotives became more numerous the need arose to deal with them in groups of similar engines rather than as named or numbered individuals. These groups were named "classes" and at first tended to reflect capability rather than design. For example, the Baltimore and Ohio Railroad grouped its roster into four classes before the Civil War, though they had by that point dozens of different designs.

Later classes were based on design. A group of locomotives built off the same blueprints constituted a class, and if some of the locomotives in the class were sufficiently modified, a new class might be established for the modified examples. When electric locomotives were introduced, the same scheme was applied to them.

Since steam and early electric locomotives were usually custom built, classes were assigned by the railroad, and each railroad had its own system. Mergers of lines and sales of locomotives brought about changes of class. Early diesels were often fitted into the locomotive class system, but since they were generally not custom built the use of manufacturer model designations overtook the class system and made it irrelevant, except for historical discussion.

Class system organization
Usually, the class system for a railroad was built on a simple hierarchy, to which each class was assigned a code.

First level: Wheel arrangement
The first level was usually for the wheel arrangement and was usually coded by a letter of the alphabet. Different railroads used different codes, so while, for instance, the designation of "J" on the New York Central Railroad meant a 4-6-4 (Hudson), on the Norfolk and Western Railway it signified a 4-8-4 (Northern), and on the Baltimore and Ohio Railroad it denoted a 4-4-0 with a Wootten firebox.

Classification of Articulated locomotives was handled through varying methods. On many railroads each wheel arrangement was assigned its own unique letter, due to the limited number of arrangements that had to be represented. On other railroads this was insufficient, and articulated locomotives would be  represented with a two letter code, one letter for the arrangement of each half. The Pennsylvania Railroad GG1 (UIC ) is an example of this classification method; on the Pennsylvania, “G” denoted a 4-6-0 or “ten-wheeler”, and the GG1 design was, in effect, two ten-wheelers coupled end-to-end (by virtue of its wheel arrangement).

Second level: Sequential model
A sequence number was often added to distinguish different designs of the same wheel arrangement. As a general rule the first design for a given arrangement often had no sequence number, so that numbering stated at 1 with the second design for the wheel arrangement. For example, there were two main classes of 2-10-2 locomotives on the B&O, labelled "S" and "S-1".

Third level: Variants
Letter suffixes were often used to indicate variants in a basic design. Sometimes these also referred to specific characteristics; for example, for many years the Pennsylvania Railroad used a "s" suffix to indicate superheating, while on the B&O a "t" suffix indicated an engine with an oversize tender.

Class names
Most locomotives were given simple codes, but some classes were named or nicknamed, formally and informally.
The Union Pacific’s 4-8-8-4s are said to have been earned the nickname “Big Boy” when the moniker was scrawled on the smokebox of one of the locomotives when it was built.
The Baltimore and Ohio Railroad’s P-7 class of 4-6-2s was referred to as the "President" class, as each locomotive initially had the name of a U.S. President on the cab.
The Baltimore and Ohio’s S and S-1 classes of 2-10-2 were often referred to as "Big Sixes" since all members of the class was numbered in the 6000s.

British practice

The old railway companies had various systems of classification. Taking the "Big Four" companies which operated from 1923 to 1947:

Great Western Railway

The class number was usually taken from the first member of each class, e.g. "5700 Class" or "57XX Class" for locomotives in the number series beginning 5700.

Southern Railway

Each class was given a letter or number but these were not very meaningful. For example, "700" Class locomotives were 0-6-0s, but so were "Q" Class engines. See: SR Q class, SR Q1 class

London, Midland and Scottish Railway

Each locomotive was given a power classification, e.g. "3F".  However, many different classes would have the same power classification so this was not helpful for identifying classes. This system was adopted from the Midland Railway.

London and North Eastern Railway

The LNER's classification system was the most helpful to railway enthusiasts. Each wheel arrangement was given a letter (e.g. A for 4-6-2, B for 4-6-0, etc.) and this was followed by a number denoting the class (e.g. A1, B1, etc.). This system was adopted from the Great Northern Railway, which used a similar classification scheme.

German practice

Swiss practice

Japanese practice

See also
Ship class

Locomotive classification systems