Federer, 37 and returning to the tournament for the first time since 2015, was hardly tested as he beat Fognini for the fourth time in four matches. He was fresh after Milos Raonic pulled out injured before their second-round match on Wednesday.
A double break of serve put Federer 4-1 up before Fognini broke back with a backhand winner down the line. Fognini had a chance to pressure Federer in the 10th game when the 20-time Grand Slam champion was 15-40 down on serve.
But Federer, who got through a few difficult situations last week on his way to winning the Swiss Indoors for the ninth time, saved both and then held to clinch the first set.
Federer responded well in the eighth game of the second set, again saving two break points at 15-40 down on his way to leading 5-3. Fognini cracked in the next game and was broken to love, double faulting on match point.
Djokovic is chasing a record-extending fifth Paris Masters title and advanced when Damir Dzumhur retired trailing 6-1, 2-1.
Dzumhur had a lengthy massage on his lower back late in the first set and got loud applause when he carried on playing, but after a few more games, he stopped for good. Djokovic was in total control and did not face a break point, breaking Dzumhur’s serve three times.
Djokovic, who will reclaim the No. 1 ranking next week regardless of where he finishes, faces Marin Cilic in the quarterfinals.
“I’m obviously very proud of the achievement,” said Djokovic, whose ranking slipped to No. 22 in May as he struggled to shake off a persistent elbow problem. “Five months ago, if you told me that (I would be No. 1 now), it was highly improbable at that time considering my ranking and the way I played and felt on the court.”
Although Djokovic leads Cilic 15-3 overall, Cilic won two of their past three matches — including two years ago in the Paris Masters quarterfinals.
“He has a big serve and big game from back of the court. It’s just a very powerful style of tennis,” Djokovic said. “Tough to receive his missiles. You know, first serves are really, really fast, and he uses a lot of rotation and variation with his serve.”
The fifth-seeded Cilic beat ninth-seeded Grigor Dimitrov 7-6 (5), 6-4, needing six set points to win the first set.
Cilic trailed 5-4 during the tiebreaker but won both points on Dimitrov’s serve before serving out the first set.
He started the second set by breaking Dimitrov and was largely in charge after that.
Zverev next faces unseeded Karen Khachanov.
Khachanov slid on his back and stretched out his arms in celebration after prevailing against John Isner 6-4, 6-7 (9), 7-6 (8) in a match in which the eighth-seeded Isner had 19 aces but missed two match points.
Khachanov, who won the Kremlin Cup in Moscow last month, did not face a break point in the 2 1/2-hour match.
The 16th-seeded Sock did not face a break point and broke the Tunisian player’s serve four times.