The 26-year-old has spent the last three seasons at Motherwell but will formally join City on 1 July after his contract with the SPL club expires.
"It feels brilliant to be a Birmingham City player," Randolph told Birmingham's official website. "I'm just happy to get it all done and I'm looking forward to getting started.
"I wanted to come here because of the size of the club. The manager wants to achieve things at this club and after speaking to him I was sold.
"I've proven myself in the SPL and now it's time that I came down here and did the same in the Championship."
Randolph began his senior career at Charlton Athletic before heading north after a series of loan spells in July 2010.
In 136 Motherwell appearances Randolph kept 46 clean sheets, including a club record 19 in the 2010/11 season.
Randolph told Motherwell's webiste: "Following three fantastic years at Motherwell, I wanted to put on record my sincerest thanks to the staff and fans at Fir Park for their great support during my stay at the club.
"With my contract due to expire at the end of the month, and after discussing my future with close friends and family, it now feels like the right time to seek a fresh challenge.
"I will be taking some great memories with me and hope that I will still be welcomed back to the club in the future."