Federer moved up following his title in the Madrid Open Sunday.
No 1-ranked Novak Djokovic and Nadal met in the finals of the in Madrid in 2011 but this year Djokovic went out in the quarterfinals' and Nadal lost in the third round. Both expressed displeasure with the new blue clay court in Madrid and said they won't be back in 2013 if the blue clay is retained.
Federer, who beat Tomas Berdych 3-6, 7-5, 7-5 in the final, said, "If you want to be a good clay-court player, you must be able to play everywhere."
The Swiss star's win tied him with Nadal with 20 Masters championships and allowed him to pass the Spaniard in the rankings. Federer is No. 2 for the first time in 14 months. He's nearly two years removed from the last time he was No. 1.
Nadal hasn't been as low as third in the rankings since May 10, 2010.
Djokovic has 11,200 rankings points and is No. 1 for a 47th consecutive week. Federer has 9,430 points followed by Nadal at 9,105. No. 4 Andy Murray (7,500) completes the top tier of the rankings.
Jo-Wilfried Tsonga comes in fifth with 4,930 points while David Ferrer is sixth with 4,460 and Berdych (4,410) stays seventh. Janko Tipsarevic (3,090) is eighth and Juan Martin del Potro goes from 11th to No. 9 with 2,970. John Isner (2,725) remains 10th but Mardy Fish (2,660) falls from ninth to 11th.
The entire Top 10 is in the field for this week's Italian Open. Djokovic beat Nadal in the 2011 final in Rome.