Barty took just 25 minutes to dismantle the Slovenian's serve and take the first set 6-1 on Rod Laver Arena.
Match highlights of Barty's clash with Hercog
- Watch all courts and all matches of the Australian Open live on Eurosport and Eurosport Player
- Australian Open 2020 order of play
- Australian Open 2020 LIVE!
Sabalenka downs world number one Barty to claim Madrid crown
But the world number one tailed off in the second set and was forced into saving two crucial break points.
Hercog caused the French Open champion a few problems on her serve, but the home favourite found the vital breakthrough to break at 4-4 and sealed the win when the Slovenian was unable to keep a backhand return in the court.
Barty: More important things than tennis right now
Barty will face 29th seed Elena Rybakina of Kazakhstan, who was the other WTA title winner along with Barty in the final week of warm-ups for Melbourne Park when she won in Hobart.
"I think for me it's about doing what I do best regardless of whether it's a first round, third round, or a final," said Barty.
"It doesn't really matter for me what round it is. I'm still going out there trying to do the same thing essentially."
A victory on Friday would move her past the third round at Melbourne Park for only the second time in seven attempts, which would boost local excitement around her campaign.
Barty has earned plaudits for her level-headed attitude throughout her meteoric rise to the top and she illustrated it once again when asked whether an Australian champion would be fitting after the bushfire crisis.
"Honestly, there are so many bigger things going on in Australia right now. I don't think anyone could care less if an Aussie wins it or not," she said.
"First and foremost, it's about the safety and the well-being of Aussies all across the nation, of wildlife, everything.
I'd prioritise the safety and kind of rebuilding parts of our nation that have been destroyed over a tennis match any day of the week.
Barty eases past Kvitova to reach Madrid Open semi-finals
Barty solves Swiatek challenge to underline status as Roland-Garros favourite