Sandwich /ˈsændwɪtʃ/ is a town in Barnstable County, Massachusetts, United States. The population was 20,675 at the 2010 census. The Town Hall is located next to the Dexter Grist Mill in the historic district of town.The town motto is Post tot Naufracia Portus. The postal ZIP codes for the town are 02537, 02644, and 02563. It is the oldest town on Cape Cod, turning 375 years old in 2014.