The small town lies in the southwest Aargau, in a narrow section of the Aare valley, at the confluence with the Wigger. It lies in the intersection of the most important traffic routes of Switzerland. The dominant landmark is the Aarburg Castle, one of Switzerland's largest castles and a heritage site of national significance. The visual character of Aarburg is shaped by the fortification and the church on a rock spur.
In Roman times a road went by Aarburg, connecting the Olten region with the rest of inner Switzerland. During the construction of a factory in the 20th century, a hoard of coins produced during the reign of Emperor Tetricus I was discovered. The coin hoard was probably buried during the Bagauden Invasions in 284 CE.
When, precisely, the fortress of Aarburg was constructed on the rocky outcropping is unknown. The first time it was documented was in 1123 when it is mentioned as Areburc. At the time it was the property of the Grafen von Frohburg family. From this castle the Bailiwick of Aarburg was governed, what is today the western part of the county of Zofingen, though not the town of Zofigen itself. In 1299 the Frohburgs sold the castle and the Bailiwick of Aarburg to the Habsburg family. The settlement at the foot of the castle was clearly identified as a town in the year 1330. Archeological evidence has shown that the town was probably founded around the year 1312.
Wedged between the cities of Olten and Zofingen, with only four kilometers between them, Aarburg could not develop commercially and remained a small town. The people of Aarburg lived mainly on the tariff revenues that commerce along the Gotthard Pass provided. A small harbor on the river Aare was constructed in 1361. The resulting river boat traffic was of great economic importance until the 16th and 17th centuries.