Williams, aiming for a third consecutive major title, recovered from a break down in the second set to win six straight games and finish off a 6-1, 6-3 win over Japan's Ayumi Morita in 66 minutes.
The 15-time major winner even surprised herself with another serve at 128 mph (207 kph), matching her career fastest serve she hit earlier in the tournament.
"I tried to hit it really hard. I hit 207 (kph) the other day and I thought it was luck," she said. "But I did it again and I was like 'Whew!' I'm going to try to go for 210. We'll see."
Top-ranked Azarenka struggled to hold off injured American Jamie Hampton 6-4, 4-6, 6-2, and didn't help herself with six double-faults.
Hampton, who needed a medical timeout for a lower back problem before she served out the second set and winced in pain, frequently on the verge of tears, throughout the third, still managed to hit 41 winners to keep the Belarusian under pressure.
Azarenka appeared frustrated at times, but overcame an early break and fended off triple break point in the seventh game of the deciding set before clinching the match in 2 hours, 9 minutes.
"She played incredible, went for every single shot. I felt it was touching every single line," Azarenka said. "She took a medical timeout but she rips winners all over the place and I was like, 'Can I have a back problem?' I'm feeling great, but I'm missing every shot."
After wasting two set points on Azarenka's serve late in the second set, Hampton had to leave the court for nine minutes to have treatment on her back.
Azarenka practiced her backhands and serve while Hampton was in the locker room, but the break didn't help her immediately. Hampton returned and held in the next game and needed more treatment in the break at the end of the set.
Even with the pain of two herniated disks, the 23-year-old Hampton, from Auburn, Ala., went down swinging -- making 47 unforced errors to go with the winners that caught Azarenka off guard and had her asking, loudly at one point, what she could do to counter them.
Sensing an upset, and stirred by the obvious signs of pain, the crowd on Rod Laver Arena got right behind the No. 63-ranked Hampton, who had never previously gone past the second round at a major.
Azarenka had her share of supporters in the stands, too, including friend and musician RedFoo who was wearing a shirt emblazoned with "We Go Hard" across the front.
If results go according to rankings, Azarenka and Williams will meet in the semifinals. Williams has won the Australian Open five times and is on a 19-match winning streak -- and she has lost only one match since her first-round exit at the French Open last year.
Considering Azarenka has lost 11 of their 12 meetings, including all five in 2012, it's a potential matchup where Azarenka will have to play better than ever.
But they both have to advance to the last four, something Williams failed to do here last year when she was knocked out in the fourth round.
In this year's fourth round, the 31-year-old American will meet No. 14 Maria Kirilenko, who beat No. 20 Yanina Wickmayer 7-6 (4), 6-3. Azarenka next plays Elena Vesnina, who beat 16th-seeded Roberta Vinci of Italy 7-6 (4), 6-4.
Two-time major winner Svetlana Kuznetsova advanced with a 6-2, 4-6, 6-3 win over Spain's Carla Suarez Navarro and will next play former No. 1 Caroline Wozniacki, who had a 6-4, 6-3 win over Lesia Tsurenko.
Information from The Associated Press was used in this report.