Roger Federer's early career

Roger Federer's first ATP Tour-level tournament was the 1998 Gstaad Open, where he faced Lucas Arnold Ker in the round of 32 and lost, 4–6, 4–6. Federer's first final came at the 2000 Marseille Open, where he lost to fellow Swiss Marc Rosset, 6–2, 3–6, 6–7. Federer's first tournament win was at the 2001 Milan Indoor, where he defeated Julien Boutter, 6–4, 6–7, 6–4. The most prestigious finals he contested at this time included the 2002 Miami Masters, where he lost to Andre Agassi, 3–6, 3–6, 6–3, 4–6. Shortly thereafter, Federer won his first Masters Series event at the Hamburg Masters on clay, 6–1, 6–3, 6–4, over Marat Safin.

Federer made ten singles finals between 1998 and 2002, of which he won four and lost six. Federer made six doubles finals during this time, but lost the most prestigious of them at the 2002 Indian Wells Masters. The most prestigious events he won were the Hamburg Masters in 2002 and two Rotterdam 500 series events in 2001 and 2002.

1998: Joining the Tour
In July 1998, the 16-year-old Federer played his first ATP Tour event, the Swiss Open Gstaad, in his home country of Switzerland, losing to No. 88 Lucas Arnold Ker in the first round. Although he played two more ATP tournaments in 1998, the majority of his matches were still at the Junior level. Later that year, he won his first ATP match against Guillaume Raoux in Toulouse. He then received a wildcard into the 1998 Swiss Indoors in his hometown in Basel, where he used to be a ball boy. Having reached the quarterfinal in Toulouse a week earlier, Federer came to Basel as the world No. 396, but lost in the first round to former world No. 1 Andre Agassi. He finished 1998 ranked as the world No. 301.

1999: Grand Slam & Davis Cup debuts, Challenger titles, top 100
In February 1999, Federer reached the quarterfinal of ATP tournaments in Marseille and Rotterdam, defeating the reigning champion of the 1998 French Open, Carlos Moyá, in the former, to enter the Top 150 before the Miami Masters. His rise through the rankings was noticed by the Swiss Davis Cup captain Claudio Mezzadri, who invited him to join the squad for the World Group first round clash against Italy on home soil in Neuchatel. In April 1999, Federer made his Davis Cup debut against Italy, winning the rubber against No. 48 Davide Sanguinetti. In August, Federer won his first-ever professional title on the Challenger tour in Segovia, pairing with Sander Groen to beat Ota Fukárek and Alejandro Hernández in the final, which was played on Federer's 18th birthday.

He then competed in his first Grand Slam tournament at the French Open, but lost to Patrick Rafter in the first round after a four-set match. He also made his first appearance at Wimbledon, where he entered as a wildcard, but lost in the first round to No. 59 Jiří Novák in five sets. In the same tournament, Federer partnered Lleyton Hewitt in doubles, where they reached the round of 16, losing to Rafter and Jonas Björkman in another five-set match. Despite losing in the first rounds of both the French Open and Wimbledon and having just turned 18, he entered the world’s Top 100 for the first time on 20 September 1999. At around that time, Federer was also a part of the Swiss military service, which was mandatory for all able-bodied male citizens when they reached the age of majority, and Federer was drafted in too. However, the then-18-year-old was discharged soon due to a chronic back problem.

In October 1999, Federer reached his first ATP semifinal in the Vienna Open, which he lost to Greg Rusedski. Later that month, Federer won his first and only singles ATP Challenger title in Brest, defeating Max Mirnyi in the final. In his first full year as a professional, Federer finished the year as the world No. 64, and in doing so at 18 years and four months of age, he became the youngest player to end the year among the world’s top 100.

