Hartley prepped at Carroll High School in Southlake, Texas, where he was coached by former North Texas coach Todd Dodge. He set a state record with 90 PAT's in 2002. Coming out of Carroll, Hartley was rated as the 2nd best placekicker in the country, by Rivals.com.
College career
Hartley began his college career at Oklahoma in 2004. He spent most of his first season redshirted, but after inconsistent play from Trey Dicarlo, head coach Bob Stoops decided to pull Hartley's redshirt and start him. He only played in three games during his abbreviated first season and finished 1-for-1 on field goals and 12-for-12 on extra points with his only field goal coming in the 2005 BCS National Championship Game. Hartley struggled during his sophomore year, missing eight of his 22 field goal attempts despite making two field goals from beyond 50 yards. He went 37 of 38 in extra points attempts. Hartley broke out during his junior season going 19-for-20 in field goals and 49-for-50 in extra points. Hartley's.950 field goal percentage was among the highest during the season and earned him a nomination for the Lou Groza Award which goes to the nation's best placekicker. Hartley's only miss of the season came during a controversial loss to Oregon when a 44-yard kick was blocked after Hartley had already successfully made four field goals. Hartley's senior season did not quite match the level of performance of the year before. He finished going 13-for-15 in field goals and 71-for-77 in extra points.
Professional career
Denver Broncos
Hartley was not drafted during the 2008 NFL draft but he signed as a free agent with the Denver Broncos. However, he was released on July 21 just before the start of training camp.
New Orleans Saints
Hartley was signed by the New Orleans Saints on October 29, 2008 to replace Taylor Mehlhaff, who was released. He played in his first game on November 9, 2008 against the Atlanta Falcons. Hartley came out strong, booting 13 for 13 field goal attempts for the 2008 season. He was expected to be the Saints starting kicker for the 2009 season. However, Hartley was given a 4-game suspension after testing positive for a banned stimulant, Adderall. Hartley remained inactive until the Saints' twelfth game of the season, against the Washington Redskins. Hartley then kicked four field goals, including the game winning kick in overtime that allowed the Saints to preserve their undefeated record. He missed the first field goal of his professional career in this game, from 58 yards. He held the NFL record for most consecutive field goals made to start a career, with 16 until the record was broken in 2012 by Kai Forbath of the Washington Redskins. On January 24, 2010, he made a 40-yard field goal in overtime against the Minnesota Vikings in the NFC Championship game to send the New Orleans Saints to their first Super Bowl. He continued in Super Bowl XLIV, going 3-for-3 with field goals of 46, 44, and 47 yards. He became the first kicker in Super Bowl history to convert three field goals of 40 yards or more. The 2010 season began erratically for Hartley. He missed 2 field goal attempts in the Saints' Week 1 home win over Minnesota, then made 3 kicks despite windy conditions in a Week 2 win at San Francisco. In a Week 3 match with Atlanta, he made a last-second field goal to send the game into overtime, but then missed a 29-yard field goal attempt in overtime that would have won the game. In response, the Saints re-signed John Carney, and Hartley was inactive for the next 2 games. With injuries mounting at other positions, however, the Saints decided not to continue carrying 2 kickers, cutting Carney and returning Hartley to his starting position. He later signed a contract extension that was reported to make him the highest paid kicker in the game. Hartley missed the entire 2011 season after injuring his hip during a preseason game. He was replaced by veteran John Kasay. He returned as the Saints' kicker in 2012 and 2013 season, but struggled with intermittent bouts of inconsistency. After he missed two field goals against the St. Louis Rams on Sunday, December 15, 2013, one of which was attempted from only 26 yards, he was released by the Saints on December 17, 2013 and replaced by veteran kicker Shayne Graham the same day.
Cleveland Browns
On December 13, 2014, Hartley was signed by the Cleveland Browns to replace Billy Cundiff, who had injured his knee. He was active as the Browns' placekicker for their next game, against Cincinnati, but he did not actually have an opportunity to play in the game, because the opening kickoff was handled by Browns punter Spencer Lanning and the Browns never had another kicking opportunity as they failed to score in a 30–0 loss. Hartley was waived by the Browns on March 11, 2015.
Pittsburgh Steelers
On August 11, 2015, Hartley was signed by the Pittsburgh Steelers to replace Shaun Suisham, who had torn his ACL. On August 29, 2015, Hartley suffered a pulled hamstring during a preseason game against the Buffalo Bills. On August 31, 2015, Hartley was placed on injured reserve. On October 13, he was released by the Steelers.
Hartley signed with the Seattle Dragons of the XFL on January 24, 2020. He was waived on January 28 after failing to receive medical clearance, as he has an artificial disk in his neck and not a fusion.