The England international spent last season on loan with the Hammers, where he scored seven goals in 24 games.
After revealing earlier in the day that the forward was due to undergo a medical on Wednesday, Hammers chairman David Gold wrote on his social media account: "We managed to bring Andy's medical forward to this evening and I am delighted to inform you that he has passed with flying colours."
Carroll had been suffering from a heel problem which forced him to miss the recent England friendlies with Republic of Ireland and Brazil, and there were fears he could be out of action for up to four months.
But West Ham boss Sam Allardyce revealed at the weekend a deal to bring the player to east London on a permanent contract was close.
And the 24-year-old is expected to secure a six-year contract, with Liverpool receiving around £15m for the player.
Allardyce had previously expressed concerns about the size of the financial package involved in bringing in Carroll permanently.
However, he confirmed earlier this month that finalising a move for the striker is his priority before turning his attention to other transfer targets.
"Our first priority is signing Andy Carroll, if we can," said Allardyce.
"We have nearly finished our planning for pre-season and the players have all had their training programmes given to them so when they come back on 1st July they are ready to go.
"Then it's about the recruitment of the other players who we want as quickly as possible. That will be the most difficult part of the summer."
West Ham have already agreed deals to sign Spanish goalkeeper Adrian and Romania captain Razvan Rat on free transfers.