Ayer is located in Middlesex county Massachusetts with a geographic area of 1.3 square miles. The total population in Ayer is 2,551 with 49.1% male and 50.9% female. Children under age 5 represent 7.1% of the population, under age 18 equal 14.5% of the population and over age 65 is 19.4% of the population. The median household income is $69,688, per capita income is $44,108. There are a total of 1,324 housing units with 49.0% owner occupied. Education includes 18.9% of residents that are high school graduates and 51.3% with a bachelor's degree or higher. The average temperature in Ayer in the summer is 70 degrees, and in the winter 30 degrees.