Despite the advent of electric and diesel locomotives in the mid-20th century, steam locomotives continue to be used and constructed into the 21st century.
Steam locomotives constructed in the 21st century fall into two broad categories: those that use advanced steam technology to be commercially competitive with diesels; and those built to more traditional designs for hauling tourist trains. Even locomotives in the second case likely use some modern methods and materials. These include welded boilers, to simplify construction, and roller bearings to improve reliability. For health and safety reasons, asbestos is not used for boiler lagging and is replaced by other materials, such as glass fibre. If the locomotive runs on main lines, safety systems such as the Train Protection & Warning System (TPWS) and an On-Train Monitoring Recorder (OTMR) must be fitted.
Steam locomotives were still produced up until 1999 in mainland China with the last locomotive built being SY-1772. Several members of the class were also built for heritage railways in the USA. Other locomotive classes that were still being built in China during the 1980s and 1990s include the QJ class, C2 class and JS class. In East Germany steam trains saw use up into the 1990s on narrow gauge networks with some still being steam hauled today. in 1985 a replica of the Iron Duke class locomotive was built by the Didcot Railway Centre this was later followed by the construction of a replica at the Coalbrookdale Museum in 1990 of the Coalbrookdale Locomotive, later in 1991 No.7 of the Talyllyn Railway was constructed while a replica of Planet was constructed at the Manchester Museum of Science & Industry, several locomotives based on the design of BRB H 2/3 No. 6 and 7 were built in Austria and Switzerland for the Schafberg Railway, Chemin de fer MontreuxâÂÂTerritetâÂÂlionâÂÂRochers-de-Naye and Brienz-Rothorn Railway between 1992 and 1996. locomotives of the class CFR/CFF 764-4 were constructed between 1982 and 1987 in Romania for forestry railways. In the United States the Northwestern Steel and Wire mill in Sterling, Illinois operated steam train until 1980 while one railway, Crab Orchard and Egyptian Railway used steam locomotives until 1986. In Australia two railways in New South Wales still operated steam locomotives with South Maitland ending steam operations in 1983 while the Richmond Vale Railway ended their steam operations in 1987.
JS-class steam locomotives were used in active service at a rural coal mine in western China until January 2024. They hauled coal trains until 2022, after which a few remained as switchers. In Eritrea, steam locomotives are still used in irregular revenue and commercial service. Due to oil shortages in North Korea, steam engines have started to be brought back into service. In the Tuzla region of Bosnia and Herzegovina, the coal mines still use World War II-era German-built steam locomotives. On the island of Java in Indonesia, several sugarcane tramways still use steam locomotives. Several railways in Cuba continue to use steam trains with these being used for sugar cane plantation farms or tourism.
Railfan & Railroad stated in 2022 that "the only places on earth to see steam locomotives in revenue freight service are small switching operations in China, North Korea and Bosnia", but that these were "sporadic at best".
On 25 August 2009 Inspiration, developed by the British Steam Car Challenge team, broke the record for a steam vehicle set by a Stanley Steamer in 1906, setting a new speed record of over a measured mile at Edwards Air Force Base in the Mojave Desert of California. Both the old and new records are only slightly faster than the record for the fastest ever steam locomotive record. The next day Team Inspiration broke a second record by setting a new speed record of over a measured kilometer. The team behind Inspiration have since set up a company, Steamology, to develop small modular steam generators burning hydrogen and oxygen to make high-pressure steam. These units can be drop-in replacements for the power trains of diesel-electric locomotives and other heavy transport. In June 2024 Steamology signed a contract with Arup and Eversholt Rail in collaboration with Freightliner under the H2Steam banner, to refit a Class 60 locomotive with a Steamology hydrogen unit in 2025. The conversion will replace the diesel engine with 20 steam generators, four steam turbines and 140 kg of gas storage, creating a 2MW zero emission locomotive.
DLM AG, formerly part of the Swiss Locomotive and Machine Works (SLM) that built most of the world's mountain railways, has worked on advanced steam since its buyout from SLM in 2000. They rebuilt 52 8055 with oil-fired advanced steam technologies and now offer trips with it including cab rides. They claim that modern steam locomotives on mountain railways have similar running costs to diesel engines.
The 5AT Advanced Technology Steam Locomotive hoped to create a modern steam locomotive based on the well-documented BR Standard Class 5, incorporating the experience of British engineer David Wardale in modernising the South African Class 26 4-8-4 Red Devil. This project was officially cancelled in March 2012 due to lack of support, but the 5AT Group reformed as the non-profit Advanced Steam Traction Trust. The ASTT studies different options for modern steam and is building a one-fifth scale, 10üâ gauge prototype called Revolution as a low-cost way to demonstrate some of their ideas. In August 2025 they showed the part-built Revolution at an event for the Railway 200 celebrations at Alstom's works in Derby.