38 appearances, four goals (loan, 2011-2012)
56 appearances, 10 goals (2001-2010)
Liverpool reportedly agreed to pay Cole £3m to remove him from their wage bill. He would have earned around £7m over the final 18 months of his contract, with weekly wages of £92,000 compared with £50,000 at West Ham.
His return to the east London club, where he progressed through the youth ranks, comes after on-loan midfielder Yossi Benayoun returned to Chelsea from the Hammers.
"It's a great move for me. This is where I learnt my trade and I'm happy to have another chance to be here," said Cole.
His former Hammers manager Harry Redknapp had tried to lure the midfielder, who has been capped 56 times by England, to QPR but Cole said it was an easy decision to rejoin West Ham under boss Sam Allardyce.
"Sam didn't have to sell me the club for me to come back," said Cole, who moved to Chelsea for £6.6m in 2003 after West Ham were relegated from the Premier League.
"For me, I have had 18 months at Liverpool where I haven't played much football and Sam wants to play me.
"I'm going to need games to get back to my best, but I want to play football and come here and help the team to make an impact."
Following the move of
18-year-old striker Sean Maguire
from Irish side Waterford United, Cole is Allardyce's second signing of the January transfer window and is set to start in Saturday's FA Cup third-round match.
"Joe's main strength is opening teams up and we'll give him the ball and tell him to go and do that for us," said Allardyce.
"If we can extract the best out of him again, it will be a fantastic signing. He's coming home and it's really great that he chose us."
A product of West Ham's youth academy, Cole signed professional terms in 1998 and helped the Hammers win the FA Youth Cup the following year.
Joe Cole's wonder-goal v Sweden at 2006 World Cup
During his first spell at Upton Park, he played alongside the likes of Paolo Di Canio, Frank Lampard, Michael Carrick and Jermain Defoe, but he moved across London when the club went down.
He won three Premier League titles and the FA Cup twice in a seven-year stay with the Blues.
After failing to agree a new contract he moved to Merseyside but only made six substitute appearances this season.
Cole received a warm reception from fans when returning to West Ham with Liverpool last month, and did not celebrate his goal in the Reds' 3-2 win.
"It was a big thing in me coming back, the fact that everybody here wants me to do well," added Cole, who will again wear the number 26 shirt as he did in his first spell with the Hammers.
"The fans have always been great for me, whenever I have been back and also when I've been in the area visiting family.
"I feel like I owe the club a little bit as well because if it wasn't for West Ham I wouldn't be a footballer. This club's great youth-team coaches taught me the trade.
"Everywhere I go around the world, people love West Ham. People know me for starting here."
West Ham, who were promoted in 2005, relegated six years later and went up again last year, are 11th in the Premier League after 20 games.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.