The third seed dropped just four games, winning the last nine on the trot, for a brutal 6-2 6-2 6-0 victory in just an hour and 21 minutes.
If Britain’s Dan Evans was feeling bad about the manner of his third-round defeat to Federer, he can surely take some comfort from the fact he won one more game than Goffin, the 15th seed.
Federer had looked susceptible in his opening two matches, dropping a set in both, but now he is cruising through the gears, motoring towards what looks likely to be another semi-final against Novak Djokovic.
Goffin, who actually broke Federer’s serve early in the first set, won just seven points in the third, the Swiss finishing him off with a stunning backhand pass down the line.
Federer, looking for a 21st grand slam title, said: “David didn’t have his best day, he was struggling.
“I was down in the score early and I was getting to down on myself, but when I got up a break I felt he wasn’t playing the same way I know he can play.
“It was a great day and I’m very happy.”
Federer will face Grigor Dimitrov, the former world number three, in the last eight.
Bulgarian Dimitrov beat Alex De Minaur of Australia in straight sets, 7-5 6-3 6-4.