A branch line is a secondary railway line which branches off a more important through route, usually a main line. A very short branch line may be called a spur line. David Blyth Hanna, the first president of the Canadian National Railway, said that although most branch lines cannot pay for themselves, they are essential to make main lines pay.
The smallest branch line that is still in operation in the UK is the Stourbridge Town Branch Line from Stourbridge Junction going to Stourbridge Town. Operating on a single track the journey is 0.8 miles (1.3 kilometres) long and the train takes around two and a half minutes to complete its journey.
Examples of spur lines in Singapore:
Examples of spur lines in Hong Kong:
In North America, little used branch lines are often spun off from larger railroads to become new common carrier short-line railroads of their own. Throughout the United States and Canada, branch lines serve to link smaller towns or cities located too distant from the main line to be served efficiently, or to serve a certain industrial site such as a power station either because of a location away from the main line or to reduce congestion. They were typically built to lower standards, utilizing lighter rail and shallow roadbeds when compared to main lines. In the United States, abandonment of unproductive branch lines was a byproduct of deregulation of the rail industry through the Staggers Act.
The Princeton Branch is a commuter rail line and service owned and operated by New Jersey Transit (NJT) in the U.S. state of New Jersey. The line is a short branch of the Northeast Corridor Line, running from Princeton Junction northwest to Princeton with no intermediate stops. Also known as the Dinky Line. At 2.9 mi (4.7 km) it is the shortest scheduled commuter rail line in the United States. The run takes 4 minutes, 47 seconds. 
New Zealand once had a very extensive network of branch lines, especially in the South Island regions of Canterbury, Otago, and Southland. Many were built in the late 19th century to open up regions inland from coastal harbours and cities for farming and other economic activities. The branches in the aforementioned South Island regions were often general-purpose lines that carried predominantly agricultural traffic, but lines elsewhere were often built to serve a specific resource: on the West Coast, an extensive network of branch lines was built in rugged terrain to serve coal mines, while in the central North Island and the Bay of Plenty, lines were built inland to provide rail access to large logging operations.
Today, many of the branch lines have been closed, including almost all of the general-purpose country lines. Those that remain serve ports or industries not located near main lines such as coal mines, logging operations, large dairying factories, and steelworks. In Auckland and Wellington, two branch lines in each city exist solely for commuter passenger trains. For more, see the list of New Zealand railway lines.
There are some branch lines in Japan. The longest branch line is the 18.0 km long Saikyō Line which is a common name of the Tōhoku Main Line branch line between Akabane Station and Ōmiya Station via Musashi-Urawa Station.
Akabane Station and Ōmiya Station are also connected by the Tohoku Main Line via Urawa Station. Such branch lines are alternate routes of main lines and are connected to the main line on both ends, such as Hinkaku, Negishi, Gotemba, and Futamata Lines (alternate routes of the Tokaido Main Line), Ako, Kure, Gantoku and Ube Lines (alternate routes of the Sanyo Main Line), Keihin Tōhoku and Abukuma Lines (alternate routes of the Tōhoku Main Line).
- Hanna, David Blyth, Macmillan 1924
- Dow, Andrew, Dow's Dictionary of Railway Quotations, JHU Press 2006
- Rosenbaum, Joel; Tom Gallo (1997). NJ Transit Rail Operations. Railpace Newsmagazine.
- "Picks and Pans Review: Princeton Junction & Back", People (magazine) Vol. 11 No. 13, April 2, 1979, retrieved April 15, 2012
- Schultz, Bonnie (June. 2011). "Arts and Transit: NJ Transit Weighs In". AllPrinceton.com. Retrieved April 15, 2014.
- Frassinelli, Mike (June 25, 2013). "Historic Princeton 'Dinky' line train station to move for arts center". The Star-Ledger. Retrieved 2013-06-26.