Masham was historically a large parish in the North Riding of Yorkshire. As well as the town of Masham the parish included the townships of Burton-on-Yore, Ellingstring, Ellington High and Low, Fearby, Healey with Sutton, Ilton cum Pott and Swinton. In 1866 the townships became separate civil parishes. Masham Moor was an area of moorland to the west of the parish bordering the West Riding, common to the parishes of Masham and East Witton. It was divided between the parishes of Healey, Ilton cum Pott and Colsterdale in 1934. The area of the ancient parish, except Burton-on-Yore, was known as Mashamshire from the 12th century or earlier. St Mary's Church was most likely founded in the seventh century and stood somewhere near the present town hall on what used to be known as Cockpit Hill. The graveyard yielded 36 burials in a recent excavation. The present church — while having some Anglo-Saxon stonework and the stump of an eighth-century prayer cross — is mainly Norman with fifteenth-century additions. Masham was given to York Minster in the medieval period but, as the archbishop did not wish to make the long journey north to oversee the town's affairs, the parish was designated a peculiar. During the Middle Ages, Masham developed as a very small town with milling, mining, cloth making and tanning industries. The town received its first market charter in 1251. Masham's importance as a major sheep market is the reason for the large market place and its Georgian houses. The market originally thrived because of its nearness to Jervaulx and Fountains Abbeys, with their large flocks of sheep. From 1875 the town was served by the Masham branch of the North Eastern Railway. Passenger services were stopped in December 1930 with goods traffic continuing until 1963. The station was across the River Ure at Low Burton. On 5 July 2014 the Tour de France Stage 1 from Leeds to Harrogate passed through the town.
Masham market days are Wednesday, Saturday and Bank Holiday Monday with a Farmers' Market every first Sunday of the month from April to September. An annual Sheep Fair is held in September. The market place, the largest in the district, is tightly bordered on its south and west sides by ranges of two- and three-storey buildings. To the south-east, lies St. Mary's Church with its large yard. Although Masham is a relatively small town it has two working breweries, Black Sheep Brewery and Theakstons, situated only a few hundred yards from one another. The Black Sheep Brewery sponsors annual folk festivals. Previous performers have included Hugh Cornwell of The Stranglers. The town was also for a long time home to Lightfoot Brewery. this was bought by the Theakston family and closed in the 1920s. The Lightfoot brewery buildings are now used by Black Sheep. The Masham Steam Engine & Fair Organ Rally has held annually, organised by the Masham Town Hall Association; it began in 1965 to raise money for the local town hall. The town holds an arts festival every two years.