The 32-year-old Republic of Ireland goalkeeper played 28 league games for the Hammers in a two-year spell before departing for Middlesbrough in 2017.
Randolph has signed a three-and-a-half-year contract at the London Stadium and will become West Ham’s fourth senior goalkeeper alongside Roberto, David Martin and first choice Lucasz Fabianski.
Randolph has not played since November 24 as a result of a thigh injury but could go straight into West Ham’s starting line-up for the league game against Everton on Saturday.
Fabianski has battled injury problems this season. The Poland international suffered a hip injury in September that kept him out of action for three months. He suffered a recurrence of the injury shortly after returning to action against Sheffield United last Friday.
In Fabianski’s absence, Roberto failed to convince when given the opportunity while Martin has limited Premier League experience.
After confirming his move back to the London Stadium, Randolph said: "I'm delighted to be back at West Ham.
"I had two great years at the club previously and still have a lot of friends here, so I had no hesitation in coming back.
"West Ham is a massive club, with fantastic supporters and an excellent squad of players. It's a great challenge for me and I am really looking forward to working with the goalkeepers here and helping the team in any way I can.
"This opportunity was simply too good to turn down. It's a great feeling to be back in the Premier League with such a fantastic club and I can't wait to get started."