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 from 4 feet and 1/2 inch by two inches, the cylinder diameter grew from 24 to 26 inches and which now had splashers around the wheels.
After the last ten J6 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 rebuilt to the J5. Twelve almost identical locomotives went to the Midland & Great Northern Joint Railway. The J5 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 commuter trains. During the First World War, 26 locomotives 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 were rebuilt, which then became the J3 in the newly formed LNER, while the remaining J5 became the new class J4. By 1929, the LNER had rebuilt a further 82. During this time, the tasks 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 made it to British Railways in 1948, the last unrebuilt being withdrawn in 1951 and the last rebuilt ones in 1954.