Hägendorf is a municipality in the district of Olten in the canton of Solothurn in Switzerland. Hägendorf is first mentioned in 1036 as Hagendorf. In 1102-03 it was mentioned as Haegindorf. Hägendorf has an area, as of 2009, of 13.94 square kilometers. Of this area, 3.7 km² or 26.5% is used for agricultural purposes, while 8.06 km² or 57.8% is forested. Of the rest of the land, 2.1 km² or 15.1% is settled and 0.01 km² or 0.1% is unproductive land.