World number one Nadal defeated Indian qualifier Somdev Devvarman 7-5, 6-4 while 16-time major winner Federer also faced a stubborn opponent in American Ryan Harrison before he pulled off a 7-6 (7/4), 6-3 win.
Reigning Australian Open champion Djokovic stretched his win streak to 17 by crushing doubles partner, and Davis Cup winning teammate, Viktor Troicki 6-0, 6-1.
Nadal, who is recovering from a left thigh injury that caused him to take a month off earlier this year, wrapped-up his two-hour match with a running cross-court forehand winner.
"I played really badly, especially in the beginning," Nadal said. "After that I improved a little bit. I played much better in the second set but it wasn't perfect."
Devvarman, who made the final in Johannesburg last month, earned the respect of Nadal and the main stadium crowd which gave him several ovations.
"All matches are different for sure," Nadal said. "He (Somdev) did well. He is a good player."
Devvarman, who is the first Indian player to reach the fourth round at this desert venue, said he felt comfortable on centre court.
"I was pleased with the way I competed. I wasn't over-awed by the situation or the guy I was playing against," Devvarman said.
"It was a great experience to play the No. 1 player in the world and in one of the biggest stadiums in the world."
Nadal advances to the last eight where he will face hard-serving Croatian Ivo Karlovic who beat Albert Montanes of Spain 7-6 (9/7), 6-2.
Federer hammered 10 aces and hit numerous thundering forehands against the 18-year-old Harrison to set-up a quarter-final clash against Swiss countryman Stanislas Wawrinka.
But before they get down to business in singles the Davis Cup teammates have a doubles match to play together on Thursday.
"We have to play doubles before we play singles," Federer said. "We have already been kidding around about this. We are going to serve each other in the back."
Djokovic, who has only lost six games through three matches, clinched victory over Troicki with a backhand winner down the line and now has 17 successive wins, a run dating back to last year's Davis Cup final.
"I have been playing the best tennis of my life in the last three months," Djokovic said. "It all started with my Davis Cup wins."
The Serbian duo had a short rest before heading off to one of the outer courts to play doubles where they lost 6-1, 7-6 (7/5) to Rohan Bopanna of India and Pakistan's Aisam-Ul-Haq Qureshi.
In the quarter-finals, Djokovic will face Frenchman Richard Gasquet, who defeated eighth-seeded Andy Roddick 6-3, 7-6 (7/5).
"It feels incredible for me to be in the quarter-finals," said Gasquet.
It was a frustrating loss for Roddick, who was runner-up in Indian Wells last year.
In the tiebreaker, Roddick hurled his racquet across the court and argued several times with umpire Fergus Murphy and at one stage barked: "I am giving you a warning".
Asked why he gave Murphy a warning, Roddick replied, "because he gave me a warning. I feel like with the mistakes he made, it's only fair that I would give him a warning, as well.
"I only made one mistake. I only broke one racquet. He missed a couple of calls, so I feel like it was a little presumptuous of him to give me a warning off one broken racquet."
Short link: