The Festiniog Railway was built to carry slate from quarries around Blaenau Ffestiniog over the 21.7 km to the harbour at Porthmadog, and opened in 1836, using, over the first 1.5 km from Porthmadog station the embankment known as The Cob, originally built as part of a land reclamation scheme. Initially slate wagons travelled to the coast by gravity and were hauled back by horses, but the line’s first steam locomotive was delivered in 1863, enabling the introduction of passenger services two years later. The railway gained a reputation for innovation, ordering articulated locomotives of the kind patented by Robert Fairlie ((1831-85) in 1869, and introducing Britain’s first bogie passenger coaches in 1872. The railway declined in the mid-twentieth century. Passenger services ceased in 1939 and slate traffic in 1946. Attempts were made to restore the line and Alan Pegler (1920-2012) gained control of the company in 1954, enabling its release to a new Festiniog Railway Trust, and the operation of passenger services over a short distance from Porthmadog from 23 July 1955. The preservation project subsequently prospered, its greatest achievement being the construction in 1965-78 of a 4 km deviation between Dduallt and Tanygrisau replacing part of the track that had been submerged beneath the reservoir of a pumped storage power station. The work included a 280 m tunnel, and was mostly carried out by volunteers. The completion of the deviation enabled the re-opening in 1982 of the line into Blaenau Ffestiniog where the Festiniog Railway shares a joint station with the national network.
The Welsh Highland Railway was opened in two stages in 1922-23, incorporating several earlier mineral railways, and ran from Porthmadog to Dinas near Caernarfon. Its anticipated traffic from quarries did not materialise, and closure was anticipated before it was leased to the Festiniog Railway in 1934. Subsequently there was an attempt to attract tourist traffic, but this was unsuccessful, and the last passenger train ran in 1936, the last freight was carried in 1937 and the rolling stock was sold during the Second World War. A Welsh Highland Railway Society was formed in 1961 after disagreements within the Festiniog Railway Society, and in 1980 it began to work trains on what is now the Welsh Highland Heritage Railway. From 1988 the Welsh Highland Railway was controlled by the Festiniog Railway which was initially reluctant to see the creation of a competing heritage line based at Porthmadog, but eventually, after the solution of complex legal issues as well as civil engineering problems, the line was re-opened in stages between 1997 and 2011. From Dinas into the town of Caernarfon narrow gauge track was laid along the line of the former London & North Western Railway line to Afon Wen. The major civil engineering projects were carried out by contractors but most of the trackwork was laid by volunteers. The Welsh Highland Railway is distinguished by its use of Beyer Garratt articulated locomotives of which it has the first example, designed by Herbert William Garratt (1864-1913), built in Manchester in 1907, which spent most of its working life in Tasmania, as well as several larger examples built between 1937 and 1958 that worked in South Africa.
The Welsh Highland line extends 40.2 km from Caernarfon through Bedgellert and the Aberglaslyn Pass to Porthmadog and journeys normally take 105 minutes. It is possible to change at Porthmadog on to Festiniog Railway trains for the 21.7 km journey to Blaenau Ffestiniog, which normally takes 55 minutes, although trains in the opposite (downhill) direction are usually timed at 45 minutes. The two lines form one of the major attractions in the Snowdonia National Park.
The Welsh Highland Heritage Railway operates a 1.6 km line from a station opposite the national network station in Porthmadog to Pen-y-mount Junction where it connects with the main line of the Welsh Highland Railway.
The railways are part of the Great Little Trains of Wales marketing scheme established in 1970. Since 2021 it is part of the North West Wales Slate Landscape World Heritage Site.