Hartley is a city in O'Brien County, Iowa, United States. The population was 1,672 in the 2010 census.
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.
Hartley is located at 43°10′52″N 95°28′37″W (43.181847, -95.476328).
According to the United States Census Bureau, the city has a total area of 1.30 square miles (3.37 km2), 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 1,290/sq mi (497/km2). There were 789 housing units at an average density of 607 per square mile (239/km²). 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 couples living 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.