The captain's treble took him level with Miroslav Klose as the all-time leading World Cup scorer, with all three goals arriving across a dominant second-half display.
Algeria, back at the tournament for the first time since 2014, held firm for long periods and limited Argentina's openings in the first half.
Messi broke through just after the interval, finishing into the top corner after Rodrigo De Paul slid a pass between two defenders.
He doubled the lead from close range before completing the hat-trick with a curled finish into the bottom corner with 14 minutes remaining.
The performance came on Messi's 200th international appearance, making him the first player to feature at six World Cups.
Argentina coach Lionel Scaloni was withdrawn from praise when asked to assess his captain's display.
"I don't have the words to describe Messi. For 20 years, he's had us used to seeing things like this, and he inspires everyone who watches him play."
Scaloni acknowledged the difficulty of the contest despite the eventual scoreline, pointing to the lingering effect of Argentina's troubled start to the last World Cup.
"We knew we were going to struggle, they're a team that plays well. They did a great job, it was a very difficult match despite the final score."
"The first game is always tough; it affects you in some way. The setback from our first game in Qatar was still on our minds, but this result now gives us peace of mind heading into what's next."
The Argentina coach made wholesale changes through the second half, handing minutes to a number of fringe players as the game opened up.
"The team is happy; we gave playing time to a lot of players. Hopefully we can win the next one so everyone can be in the third group stage match."
Argentina's win moves them onto three points in their group, with Messi's record-equalling display setting the tone for the champions' title defence.
