The 20-time Grand Slam winner recorded $106.3 million in pre-tax earnings, edging out Ronaldo, who is in second place by about $1 million.
Federer jumped four positions, rising from fifth place in the 2019 Forbes list. He is the first tennis player to top the annual list, having made more than $100 million in endorsement deals.
The 38-year-old works with more than 13 brands and companies, including Japanese clothing line Uniqlo, German car giant Mercedes-Benz, and French fine winery Moet & Chandon.
Ronaldo and Messi also managed to break the $100 million mark, having annual earnings of $105 million and $104 million respectively.
Brazil striker Neymar is fourth with $95.5 million, while NBA star LeBron James is fifth on the Forbes list, on $88.2 million.