Federer returns to the top spot despite not having played since March.
Former world No. 1 Novak Djokovic slipped six places to 18th after his second round defeat in Madrid, his lowest ranking since October 2006.
READ: Kvitova up two places to 8th in WTA rankings
Madrid winner Alexander Zverev remains in third, but the man he beat in Sunday’s final, Dominic Thiem, dropped a place to eighth despite knocking out Nadal on his way to facing Zverev.
Thiem saw off Kevin Anderson in the semi-finals and it is the South African who inherits his seventh spot, the 31-year-old’s highest ever ranking.
The highest mover in the men’s charts is Madrid semi-finalist Denis Shapovalov with the Russian teenager jumping 14 rungs to a best ever 29th.