Porthmadog (pɔrθˈmædɒɡ; pɔrθˈmadɔɡ), originally Portmadoc until 1974 and locally as "Port", is a coastal town and community in the Eifionydd area of Gwynedd, Wales, and the historic county of Caernarfonshire. It lies east of Criccieth, south-west of Blaenau Ffestiniog, north of Dolgellau and south of Caernarfon. The community population of 4,185 in the 2011 census was put at 4,134 in 2019. It grew in the 19th century as a port for local slate, but as the trade declined, it continued as a shopping and tourism centre, being close to Snowdonia National Park and the Ffestiniog Railway. The 1987 National Eisteddfod was held there. It includes nearby Borth-y-Gest, Morfa Bychan and Tremadog.
Porthmadog came about after William Madocks built a sea wall, the Cob, in 1808–1811 to reclaim much of Traeth Mawr from the sea for farming use. Diversion of the Afon Glaslyn caused it to scour out a new natural harbour deep enough for small ocean-going sailing ships, and the first public wharves appeared in 1825. Quarry companies followed, with wharves along the shore almost to Borth-y-Gest, while slate was carted from Ffestiniog down to quays along the Afon Dwyryd, then boated to Porthmadog for transfer to seagoing vessels.
In the later 19th-century, Porthmadog flourished as a port, its population rising from 885 in 1821 to over 3,000 by 1861. The rapidly growing cities of England needed high-quality roofing slate, which was brought to the new port by tramway from quarries in Ffestiniog and Llanfrothen. The Ffestiniog Railway opened in 1836, followed by the Gorseddau Tramway in 1856 and the Croesor Tramway in 1864. By 1873 over 116,000 tons (117,800 t) were exported through Porthmadog in over a thousand ships. Several shipbuilders were active at this time. They were known particularly for their three-masted schooners called Western Ocean Yachts, the last of which was launched in 1913.
By 1841 the trackway across the reclaimed land had been straightened.