The first settlement in the area was a Roman era estate on a mule track from the Wigger valley toward Vindonissa. This was followed by a small Alamanni camp or settlement. The "Eberkopf" () rock carvings date back to 893 AD, though the modern village of Safenwil is first mentioned in 924 as "Sabenewilare". In the 13th century the village was under the rule Belp. In the 14th century the Ifenthal family ruled over the village from Scherenberg castle. With the conquest of the Aargau in 1415, the village came under the authority of Bern. Under Bernese rule, Safenwil was located in the Lenzburg District. In 1415 Bern took over the high court rights in the village. The low court right was held by Gösgen in Solothurn after 1458. In 1665 this court also went to Bern. In 1803 it became part of the newly formed Canton of Aargau and was assigned to the Zofingen district. School houses were built in Safenwil in 1730, 1829–30, 1908, 1969 and 1999.