Pfaffenhofen an der Ilm is a municipality in Bavaria, Germany, capital of the district Pfaffenhofen. It is located on the river Ilm, and had a population of 23,282 in 2004.