The 34-year-old former Rangers and Besiktas player will remain with Neil Warnock's side until the end of the season, the Sky Bet Championship club announced.
Cardiff stated: "C ardiff City FC is pleased to confirm that Allan McGregor has signed on loan with the Bluebirds, from Hull City, for the remainder of the 2016/17 season, subject to international clearance."
McGregor made 44 appearances during the Tigers' promotion campaign from the Championship last season, but an injury saw him sit out the play-offs
He ended up being sidelined until November and since returning to fitness he has been unable to move up in the pecking order ahead of Eldin Jakupovic and fellow Scot David Marshall, who joined Hull from Cardiff in August.
McGregor, who has made 35 appearances for his country, could go straight into the Bluebirds team for Saturday's league meeting with Burton.
Source : PA