The resurgent 30-year-old Swiss came from a set down to beat Tomas Berdych in the Madrid final on Sunday, a fourth title of the year and a third in the Spanish capital that put him level on 20 Masters crowns with great rival Nadal.
Success in one of the upcoming grand slams could catapult him above Novak Djokovic to number one, a position he last held in May 2010, and he would then equal, and almost certainly break, his idol Pete Sampras's record of 286 weeks at the top.
A buoyant Federer told a news conference that would be "absolutely amazing".
"Back then I was just trying to stay world number one and I never really looked at Pete's record that much," he said.
"I guess I could have chased it a few years ago, just really trying to beat that record," added the 16-times grand slam singles champion.
"It's no secret for any player out there that you'd rather be number one than number two.
"But I look at the long term, maybe if I wasn't good enough to break that record then maybe I never will be."
Before Madrid, Federer had not played for six weeks since losing to Andy Roddick in Miami, deciding he needed some time away from tennis to recharge his batteries and rid himself of one or two niggling injuries.
He has played some of his best tennis in years in winning his four titles this year, including the Indian Wells Masters, and will bid for a second French Open crown in Paris starting later this month after his triumph in 2009, which was also the year he last won in Madrid.
"I don't need to beat every record Pete set, he's my idol after all and I'm just happy I'm that close already," Federer said.
"But it's exciting times ahead for me. Winning so many tournaments and playing so well obviously I do believe I can win the grand slams.
"But I know the difficulty of the French Open and the focus will be a lot on Novak because he's going for four in a row and on Rafa because he's the defending champion. It's going to be an exciting tournament."
Federer said equalling Nadal's record of Masters titles was not such a big deal for him given that the series has only been running for a relatively short time.
"That one for me is just a number at the moment," he said.
"It's amazing how many Rafa has got in such a short time and it's nice to win another one," he said.
"I have won three of the last four now and it's been a great streak and that's what I look at."