Messi and Helder Postiga each struck two goals in seven first-half minutes as Barcelona maintained their 100 per cent start to the season.
Barcelona manager Gerardo Martino rested Spain midfielder Xavi Hernandez and Chile forward Alexis Sanchez for the match, which took a while to get going, but Dani Alves did not wait long to having a shot despite his effort sailing over the crossbar.
Neymar skipped through the Valencia defence and came close to breaking the deadlock before Messi struck.
Cesc Fabregas collected the ball on the half-way line and set up Messi for the opener after 11 minutes following a lapse of concentration in the home defence.
Messi beat Adil Rami as he continued running towards the Valencia goal, before leaving goalkeeper Diego Alves in a spin on the deck and beating a late challenge from Ricardo Costa to roll the ball into the back of the net with a beautiful close-range finish.
Messi tried to set up Neymar for Barca's second after 17 minutes, but the 21-year-old Brazil striker struck too high and just wide of the post as the away side continued to push forward.
Andres Iniesta collected the ball from Neymar midway through the first half and was close to doubling Barca's lead but his well-timed volley just sailed over the crossbar.
Valencia seemed to be coming back into the game just as Messi doubled Barca's lead at the other end.
The home side lost the ball in midfield as Fabregas claimed possession and set up Messi, who again got past Rami, and - with only Alves to beat - powered the ball into the back of the net.
And the Argentina star claimed his hat-trick minutes later. Neymar picked out Messi in the penalty area, who made no mistake as he slid the ball under Alves.
The home side hit back on the stroke of half-time as Joao Pereira found Postiga in the penalty area, who went down under pressure but managed a magnificent volley from the ground as the ball floated past Valdes to reduce the deficit.
Valencia struck back again with a second goal in quick succession as Ever Banega's corner found the head of Postiga, who beat the Barcelona defence in the air to claim a 3-2 half-time score for Miroslav Djukic's side.
Both sides took a while to get settled in the second half as they searched for more goals and Andres Guardado could have brought the hosts level with a fine effort which veered just wide after 51 minutes.
The away side continued to push forward and Messi again was denied by the safe hands of Alves.
Barca continued to push forward to add a fourth before Djukic made a double substitution, bringing on Sofiane Feghouli and Jonas for Banega and Canales in a tactical bid to pull one back.
It almost worked as Feghouli had a chance seconds later before his effort was blocked by Sergio Busquets.
Messi should have scored Barca's fourth of the night minutes later against the run of play but, after a great solo run, he was denied as his shot narrowly missed the post.
Valencia did not give up and substitute Jonas almost snatched a point but his close-range chance nicked the outside of the post.