Leonberg is a town in the German state of Baden-Württemberg. It is about 10 mi (16 km) to the west of Stuttgart, the state capital. About 45,000 people live there, which makes it the third-largest town in the district of Böblingen, after Sindelfingen and Böblingen.