After the first leg victory, the reds killed the game with three goals in the opening 20 minutes.
Emre Can’s deflected shot put them ahead before Mohamed Salah reacted quickest to slot in a rebound off the post.
Can finished Roberto Firmino’s cross at the back post 143 seconds later before Hoffenheim substitute Mark Uth, introduced after 24 minutes in a tactical reshuffle, pulled one back.
Firmino wrapped the tie up sliding the ball into the bottom corner after Jordan Henderson dispossessed opposing captain Kevin Vogt before unselfishly squaring.
The German side, who finished fourth in the Bundesliga last season, did not lose their spirit and pulled another back when Sandro Wagner headed in Andrej Kramaric’s left-wing cross.
The Reds, along with Chelsea, Tottenham, Manchester City and Manchester United will discover their group-stage opponents when the Champions League draw is made on Thursday (17:00 BST).