Thornhill is a town in the region of Dumfries and Galloway, Scotland, south of Sanquhar and north of Dumfries.