Hartley is a single-member electoral district for the South Australian House of Assembly. It is named after John Anderson Hartley, the public servant responsible for creating much of South Australia's public education system. It is a 15.65 km² suburban electorate in Adelaide's northeast, taking in the suburbs of Campbelltown, Hectorville, Magill, Newton, Paradise and Tranmere.
Hartley was created at the electoral redistribution of 1976 as a marginal Labor seat, and was first contested at the 1977 state election by then Deputy Premier Des Corcoran, who had moved from the more marginal seat of Coles after a redistribution erased Labor's majority there. He was succeeded by Terry Groom. The 1991 redistribution erased Groom's majority and made the seat marginally Liberal. Believing this made Hartley unwinnable, Groom tried to gain preselection for a safer seat, only to be turned down. He resigned from the Labor Party and served out the rest of his term as an independent. The seat subsequently fell to Groom's 1989 challenger, Joe Scalzi at the 1993 election amid that year's massive Liberal landslide. Scalzi was nearly defeated at the 1997 election, in which his margin was reduced to a paper-thin 0.7 percent, making Hartley the Liberals' most marginal seat—a status that remained unchanged in 2002 as Labor won government. Scalzi was swept away amidst the landslide Labor victory at the 2006 election, conceding defeat to Labor's Grace Portolesi, and failed to regain the seat at the 2010 election. A redistribution saw Labor's majority reduced from an already-marginal 2.3 percent to a paper-thin 0.1 percent. Liberal Vincent Tarzia defeated Labor's Portolesi at the 2014 election.