Knaresborough Viaduct is a viaduct in the North Yorkshire town of Knaresborough, England. The viaduct carries the Harrogate line over the River Nidd in the town. The viaduct was supposed to have opened in 1848, but the first construction collapsed into the river very near to completion, which necessitated a new viaduct and delayed the opening of the line through Knaresborough by three years.
 The viaduct can be seen striking across the Nidd Gorge from the ruins of Knaresborough Castle and is a well-known viewpoint in the town. One writer has stated that it is one of the region's better known landmarks.
 The viaduct connects Knaresborough with Harrogate on the Harrogate line, in North Yorkshire, England. The line was built in 1848 with the Leeds and Thirsk Railway creating a branch from their line at Starbeck railway station to go through Knaresborough and connect with the line that was being built westwards from York as part of the East and West Yorkshire Junction Railway. Just as the viaduct had been almost completed, it collapsed into the River Nidd on 11 March 1848. The resultant noise of the falling masonry was said to have lasted for five minutes. Whilst there was no official inquiry, it is believed that the collapse of the viaduct was down to a combination of bad workmanship, poor materials and excess water in the swollen river below as a result of heavy rain over a period of two months. Despite the collapse, the centre span was still in situ and had to be demolished before work could start again on a replacement viaduct. Other reports state that the entire bridge collapsed and that owing to the exertions of the workmen, "a considerable portion of the ruins, about the centre of the structure, were cleared out and the water flowed on comparatively unimpeded."
 The fall of the viaduct necessitated a temporary Knaresborough railway station situated to the east of the present day station whilst a new viaduct was completed and the permanent station was built. The collapse of the viaduct allowed a considerable amount of stone and lime to enter the river. Due to the presence of lime in the water, thousands of fish were found dead over a large stretch of the river downstream. The contractors, Wilson and Benson, took the two railway companies to court as Thomas Grainger had been engaged to act as an arbitrator in the resultant argument about who should pay for the failed viaduct. Grainger decided that the railway companies should pay over £5,600, but that the two contractors must pay £2,389 and relinquish any further claims on property, materials or the right to build the new viaduct. The main complaint that Benson and Wilson had against Grainger was that he had been employed by both companies to engineer the railway line and stations, so they alleged a bias on his part.
 A new viaduct was started in 1848 and used the same source of stone as the previous viaduct; a quarry at Abbey Crags, part of the Nidd Gorge through Knaresborough some 1 mile (1.5 km) to the south of the viaduct. The stone was quarried from the same Upper Plompton Grit that was used in the castle and other buildings in the town.
 A replacement viaduct was opened on 1 October 1851 costing £9,803, and was constructed with castellated walls and piers to blend in with the ruined walls of Knaresborough Castle. It consists of four arches and three piers, the middle of which stands in the water. Railway mapping lists the viaduct as being 4 chains (260 ft; 80 m), but other sources list its length to be 330 feet (100 m). The North Eastern Railway Engineer's Line Diagram shows that the length is 5.21 chains, or 104.8 m. The viaduct is 78 feet (24 m) high, and each span is 56.9 feet (17.3 m) across in width. The height of the parapets is only 35 inches (88 cm) which has led to Network Rail installing temporary fencing to protect workers when maintenance is underway on the structure.
 The viaduct can be seen from the castle (looking upstream along the River Nidd) and is a regular viewpoint of the structure that has attracted accolades, though opinion is divided on the subject. In his 1967 survey of the West Riding of Yorkshire, Nikolaus Pevsner stated that the viaduct was "one of the most notable railway crimes in England. To castellate the bridge does not make it a picturesque object". Conversely, noted Yorkshire-born writer, J. B. Priestley, was in admiration of how the river reflected the viaduct and said that it "added a double beauty to the scene". In a 2015 poll conducted by the Dalesman magazine, the viaduct came at number 23 out of the 50 best views in Yorkshire. The viaduct is now a grade II* listed structure.