Bonnyrigg is a town located in Midlothian, Scotland. It is situated eight miles southeast of the Edinburgh city centre, positioned between the Rivers North and South Esk.
The town serves as the most populous town in Midlothian. Its geographical boundaries include the adjacent settlement of Lasswade, Polton village, the Poltonhall housing estate, and modern development at Hopefield. Bonnyrigg maintains a twin town relationship with Saint-Cyr-l'École, France.