The Swiss tennis great, owner of a men's record 20 Grand Slam singles titles, earned $106.3 million (£86.5m) in the last 12 months, including $100 million (£81.3m) via endorsements, to move up four places and become the first player from his sport to top the list.
Cristiano Ronaldo (£85.4m), Messi (£84.6m) and Neymar (£77.6m) and American basketball player LeBron James (£71.2m) rounded out the top five.
Forget: We want to have a French Open with fans
"The coronavirus pandemic triggered salary cuts for soccer stars Messi and Ronaldo, clearing the way for a tennis player to rank as the world's highest-paid athlete for the first time," said Kurt Badenhausen, senior editor at Forbes.
Roger Federer is the perfect pitchman for companies, resulting in an unparalleled endorsement portfolio of blue-chip brands worth $100 million a year for the tennis great.
Japan's Naomi Osaka (£30.4m), who was ranked 29th on the list, surpassed fellow tennis player Serena Williams (£29.3m) as the world's highest-earning female athlete.
Osaka and Williams were the only women on the list.
Football was the next most represented sport with 14 players, followed by tennis (six), boxing and mixed marital arts (five), golf (four), motor racing (three), and baseball and cricket with one each.