Charleston is the most populous city in the U.S. state of South Carolina, the county seat of Charleston County, and the principal city in the Charleston metropolitan area. The city lies just south of the geographical midpoint of South Carolina's coastline on Charleston Harbor, an inlet of the Atlantic Ocean formed by the confluence of the Ashley, Cooper, and Wando rivers. Charleston had a population of 150,277 at the 2020 census. The 2020 population of the Charleston metropolitan area, comprising Berkeley, Charleston, and Dorchester counties, was 799,636 residents. It ranks as the third-largest metropolitan statistical area in the state, the 8th-largest in the Deep South and the 74th-largest in the United States.