Fourth seed Stan Wawrinka, fifth seed Kei Nishikori and seventh seed Marin Cilic all needed five sets to keep their hopes alive against less celebrated opponents.
Federer, making his first competitive outing for six months following a knee injury, overcame a second-set wobble to defeat Austrian Jurgen Melzer 7-5, 3-6, 6-2, 6-2.
The Swiss 35-year-old is seeking to add to his 17 grand slam titles but has not made the final of a Major since 2015. He faces American youngster Noah Rubin next.
“Any match is a good match, even if I had lost, because I’m back on the court,” Federer said. “Last year was tough but it is nice to be playing normal tennis again. It was a long road but I made it.”
Wawrinka, who won his first grand slam at the Australian Open three years ago, emerged from a rollercoaster three-hour contest with Slovakia’s Martin Klizan 4-6, 6-4, 7-5, 4-6, 6-4. The Swiss meets American Steve Johnson in round two.
Nishikori, who has never been past the last eight in Melbourne, set up a clash with Frenchman Jeremy Chardy with a gruelling 5-7, 6-1, 6-4, 6-7 (6-8), 6-2 win over Russia’s Andrey Kuznetsov.
Former US Open winner Cilic, who faces Britain’s Dan Evans in the second round, had to fight back from two sets behind to beat Poland’s Jerzy Janowicz 4-6, 4-6, 6-2, 6-2, 6-3.
Controversial home hope Nick Kyrgios swept past Portugal’s Gastao Elias 6-1, 6-2, 6-2 before rising to Federer’s assertion that he was still not ready to win a first grand slam.
“It doesn’t bother me at all,” Kyrgios said. “I know he’s the greatest of all time. I know I just want to do my own thing. I played him once, I beat him once.”