2000: First finals, Olympic 4th place, top 30
On 18 January 2000, the 18-year-old Federer played his first match in the main draw of the Australian Open, defeating former World No. 2 Michael Chang in the opening round to claim his first singles victory at a major event. However, he then lost to no. 49 Arnaud Clément in the third round. He equaled this achievement in his first US Open, losing in the third round to no. 12 Juan Carlos Ferrero. His first singles final came at the Marseille Open in February 2000, where he lost to fellow Swiss Marc Rosset. Federer then entered the Top 50 in March and ended 2000 ranked as the world No. 29. After reaching the semifinals at the 2000 Sydney Olympics, Federer was the runner-up in his home tournament at Basel. Even though he failed to make an impression at Grand Slams, it was the first year he played in all four. Federer then ended the year ranked world no. 29.

2001: Hopman Cup champion, first title, match with Sampras
Federer began the 2001 season by winning the 2001 Hopman Cup representing Switzerland, along with world No. 1 Martina Hingis. The duo defeated the American pair of Monica Seles and Jan-Michael Gambill in the finals. Federer later said that his experience with Hingis "definitely helped me to become the player I am today." In February 2001, Federer won his first ATP tournament after defeating Julien Boutter in the final of the Milan Indoor. During the same month, he won three matches for his country in its 3–2 Davis Cup victory over the United States in front of a home crowd in Basel, thus becoming only the fifth man in history to win every match against the United States, the most successful country in Davis Cup history with 31 titles. The last time a player defeated the United States in every match was in 1976. After a match against Marat Safin at the Rome Masters, in which both players threw their racquets several times, Federer decided to change his temper after watching himself in the highlight reel.

Federer reached his first Grand Slam quarterfinal at the French Open, losing to former world No. 2 and eventual finalist Àlex Corretja. His international breakthrough came at the Wimbledon Championships, when the 19-year-old Federer and the four-time defending champion and all-time Grand Slam leader Pete Sampras walked onto Centre Court for their only meeting in the fourth round. Federer, who was then ranked no. 15, defeated the No. 1 seed in a five-set match to snap Sampras' 31-match win streak at Wimbledon. The defeat was Sampras' first at the All England Club since 1996 and it ended his bid for a record-tying fifth consecutive title. In the quarters he faced Englishman Tim Henman, eventually losing in a fourth-set tiebreaker. Federer then had his best performance at the US Open by reaching the fourth round before falling to Andre Agassi. He finished 2001 with an ATP ranking of No. 13.

2002: Breakthrough and top 10, but Grand Slam struggles
Federer reached his first Masters Series final in 2002 at the 2002 Miami Masters event, where he lost to Andre Agassi. He won his next Masters final in Hamburg, defeating former world No. 1 Marat Safin. This was a major breakthrough for Federer as it was his first Masters championship and his most significant title at the time. He also won both his Davis Cup singles matches against former world No. 1 Russians Safin and Yevgeny Kafelnikov.

After early-round exits at the French Open and Wimbledon, Federer suffered the devastating loss of his long-time Australian coach and mentor, Peter Carter, in a car crash in August. Federer learned of Carter’s death while competing at the Canadian Masters in Toronto and although he had already lost in the first round, Federer was still playing in the doubles tournament partnering with Wayne Ferreira, ironically, a South African. In the third round, which he and Ferreira lost to Joshua Eagle and Sandon Stolle, Federer played the match wearing a black armband in honor of Carter.

Although he suffered first-round losses in the three tournaments he entered after Carter's death, Federer gathered himself together and began playing with more determination than ever. After reaching the fourth round of the US Open, he showed greater consistency by winning the Vienna Open, beating Jiří Novák in the final to win his fourth title of the season, and then reaching the quarterfinals at Madrid and Paris to jump in the rankings from No. 13 at the end of September to No. 7 by early November. This qualified him for the first time for the year-end Tennis Masters Cup, where he won all of his matches in the round-robin stage with the loss of only one set before losing the semifinals to the then-world no. 1 and eventual champion Lleyton Hewitt. At age 21, he ended 2002 ranked as the world No. 6.