Hartley got its start circa 1880, following construction of the Chicago, Milwaukee & St. Paul Railway through that territory. Hartley was named for a railroad official, John Hartley.
Geography
Hartley is located at . According to the United States Census Bureau, the city has a total area of, all land.
As of the census of 2010, there were 1,672 people, 713 households, and 444 families living in the city. The population density was. There were 789 housing units at an average density of 607 per square mile. The racial makeup of the city was 95.8% White, 0.4% Asian, 0.1% American Indian, 1.7% from other races, and 2.0% from two or more races. The city has a 4.4% Hispanic or Latino background. There were 713 households of which 26.8% had children under the age of 18 living with them, 49.8% were married couplesliving together, 8.6% had a female householder with no husband present, 3.9% had a male householder with no wife present, and 37.7% were non-families. 33.8% of all households were made up of individuals living alone and 33.5% had someone living alone who was 65 years of age or older. The average household size was 2.26 and the average family size was 2.89. 26.0% were under the age of 20, 4.4% from 20 to 24, 20.2% from 25 to 44, 27.3% from 45 to 64, and 22.1% were 65 years of age or older. The median age was 44.3 years. For every 100 females, there were 91.3 males. The median income for a household in the city was $40,795, and the median income for a family was $49,286. The per capita income for the city was $19,999. About 11.8% of families and 19.7% of the population were below the poverty line, including 41.1% of those under age 18 and 18.6% of those age 65 or over.
2000 census
As of the census of 2000, there were 1,733 people, 726 households, and 461 families living in the city. The population density was 1,333.1 people per square mile. There were 803 housing units at an average density of 629.3 per square mile. The racial makeup of the city was 96.8% White, 0.8% African American, 0.1% Native American, 0.4% Asian, 0.9% from other races, and 1% from two or more races. Hispanic or Latino of any race were 4.7% of the population. There were 726 households out of which 29.3% had children under the age of 18 living with them, 53.6% were married couples living together, 6.9% had a female householder with no husband present, and 36.5% were non-families. 32.6% of all households were made up of individuals and 18.9% had someone living alone who was 65 years of age or older. The average household size was 2.3 and the average family size was 2.3. 25.2% were under the age of 18, 5.9% from 18 to 24, 26.4% from 25 to 44, 18.5% from 45 to 64, and 24% 65 years of age or older. The median age was 40.1 years. For every 100 females, there were 88.8 males. For every 100 females age 18 and over, there were 84.0 males.
Arts and culture
;Annual cultural events Hartley celebrates a Summerfest Celebration every year during the first weekend in August.
Parks and recreation
;Golfing Meadowbrook Golf & Country Club is a Public 9-hole golf club located 3.5 miles south of Hartley on M12. It was named Iowa's 2003 9-Hole Course of the Year. The city also has three local parks. Neebel which has a public swimming pool, Shinkle and the Hartley-Melvin-Sanborn Elementary School park