Federer, 38, outclassed Serbia's Filip Krajinovic 6-1, 6-4, 6-1 to maintain his bid for a seventh Australian Open and 21st Grand Slam title, BBC Sport reported.
The Swiss wrapped up victory in 92 minutes at Melbourne Park.
Djokovic, who won his seventh Australian Open last year, dismissed Japanese wildcard Tatsuma Ito 6-1, 6-4, 6-2 in 95 minutes.
The 32-year-old Serb, chasing a 17th Grand Slam title, faces Japan's Yoshihito Nishioka next after he knocked out British number one Dan Evans in straight sets.
Federer will face Australia's John Millman, who he lost to at the US Open in 2018.
The third seed is competing at Melbourne Park for a 21st consecutive year and has reached at least the last 32 on every occasion.
"I'm very happy, it's a great start to the season," he said.
"I'm feeling really relaxed out on court. You train hard and you hope it pays off."
Meanwhile, sixth seed Stefanos Tsitsipas did not even have to hit a ball to reach the last 32 after opponent Philipp Kohlschreiber withdrew injured.
Serena Williams admitted she was frustrated and not at her best as she fought off a stubborn Tamara Zidansek to reach the third round on Wednesday.
The American great, one short of Australian Margaret Court's all-time record of 24 Grand Slam titles, faces China's 27th seed Wang Qiang next in Melbourne.
The 38-year-old Williams was never in serious trouble against the 70th-ranked Slovenian Zidansek, winning 6-2, 6-3 at Rod Laver Arena.
But the eighth seed was restrained in her celebrations and said, "It was a good match for me, she was a really good fighter, she did not just let me win."
Coco Gauff is still learning to drive and was scared when she went on a highway – but the 15-year-old warned Naomi Osaka she will not be overawed when they clash on Friday at the Australian Open.
The American prodigy celebrated wildly after fighting back to defeat Romania's Sorana Cirstea 4-6, 6-3, 7-5 on Wednesday and set up a mouthwatering third-round meeting with the reigning champion.
It is a repeat of the US Open last year, where Japan's Osaka – a relative veteran at age 22 – defeated the fast-rising Gauff in straight sets.
"I think I'll be less nervous this time. I think US Open I was nervous," said Gauff, playing only her third Grand Slam but touted as a long-term successor to idol Serena Williams at the top of women's tennis.
"We're both familiar with each other's games. She plays really aggressive. This time coming in I'm going to be more aggressive."
Osaka, meanwhile, conceded she had been "a bit childish" after her frustrations boiled over on Wednesday.
The Japanese handled the blustery Melbourne conditions to defeat China's 42nd-ranked Zheng Saisai 6-2, 6-4.
But the 22-year-old Japanese was irritated by Zheng's defensive play and her emotions got the better of her when the Chinese broke early in the second set.
Osaka threw her racquet to the floor, then gave it a kick for good measure.
The two-time Grand Slam champion also tossed away a ball and slammed the racquet down again as she slumped to her chair, covering her head with her towel.
"My racquet just magically flew out of my hand," Osaka said mischievously, smiling.
"I couldn't control it, I think that's how I dealt with my frustration.
"It was a bit childish. I just want to play one match without throwing my racquet or kicking it. That's all I want."
Elsewhere, world number one Ashleigh Barty made light of windy conditions to reach the third round in front of an adoring home crowd on Wednesday.
The French Open champion took just 66 minutes to dismantle Slovenia's Polona Hercog, winning 6-1, 6-4 without dropping any service games at Rod Laver Arena.
"A clean match today – I'm really happy to get out of that one," said Barty, who needed three sets to see off Lesia Tsurenko in the first round.