The Swiss three-time champion was in irresistible form early, crushing Anderson 6-0 6-4 in just 85 minutes in their last-eight clash.
Federer had won five of his six meetings with Anderson and he was in control from the outset against the South African sixth seed.
The 20-time grand slam champion, who finished with 13 winners and 12 unforced errors, will face Denis Shapovalov in the semi-finals after the Canadian overcame Frances Tiafoe.
Federer made a flying start as he cruised into a 3-0 lead, putting on an early show.
His incredible form was best illustrated to start the fifth game, Federer making reflex volleys before a backhand winner down the line.
The set was over in 27 minutes, a backhand volley winner sealing the opener for Federer.
A ruthless Federer broke again to start the second set, Anderson sending a backhand long after a lengthy opening game.
Anderson finally got on the board in the ninth game of the match and then broke back with a cross-court backhand winner to make it 3-3.
However, Anderson's revival was short-lived, Federer taking his sixth break point of a 14-minute ninth game before closing out victory.