Historically, most of the town was in Cheshire, but the area to the north of the Mersey was in Lancashire. Stockport in the 16th century was a small town entirely on the south bank of the Mersey, and known for the cultivation of hemp and manufacture of rope. In the 18th century the town had one of the first mechanised silk factories in the British Isles. However, Stockport's predominant industries of the 19th century were the cotton and allied industries. Stockport was also at the centre of the country's hatting industry, which by 1884 was exporting more than six million hats a year; the last hat works in Stockport closed in 1997.
Dominating the western approaches to the town is the Stockport Viaduct. Built in 1840, the viaduct's 27 brick arches carry the mainline railways from Manchester to Birmingham and London over the River Mersey. This structure featured as the background in many paintings by L. S. Lowry.
Stockport was recorded as "Stokeport" in 1170. The currently accepted etymology is Old English port, a market place, with stoc, a hamlet (but more accurately a minor settlement within an estate); hence, a market place at a hamlet. Older derivations include stock, a stockaded place or castle, with port, a wood, hence a castle in a wood. The castle probably refers to Stockport Castle, a 12th-century motte-and-bailey first mentioned in 1173.
Other derivations are based on early variants such as Stopford and Stockford. There is evidence that a ford across the Mersey existed at the foot of Bridge Street Brow. Stopford retains a use in the adjectival form, Stopfordian, for Stockport-related items, and pupils of Stockport Grammar School style themselves Stopfordians. By contrast, former pupils of Stockport School are known as Old Stoconians. Stopfordian is used as the general term, or demonym used for people from Stockport, much as someone from London would be a Londoner.
Stockport has never been a sea or river port as the Mersey is not navigable here; in the centre of Stockport it has been culverted and the main shopping street, Merseyway, built above it.