Federer, who missed the French Open due to a back problem, fired 15 aces en route to setting up a last 16 encounter with Tunisia's Malek Jaziri.
Second seed Kei Nishikori's title bid at the Wimbledon warm-up tournament ended in the second round after he pulled out with a rib injury before his second round match against Germany's Florian Mayer.
"I'm very sad to not be able to go on playing," Japan's Nishikori, who needed treatment during his first-round win against Lucas Pouille, told the Halle tournament's official website.
Nishikori said he was confident the injury would improve before the start of Wimbledon on June 27.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
(Reporting by Pritha Sarkar, editing by Ken Ferris)
