Under the Whyte notation for the classification of steam locomotives, 0-4-0 represents one of the simplest possible types, that with two axles and four wheels, all of which are driven. Generally speaking, those two axles are linked with side rods and form a single driven set. Richard Trevithick's 1804 pioneering locomotive, fittingly, was of the simple 0-4-0 type. In the U.S., the Baltimore and Ohio Railroad's 0-4-0 "Atlantic" #2 was built in 1832 by Phineas Davis and Israel Gartner.
Other equivalent classifications are:
UIC classification: B (also known as German classification and Italian classification)
French classification: 020
Turkish classification: 22
Swiss classification: 2/2
In the UIC classification used in Europe and in more recent years in simplified form in the United States, an 0-4-0 is classified as B (German/Italian) (if the axles are connected by side rods or gearing) and 020 (French) (independent of axle motoring). (UIC's Bo classification indicates the axles are independently motored, which would be 0-2-2-0 in Whyte notation.)
Arrangements where all the wheels are driving wheels are generally used for switchers (UK: shunters) since they use all the locomotive's weight for traction, but have no leading or trailing trucks for stability at speed. 0-4-0 locomotives could either be tank locomotives or tender locomotives, with the former more common in Europe and the latter in the United States, except in the tightest of situations such as that of a shop switcher, where overall length was a concern. The notation "0-4-0T" is often used to indicate a tank engine.
By 1900 or thereabouts, the 0-4-0 had been superseded worldwide as the standard small switcher type by the 0-6-0, since the possible tractive effort of an 0-4-0 within normal axle load limits was not enough to move more than a couple of cars. The type continued in production, though, for use where a larger 0-6-0 was not suitable. An 0-4-0 could always negotiate tighter radius curves than the larger locomotive, and its shorter length was sometimes also an advantage, so it was commonly employed in dockyard work, switching industrial street trackage, as shop switchers, and in industry.
In the United States, the Pennsylvania Railroad kept producing 0-4-0s long after all other major railroads had abandoned development of the type, building their final A5s class into the 1920s. The A5s was a monster among 0-4-0s, larger than many 0-6-0 designs, with modern features found on few others of its type: superheating, power reverse, piston valves, and many others. The Pennsy built it because it had a large number of confined and tight industrial branches, more than most other railroads.