Bayern were without several injured players, including leading striker Harry Kane, goalkeeper Manuel Neuer, Serge Gnabry, Ismael Saibari and Jamal Musiala. They also lost stand-in keeper Jonas Urbig after he suffered a blow to the head, but still produced their best performance in weeks.
The Bavarians, without a win in their previous three games in all competitions, took control with three goals inside the opening 22 minutes.
Michael Olise, who was back from injury along with Luis Diaz, opened the scoring after two minutes, before captain Joshua Kimmich curled the ball into the net directly from a corner.
Pavlovic added another goal before Kevin Sessa cut the deficit in first-half stoppage time after a Dayot Upamecano error.
Any thoughts, however, of a Hertha comeback were quickly dashed when substitute Tom Bischof rifled home to make it 4-1 in the 67th minute.
Pavlovic struck again from similar range 15 minutes later before the Germany international completed his hat-trick in stoppage time.
Bayern will be joined in the last eight by Stuttgart, Holstein Kiel and Darmstadt, who all also claimed wins within 90 minutes against Dynamo Dresden, Borussia Monchengladbach and Koln respectively.

