Fifth seed Nadal defeated fellow Spaniard Fernando Verdasco 6-3 7-5, while ninth seed Federer served impeccably to get past American Stevie Johnson 7-6(3) 7-6(4) and book the 36th showdown of their famous rivalry.
The last time they met, Switzerland’s Federer claimed a record 18th grand slam title in a rousing 6-4 3-6 6-1 3-6 6-3 triumph over Nadal in Melbourne in January.
Federer, 35, lost only five points on his first serve in his double tie-breaker win over Johnson in a match completed without a service break.
Fourteen-times grand slam winner Nadal, 30, was comfortable as usual in the California desert, dismissing compatriot Verdasco to keep his Round of 16 date with the Swiss maestro.
It was the 50th win at the Indian Wells Tennis Garden for Nadal, who has lifted the trophy three times, in 2007 (over Novak Djokovic), 2009 (Andy Murray) and 2013 (Juan Martin del Potro).
“History says that this tournament works well for me,” Nadal, who holds a 23-12 winning record over Federer, told reporters.
Federer has also enjoyed his time at Indian Wells, winning four times with the last triumph coming in 2012.
Three-time defending champion Novak Djokovic also had reason to celebrate as the second seed ran off the last five games to overcome big-hitting Juan Martin del Potro 7-5 4-6 6-1 in a bottom half of the draw stacked full of top players.
“It was definitely difficult to overcome this challenge tonight,” Djokovic said. “The third set was probably the best tennis that I played this year and I’m just glad I was able to pick up my game.”
The victory gave Djokovic a chance for revenge as he next meets young Australian Nick Kyrgios, who defeated the Serb at this month’s Mexican Open on his way to the semi-finals.
Kyrgios prevailed 6-3 6-4 over Alexander Zverev in an entertaining first tour-level meeting between the young guns.
A controlled Kyrgios put on a masterful display, mixing strong serving with an array of showman shots to beat Germany’s 19-year-old Zverev, a friend from their junior tennis days.
“I thought I just competed well,” Kyrgios, 21, said. “He’s got a big game. I was happy with my performance.”
Fourth seed Kei Nishikori of Japan also cruised into the fourth round with a 6-2 6-2 rout of Gilles Muller of Luxembourg.
Muller, who won his first ATP World Tour title in Sydney at the start of the year, made only 49 percent of his first serves and Nishikori broke him four times.
Nishikori next faces American Donald Young, who needed seven match points to complete a 6-4 1-6 6-3 victory over 14th-seeded Frenchman Lucas Pouille.
American Jack Sock joined the Round of 16 by knocking out Grigor Dimitrov of Bulgaria, edging a third-set tie-breaker to advance 3-6 6-3 7-6(7).