The fictional city of River City, Iowa in the musical The Music Man is loosely based on Mason City.
According to the United States Census Bureau, the city has a total area of 67.8 km² (26.2 mi²). 66.8 km² (25.8 mi²) of it is land and 1.0 km² (0.4 mi²) of it is water. The total area is 1.45% water.
As of the census of 2000, there are 29,172 people, 12,368 households, and 7,507 families residing in the city. The population density is 436.7/km² (1,131.3/mi²). There are 13,029 housing units at an average density of 195.1/km² (505.3/mi²). The racial makeup of the city is 95.40% White, 1.17% African American, 0.18% Native American, 0.77% Asian, 0.01% Pacific Islander, 1.07% from other races, and 1.40% from two or more races. 3.45% of the population are Hispanic or Latino of any race.
There are 12,368 households out of which 28.4% have children under the age of 18 living with them, 47.4% are married couples living together, 10.3% have a female householder with no husband present, and 39.3% are non-families. 33.5% of all households are made up of individuals and 14.6% have someone living alone who is 65 years of age or older. The average household size is 2.27 and the average family size is 2.90.
In the city the population is spread out with 23.6% under the age of 18, 10.2% from 18 to 24, 26.7% from 25 to 44, 21.7% from 45 to 64, and 17.9% who are 65 years of age or older. The median age is 38 years. For every 100 females there are 90.0 males. For every 100 females age 18 and over, there are 85.8 males.
The median income for a household in the city is $33,852, and the median income for a family is $45,160. Males have a median income of $32,451 versus $21,756 for females. The per capita income for the city is $18,899. 10.0% of the population and 7.2% of families are below the poverty line. Out of the total people living in poverty, 10.9% are under the age of 18 and 10.1% are 65 or older.