The 36-year-old Federer needed only 34 minutes to win the first set, finishing it off with a serve-and-volley victor.
He said on Sky Sports 1: "It feels good, I knew what I had to do today, it was always going to be tough, he is a great champion".
Not since their first encounter in the third round of the Miami Open back in 2004 had Federer and Nadal met so early in a tournament.
Three-time Indian Wells champion Nadal was the first through defeating fellow Spaniard Fernando Verdasco 6-3, 7-5.
The high-profile match-ups keep on coming for Kyrgios, who will face the victor of Rafael Nadal's clash with Australian Open champion Roger Federer.
In a battling second set, Kyrgios couldn't capitalise on scant opportunities to break Djokovic's serve, but he outfought the Serb to win the tie-break 7/2 to power into the quarter-finals.
Five-time Indian Wells victor Novak Djokovic takes on 2013 finalist Juan Martin del Potro at night.
The four-time Indian Wells victor was crafty, too.
Djokovic upped the ante in the second set, but Kyrgios again had all the answers, breezing through the tiebreaker to advance in just under two hours.
The weeding out will start in earnest when Federer meets Nadal in the round of 16 in a reprise of the Australian Open final in January that saw the Swiss star claim an 18th Grand Slam crown.
Nick Kyrgios has withdrawn from his ATP Indian Wells Masters showdown with Roger Federer, blaming food poisoning for a sudden illness that left him unable to play.
"Roger is one of my favourite players of all time", said the 15th seed.
"I was able to hold my serve, and Rafa couldn't find a way to get into my service games more frequently".
Kyrgios beat Federer at their only career meeting in 2015.