At Andretti's first Indianapolis 500, in 1965, he met Colin Chapman, owner of the Lotus Formula One team, who was running eventual race winner Jim Clark's car. Andretti told Chapman of his ambition to compete in Formula One and was told "When you're ready, call me." By 1968 Andretti felt he was ready. Chapman gave him a car, and the young American took the pole position on his debut at the 1968 United States Grand Prix at Watkins Glen in his Lotus 49.
Andretti drove sporadically in Formula One over the next four years for Lotus, March, and Ferrari, while continuing to focus on his racing career in America. At the 1971 South African Grand Prix, on his debut for Ferrari, he won his first Grand Prix. Three weeks later, at the non-championship Questor Grand Prix in the U.S., he brought the Italian team a second victory.
It wasn't until 1975 that Andretti drove a full Formula One season, for the American Parnelli team. The team was new to Formula One, although it had been successful in both Formula 5000 and IndyCar racing in America with Andretti driving. The team had run Andretti in the two North American end-of-season races in 1974 with promising results. Andretti qualified fourth and led the 1975 Spanish Grand Prix for nine laps before his suspension failed. He scored five championship points in the season. Andretti continued to compete in IndyCar, missing two Formula One races in the middle of the season to do so.
When the Parnelli team pulled out of Formula One after two races of the 1976 season, Andretti returned to Chapman's Lotus team, for whom he had already driven at the season-opening Brazilian Grand Prix.
(1976 British Grand Prix - Niki Lauda Ferrari 312 leads, James Hunt McLaren M23 with Mario Andretti Lotus 77 and Clay Regazzoni Ferrari 312) Lotus was then at a low point, having failed to produce a competitive car to replace 1970's Lotus 72. Andretti's ability at developing a racing car contributed to Lotus' return to the front of the Formula One grid, culminating in lapping the field in his victory at the season ending race at the Mount Fuji circuit in Japan. Since mid-1975 Lotus had been developing the use of ground effect, shaping the underside of the car to generate downforce with little penalizing drag. For his part, Andretti worked at setting up his cars for the races, exploiting subtle differences in tire size and suspension set up on each side of the car to optimize it for each track, an approach imported from his extensive oval racing experience in the United States. In 1977, at Long Beach, he became the only American to win the United States Grand Prix West, and the last American as of 2014 to win any US Grand Prix. The Lotus 78 "wing car" proved to be the most competitive car of 1977, but despite winning four races, more than any other driver, reliability problems and collisions with other drivers meant Andretti finished only third in the championship. The following year, the Lotus 79 exploited ground effect even further and Andretti took the title with six wins. He clinched the championship at the Italian Grand Prix. There was no championship celebration because his teammate and close friend Ronnie Peterson crashed heavily at the start of the race, was hospitalised and died that night from complications resulting from his injuries.
Mario Andretti - Grand Prix of Canada, October 8, 1978
Andretti would find little success after 1978 in Formula One, he failed to win another grand prix. He had a difficult year in 1979, as the new Lotus 80 was not competitive, and the team had to rely on the Lotus 79 which had been overtaken by the second generation of ground effect cars. In 1980, he was paired with the young Italian Elio de Angelis, and briefly with test driver Nigel Mansell, but the team was again unsuccessful.
Andretti had an unsuccessful 1981 with the Alfa Romeo team. Like other drivers of the period he did not like the ground effect cars of the time: "the cars were getting absurd, really crude, with no suspension movement whatever. It was toggle switch driving with no need for any kind of delicacy...it made leaving Formula One a lot easier than it would have been."
The next year Andretti raced once for the Williams team, after their driver Carlos Reutemann suddenly quit, before replacing the seriously injured Didier Pironi at Ferrari for the last two races of the year. Suspension failure dropped him out of the last race of the season, but at the Italian Grand Prix at Monza he took the pole position and finished third in the race.