The 16-time Grand Slam champion advanced by beating Gael Monfils 6-4, 6-3, 7-6 (7-3), making it five straight-set wins in a row at Roland Garros.
Against Djokovic, Federer will be up against the player who eliminated him from the semifinals at the past two major tournaments.
“He’s been playing fantastic this season, so I know I have to play some of my best tennis,” Federer said. “I have a couple of days to prepare for that and come up with a good game plan.”
The men’s semifinals are scheduled for Friday.
Earlier, Andy Murray completed his darkness-suspended fourth-round match, reaching the quarterfinals with a 4-6, 4-6, 6-3, 6-2, 7-5 win over Viktor Troicki.
On the women’s side, defending champion Francesca Schiavone reached the semifinals by beating Anastasia Pavlyuchenkova 1-6, 7-5, 7-5, and No. 11 Marion Bartoli defeated 2009 champion Svetlana Kuznetsova 7-6 (7-4), 6-4.
He had no such worries this year. Despite losing to Monfils in their previous match in the semifinals of last year’s Paris Masters Federer is 6-1 against him, including two previous wins at the French Open.
“He changes the pace, and he changes the pace so quickly,” Monfils said. “That hurts. He’s the only one almost to hurt you that much, that quickly.”
But things are expected to be a bit trickier in the next round against Djokovic.
The second seed, who advanced to the semifinals when quarterfinal opponent Fabio Fognini withdrew Monday because of a left leg injury, is 41-0 in 2011 and has won 43 straight matches dating to last year’s Davis Cup final.
“Obviously a big question remains: ‘How long can you keep it up?” ‘ Federer said. “I said it a couple weeks ago. It’s just hard day in and day out to be asked the questions, ‘How many more wins can you get?’
“You would just like to, you know, not talk about it. Just go out there and do it over and over again.”