The 24-year-old will sign a contract with Cardiff when his Manchester United deal expires at the end of June after spending the 2008-09 season on loan.
Bluebirds’ manager Dave Jones said: "I'm pleased that we have secured Tom's services from Manchester United.
"We all know about the lad from his time on loan here and know that we have signed a very talented young player."