The town was reputedly founded around 966 AD as Skarðaborg by Thorgis Skarthi, a Viking invader. In the 4th century there had briefly been a Roman signal station on Scarborough headland and there is evidence of much earlier Stone Age and Bronze Age settlements. Scarborough recovered under King Henry II who built a castle on the headland and granted town charters in 1155 and 1163 which permitted a market on the sands.

In the Middle Ages, Scarborough Fair was permitted in a royal charter of 1253 and a six-week trading festival attracted merchants from far and wide. It ran from Assumption Day, 15th August, until Michaelmas Day, 29 September. The fair continued to be held for a further five hundred from the 13th century to 18th century. It is said to be commemorated in the song Scarborough Fair.

Scarborough and it's castle changed hands many times between Royalists and Parliamentarians during The English Civil War in the 1640s, enduring two lengthy and violent sieges. After the civil war much of the town lay in ruins.

Scarborough became Britain's first seaside resort, with visitors travelling great distances to take its mineral waters as long ago as the 1660s. In 1626, Elizabeth Farrow had discovered a stream of acidic water running from one of the cliffs to the South of the town. It was not until around 1734 that the first rolling bathing machine that enabled bathers to retain their modesty whilst taking a dip were noted on the beaches. The coming of the York to Scarborough railway in 1845 increased the number of visitors to Scarborough.