The top-seeded Federer had to save two break points in the first set on his way to sweeping the first eight games of the match.
Seeking a 10th title at his hometown event, Federer has spent less than two hours combined on court for his two match wins so far this week.
In Friday's quarterfinals, Federer will play fellow Swiss Stan Wawrinka or Francis Tiafoe of the United States, who both had straight-set wins Wednesday.
Wawrinka beat Pablo Cuevas 6-3, 6-4, and Tiafoe won 6-4, 6-2 against Dan Evans.
In a first-round match, sixth-seeded David Goffin won 6-4, 6-4 against unseeded Marin Cilic, the Basel champion in 2016 when Federer was injured. Goffin is currently 10th in the points race to qualify for the eight-man ATP Finals in London next month.
Wild-card entry Alex de Minaur advanced to the quarterfinals by beating 31st-ranked American Taylor Fritz 6-3, 6-3. The 28th-ranked Australian next plays Jan-Lennard Struff of Germany, ensuring at least one unseeded player will be in the semifinals.