The main line, or mainline in American English, of a railway is a track that is used for through trains or is the principal artery of the system from which branch lines, yards, sidings and spurs are connected. It generally refers to a route between towns, as opposed to a route providing suburban or metro services. For capacity reasons, main lines in many countries have at least a double track and often contain multiple parallel tracks. Main line tracks are typically operated at higher speeds than branch lines and are generally built and maintained to a higher standard than yards and branch lines. Main lines may also be operated under shared access by a number of railway companies, with sidings and branches operated by private companies or single railway companies.
Railway points (UK) or switches (US) are usually set in the direction of the main line by default. Failure to do so has been a factor in several fatal railway accidents, for example the Buttevant Rail Disaster in Ireland, and the Graniteville train disaster in the US.
In the UK, the term "main line" may also be used to distinguish any train or track that is not part of a light-rail or underground network.