Tomic declared in the build-up that "it was a good time to play him" but that optimism appeared horribly misplaced as the brash 20-year-old was swatted aside by the Swiss master.
Federer, 11 years his senior, was superior in every element as he secured a place in the last 16 for the 12th successive year.
Tomic required a fast start to back up his bold words but instead it was Federer who struck first, breaking in the opening game.
And the world number two, bidding to become just the second man in history to win this title five times, was rarely threatened on serve despite some breathtaking rallies in which Tomic displayed his immense talent.
Having claimed the opening set, Federer increased the pressure, creating break point chances in the first, third, ninth and 11th games of the second set but he could not find a way through as Tomic, roared on by a partisan crowd, managed to hold on.
And when the world number 43 moved 4-1 up in the tie-break it looked as though he was going to level the match up.
But Federer roared back with Tomic unable to match his levels of intensity.
The Australian had his first break point opportunity at the start of the third but once it came and went the writing was on the wall.
Federer claimed Tomic's serve twice more to move through to a last-16 meeting with Milos Raonic.
"It was a great match, Bernard has had a great run and he got the best out of me tonight [Saturday]," said Federer.
Watch: Federer beats home-hero Tomic... More Videos