Fort Devens is a census-designated place (CDP) in the towns of Ayer and Shirley, in Middlesex County and Harvard in Worcester County in the U.S. state of Massachusetts. It encompasses the former Fort Devens. The population was 1,017 at the 2000 census.