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 include: Changi Extension Line.
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.
- 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.