According to the United States Census Bureau, the town has a total area of , of which is land and , or 4.21%, is water. It is the 250th largest town in the Commonwealth, over seven square miles smaller than the average. Hanson is considered one of the inland towns of Massachusetts's South Shore, and is bordered by Rockland and Hanover to the north, Pembroke to the east, Halifax to the south, East Bridgewater to the west, and Whitman to the northwest. Hanson is located approximately east of Brockton, south of Quincy, and south-southeast of Boston.