Andretti was born in Montona, Istria โ then part of the Kingdom of Italy, now Motovun in Croatia โ to an Istrian-Italian family. He was born six hours before his twin brother Aldo. After the Second World War, the Treaty of Paris transferred Istria to communist-controlled Yugoslavia, and the Andretti family joined the Istrian-Dalmatian exodus in 1948, losing their 2,100-acre farm and spending seven years as refugees in a dormitory camp in Lucca, Italy. The twins were introduced to motor racing while in Lucca, attending the 1954 Mille Miglia and visiting Monza for the Italian Grand Prix. Alberto Ascari became Andretti's personal idol after seeing him race. The family emigrated to the United States in 1955 and settled in Nazareth, Pennsylvania, where Alvise Andretti's brother-in-law lived. Andretti became a naturalized US citizen in 1965.
Discovering that Nazareth hosted a half-mile dirt track, the twins refurbished a 1948 Hudson using money earned at their uncle's filling station, with a stolen beer barrel serving as a fuel tank. Falsifying their driving licences to meet the minimum age of 21, both entered competition. From 1960 to 1961, Mario won 21 of 46 modified stock car races. Their father did not discover they were racing until Aldo fractured his skull and spent 62 days in a coma; Aldo resumed racing but suffered a career-ending accident in 1969. Mario progressed through the ranks to USAC Championship Car racing in 1964, winning back-to-back USAC titles in 1965 and 1966 and finishing runner-up in 1967 and 1968. He also won the Daytona 500 in 1967 with Holman-Moody and took his first major sportscar win at the 12 Hours of Sebring that year with Ford.
Andretti made his Formula One debut at the 1968 United States Grand Prix with Lotus, qualifying on pole position. He contested further Grands Prix with Lotus in 1969 while also winning his third USAC title and the Indianapolis 500 that year. A first podium came at the 1970 Spanish Grand Prix driving a privateer March 701. He joined Ferrari later in 1970, winning at Sebring again. Andretti took his maiden Formula One victory at the 1971 South African Grand Prix on his Ferrari debut.
After part-time appearances for Ferrari and Parnelli in 1972 and 1974, Andretti joined Parnelli full-time for 1975. He returned to Lotus in 1976, winning the Japanese Grand Prix at the season's end and contributing to development of the ground-effect Lotus 78. In 1977 he secured four race victories and finished third in the championship. His 1978 season, also with Lotus, brought six victories and the World Drivers' Championship title, making him the second American to win the title. Winless seasons followed with Lotus in 1979 and 1980, and he moved to Alfa Romeo in 1981. He made two further appearances in 1982 as a fill-in driver for Williams and Ferrari before retiring from Formula One with 12 wins, 18 pole positions, 10 fastest laps, and 19 podiums across 14 seasons.
Andretti returned to full-time IndyCar racing in 1982 with Patrick, finishing third in the standings and winning the Michigan 500. A third-place finish again followed with Newman-Haas in 1983. In 1984, fifteen years after his third title, he claimed a fourth IndyCar championship โ his first sanctioned by CART. He won the Pocono 500 in 1986 and remained with Newman-Haas until 1994. His victory at Phoenix in 1993 made him the oldest IndyCar race winner in history at age 53 and the first driver to win a race in four different decades. He retired from IndyCar with 52 wins, 65 pole positions, and 141 podiums.
Andretti's 111 official victories across disciplines made his name synonymous with speed in American popular culture. He was inducted into the International Motorsports Hall of Fame in 2000. His son Michael won the CART title in 1991 and later founded Andretti Global. Andretti serves on the board of directors of Cadillac in Formula One from the team's entry into the championship in 2026.