St. Marys is located at (30.756264, -81.571287).
According to the United States Census Bureau, the city has a total area of 20.3 square miles (52.6 km²), of which, 18.8 square miles (48.6 km²) of it is land and 1.5 square miles (4.0 km²) of it (7.54%) is water.
The closest major city is Jacksonville, Florida (39.8 miles south).
There were 4,837 households out of which 47.8% had children under the age of 18 living with them, 59.8% were married couples living together, 14.2% had a female householder with no husband present, and 22.3% were non-families. 16.8% of all households were made up of individuals and 2.9% had someone living alone who was 65 years of age or older. The average household size was 2.83 and the average family size was 3.18.
In the city the population was spread out with 33.4% under the age of 18, 11.2% from 18 to 24, 34.7% from 25 to 44, 15.6% from 45 to 64, and 5.2% who were 65 years of age or older. The median age was 28 years. For every 100 females there were 97.8 males. For every 100 females age 18 and over, there were 95.3 males.
The median income for a household in the city was $42,087, and the median income for a family was $46,065. Males had a median income of $35,419 versus $24,449 for females. The per capita income for the city was $18,099. About 9.6% of families and 11.2% of the population were below the poverty line, including 14.5% of those under age 18 and 7.1% of those age 65 or over.