Glenrothes is a large town situated in the heart of Fife, in east-central Scotland. It is located approximately 30 miles (48 km) from both Edinburgh, which lies to the south and Dundee to the north. The town had an estimated population of 38,750 in 2008, making Glenrothes the third largest settlement in Fife. The town's name comes from its historical link with the Earl of Rothes who owned much of the land upon which the new town was built. "Glen" was added to the name to avoid confusion with Rothes in Moray and in recognition that the town lies in a river valley; Glen being the Scottish word for a valley.