Federer fired 12 aces - his fastest serve registering 131 mph - and never faced a break point against Johnson, who reached 136 on the radar gun and fought off all four break points against him.
Nadal advanced with a 6-3, 7-5 win against 26th-seeded Fernando Verdasco for his 50th career victory at the desert tournament, where he's won three titles but none since 2013.
Five-time Indian Wells winner Novak Djokovic defeated 2013 finalist Juan Martin del Potro 7-5, 4-6, 6-1 and next faces Nick Kyrgios in the same quarter of the draw as Federer and Nadal.
Federer is a four-time champion at Indian Wells who won his last title in 2012. He defeated Nadal in the Australian Open final in January for his record 18th Grand Slam title. Their meeting on Wednesday will be the earliest they have played since their first match in 2004 at Miami, where Nadal won.
Also Read
Johnson held at 6-all to force the second tiebreaker and fell behind 4-2. He broke Federer for a 4-all tie before Federer won on his second match point when Johnson netted a backhand.
Nadal won 80 percent of his first-serve points and three of five break points. Verdasco, who won eight straight points for a 3-2 lead in the second set, had seven double faults.
"It doesn't matter if everybody is playing well because from our part of the draw, only one of us is going to be in that semifinals," Nadal said. "So that's tough, but that's not happening every week. Only thing we can do to avoid that is be in higher position of the ranking."
French Open champion Garbine Muguruza of Spain planned to watch the latest chapter in the Federer-Nadal rivalry.
"I think everybody is going to watch that match," she said. "Everybody likes Rafa. Everybody likes Roger. It's history over there."
"It was so frustrating," Williams said. "But I feel like I got my focus more in that second set and towards the end of the third because I'm just a competitor. If things get closer, then I think my better tennis is going to come."
Williams ended her 15-year boycott of the event last year, when she lost in the second round.
On the men's side, No. 4 seed Kei Nishikori routed 25th-seeded Gilles Muller 6-2, 6-2; American Donald Young defeated 14th-seeded Lucas Pouille 6-4, 1-6, 6-3; No. 15 Nick Kyrgios beat No. 18 Alexander Zverev 6-3, 6-4; and Malek Jaziri got by American wild card Taylor Fritz 6-4, 3-6, 6-3.