The Dunfermline and Queensferry Railway was a railway company founded to form part of a rail and ferry route between Dunfermline and Edinburgh, in Scotland. It was authorised in 1873 and its promoters had obtained informal promises from the larger North British Railway that the NBR would provide financial help, and also operate the ferry and the necessary railway on the southern side of the Firth of Forth.
In fact the NBR realised that the Forth Bridge would be built before long and that money spent on the Queensferry line would be wasted. They withdrew their support and the little company tried to build its line alone, but it soon ran out of money and had to sell out to the NBR.
The NBR completed the line and opened the south-side connecting line, but the opening of the Forth Bridge in 1890 reduced the Queensferry line to a minor branch line.
For centuries there have been a number of places where ferries took passengers and goods across the Forth, and one of these was at the narrow part of the Firth of Forth at Queensferry. When the Scottish railway network began to take shape from 1845, the two main northward routes authorised were to cross the Forth in Stirling, or to cross it directly opposite Edinburgh. The former course was taken by the Scottish Central Railway, which connected Castlecary on the Edinburgh and Glasgow Railway with Perth via Stirling. The latter course was adopted by the Edinburgh and Northern Railway, which built its line from Burntisland to Perth and Tayport, opposite Broughty, east of Dundee. The SCR route was considered a large detour by way of Falkirk and Larbert, but the E&NR route involved a significant ferry crossing, and a second one to cross the Tay to reach Dundee. The E&NR later introduced roll-on roll-off train ferries for goods and mineral wagons, avoiding transshipment.
The Edinburgh and Northern railway and the Scottish Central Railway were authorised in the 1845 Parliamentary session. The Edinburgh and Northern proposal had been controversial, and in particular a rival scheme, the Edinburgh and Perth Direct Railway, came a close second. The E&PDR wished to cross the Forth at Queensferry, thence running northwards through Dunfermline. For a time it looked as if the E&PDR scheme would be approved, but in fact it was eventually rejected by Parliament and disappeared from the scene. The railway through Fife to the north would cross at Burntisland.
These railways were substantially complete by 1849, and they were extremely popular and commercially successful. Nonetheless other routes continued to thrive, and the ferry at Queensferry was one such. It was encouraged by the fact that the railway route from Dunfermline to Edinburgh was extremely circuitous. There were two railways serving Dunfermline, a branch of the Edinburgh and Northern Railway (which had by now renamed itself the Edinburgh, Perth and Dundee Railway), and the Stirling and Dunfermline Railway. Reaching Edinburgh with the former involved travel by way of Thornton before turning south, and then enduring the ferry crossing. The latter also involved a large detour, through Stirling and Larbert. The difficulty of these indirect routes rankled with the citizens of Dunfermline, who many times petitioned the EP&DR and its successor, the North British Railway for a direct railway route. Many promises were given but the perception in Dunfermline was that the promises were worthless.