Hamilton is a town located on Cape Ann in northeastern Massachusetts. The town had a population of 7,764 as of the 2010 US Census.