Hartley made his Formula One début for Toro Rosso at the 2017 United States Grand Prix, replacing Pierre Gasly, who was absent to take part in the final round of the Japanese Super Formula Championship; he raced with the number 39. He qualified in 17th position after being eliminated during Qualifying 1, but started from 19th position due to engine penalties. He finished the race in 13th position, one lap down on race winner Lewis Hamilton. It was confirmed on 26 October that Hartley would remain a Toro Rosso driver for the remainder of the season, replacing Daniil Kvyat, and he chose 28 (the same number previously used by Will Stevens in 2015) as his permanent race number.