The second seed was rarely troubled by the Australian, having to defend just one break point during the match.
The 20-year-old struggled to match Federer early in the match, losing his serve in the first game of the match.
A closer second set saw the Swiss player taken to a tie-break for the first time during the tournament, winning it 7-5.
After the first game, Tomic served well throughout the match, but some nerves late in the third set allowed Federer to go two breaks up, and serve for the match.
The win lines up a last-16 tie against 13th seed Milos Raonic.