Federer, a seven-time champion at the All England Club, has not dropped a set in the tournament through four matches after beating unseeded American Steve Johnson 6-2, 6-3, 7-5 at Centre Court on Monday.
Johnson was making his debut in the fourth round of a major.
The No. 3-seeded Federer hadn't played since Friday, when he was the only man to finish a third-round match. He next faces No. 9 Marin Cilic, the 2009 U.S. Open champion.