Heidenheim an der Brenz (short: Heidenheim, Alemannic German: "Hoidna" or "Hoirna") is a town in Baden-Württemberg in southern Germany. It is located on the border with Bavaria, approximately 17 km south of Aalen and 33 km north of Ulm. Heidenheim is the largest town and the seat of the district of Heidenheim, and ranks third behind Aalen and Schwäbisch Gmünd in size among the towns in the region of East Württemberg. Heidenheim is the economic center for all the communities in Heidenheim district and is the headquarters of the Voith industrial company. The town's population passed the 20,000 mark in 1925. Heidenheim collaborates with the town of Nattheim in administrative matters.