Federer will next face Germany's Jan-Lennard Struff, who edged past Croatia's Ivo Karlovic in five sets.
The 36-year-old Federer compiled 48 winners and just 11 unforced errors.
At 4-3, 40-30, Federer hit a 118 miles per hour ace to hold and start his roll that included the last five points he served in the first set, all 20 in the second, and then the first 10 of the third.
"I'm not there yet but expect to get there not only for Wimbledon, but for tournaments in the future".
With flying ants stuck in Wozniacki´s hair and dive-bombing her throughout the match, the former world number one asked the umpire if there was something that could be sprayed to keep the bugs away. "I think that's been helpful, too", he said.
The Australian Open champion went out before the third round for the fourth time in seven years, losing 6-4, 1-6, 7-5 to Ekaterina Makarova of Russian Federation after complaining to the chair umpire about the insects that invaded No. 1 court during the second set.
"It's a wonderful feeling walking out there, I take every match one at a time, I try to put on a good match, try hard every time, and will never underestimate anybody - that keeps me in check".
- Roger Federer on the custom of referring to women players as "Mrs" or "Miss" while men are referenced by their surnames.More news: OnePlus 7 might be a 5G phone released on USA carriers
While Federer and Serena strolled, Caroline Wozniacki suffered fresh Wimbledon woe as the world number two suffered a shock 6-4, 1-6, 7-5 defeat against Ekaterina Makarova.
He will now face Austrian qualifier Dennis Novak, who surprised France's 16th seed Lucas Pouille 6-4, 6-2, 6-7, 3-6, 6-2 today. "From my end, I'm very happy".
"I haven't played her in a while".
Serena Williams was a comfortable 6-1, 6-4 victor over Bulgarian qualifier Viktoriya Tomova in the women's singles as she continues to return to her best after time off to give birth.
"On certain days it goes better than others", Federer said. Williams won the match 6-1, 6-4.
Australia's Nick Kyrgios also advanced in straight sets, beating Dutchman Robin Haase 6-3 6-4 7-5 in 96 minutes.
He said he "felt good" and "less nervous" than he did in his previous match, his first-round win over Dušan Lajović on Monday.
American 10th seed Madison Keys, the 2017 US Open runner-up who also reached the semi-finals at this year's French Open, will be favourite to overcome world number 120 and qualifier Evgeniya Rodina, who has won five matches en route to this stage. Romanian 29th seed Mihaela Buzarnescu thrashed British teenager Katie Swan, 6-0, 6-3 to extend her remarkable renaissance.