The Devizes branch line was a railway line from Holt Junction, Wiltshire to Patney and Chirton, Wiltshire, and named after Devizes, the largest town on the line. It was built by the Wilts, Somerset and Weymouth Railway, and was later purchased by the Great Western Railway. At one point the Devizes line provided a direct link from London to the West Country.
The idea of a railway line through Devizes was first conceived in 1830, before the Great Western Railway (GWR) had begun to construct its main lines. Devizes was regularly considered by the GWR as a major stop on its London to Bristol Line but lost out to Swindon due to lack of potential traffic from Devizes.
Although included in several plans for railway lines—including the Thingley Junction to Westbury line, and the Staverton and Bathampton line—the financial backing required was not available. Potential construction costs were high because Devizes stands on a hill, so the town was left without a station. In 1846 it was decided that the Devizes line would run from Holt Junction eastward to Devizes, and in 1854 the GWR finally began work on the branch, which was completed in 1857.
In 1862 the GWR extended its Reading-Hungerford line westward via Pewsey to Devizes, creating a direct link from London Paddington to Bristol which was quicker than any other line. This was the busiest period for the Devizes line, but traffic declined from 1900 after the Stert-Westbury link was built to reduce journey time by avoiding the steep inclines into Devizes.