The design of the J5 goes back to the design of Patrick Stirling's “Standard Goods” which were built from 1867 and are known as the Class J7. As a direct development, the J6 was built from 1873, in which the boiler diameter was increased by two inches from 4 feet and 1/2 inch, the cylinder diameter grew from 24 to 26 inches and which now had splashers around the wheels.
After the last ten J6s received other 4ft 5in diameter boilers, 133 new locomotives were built in 1903 with these boilers and designated J5. 125 of the 170 J6 were then also converted to the J5. Twelve almost identical locomotives went to the Midland & Great Northern Joint Railway. The J5s could often be found double-headed in front of heavy coal trains running non stop from Peterborough to London. In some cases, however, they were even used in front of local trains. During the First World War, 26 engines were drafted by the ROD and taken to France. They received a condensation device to reduce the visible vapor plume, which was removed again when they returned to Great Britain.
From 1912 Nigel Gresley began rebuilding the J5 into a new class called the J4. A new boiler was used, which now had a diameter of 4 feet and 8 inches and was actually intended for the 4-4-0 class D2 locomotives. Prior to the grouping, 71 examples were rebuilt, which then became the J3 in the newly formed LNER, while the remaining J5s became the new class J4. By 1929, the LNER had rebuilt a further 82 units. During this time, the task area of the locomotives shifted to shunting tasks and local freight trains, since more powerful locomotives were now available for transporting heavy freight trains on main lines. Gradually the number of locomotives was reduced, with some being sold to coal mines. A few examples made it to British Railways in 1948, the last unconverted being retired in 1951 and the last converted in 1954.