Hamilton is a rural-suburban town in the eastern central portion of Essex County in eastern Massachusetts, United States. At the 2010 census, it had a population of 7,764.