This line was opened by the Caledonian Railway as part of a plan to link Glasgow and Edinburgh to the railways in England. The main line from England (now known as the West Coast Main Line) splits at Carstairs, with one branch going to Edinburgh Waverley and the other to Glasgow Central. The Glasgow–Edinburgh via Carstairs line consists of those two branches joined by a short connecting chord at Carstairs. The Edinburgh portion opened for passengers on 15 February 1848, and the Glasgow section opened for passengers on 1 November 1849.