Sandwich is a town in Barnstable County, Massachusetts, United States. The population was 20,136 at the 2000 census. The Town Hall is located right next to the Dexter Grist Mill, in the historic district of town. The town motto is Post tea Naufracia Portu (Latin for after so many shipwrecks a haven). For more geographic and demographic information on specific parts of the town of Sandwich, please see the articles on East Sandwich, Forestdale, and Sandwich (CDP). The postal ZIP codes for the town are 02537, 02644, and 02563, respectively.