Cranie, who can play at centre-back or right-back, helped the Terriers win promotion last season but has struggled in the current campaign.
The 31-year-old made just two Premier League appearances for David Wagner's side.
He will now have the opportunity to be apart of another promotion push as Tony Pulis' Boro sit just outside the play-off spots.
A very warm welcome to Martin Cranie, who joins #Boro from @htafcdotcom
Full story https://t.co/bb0s9wiZIZ#UTBpic.twitter.com/LojOj4c0k4
— Middlesbrough FC (@Boro) January 31, 2018