Middlesex Township is a township located in Cumberland County, Pennsylvania, United States. As of the 2010 census, the township had a total population of 7,040.