Dennis is a town in Barnstable County, Massachusetts, United States, near the center of the Cape Cod peninsula. It is a seaside resort town with colonial mansions along the northern Cape Cod Bay coastline and beaches along the southern Nantucket Sound. As of the 2020 census, its population was 14,674.