Caldara will spend the next 18 months back on loan at Atalanta, before joining Juve on a deal that runs until 2021.
The centre-back has scored three goals in 11 Serie A games this season.
The Scudetto holder will pay Atalanta an initial $21.2 million, with $8.5 million in bonuses that can be triggered when he is a Juve player and a further $5.6 million that depend on his success back in Bergamo.
Atalanta have surprised many in Serie A this season, sitting sixth in the table in between AC Milan and Inter after half of the campaign.
But that success is coming at a cost, with Inter having swooped for their promising midfielder Roberto Gagliardini and Caldara's long-term future laying elsewhere.
Midfielder Franck Kessie has also been linked with a January exit, though his Africa Cup of Nations duties with Ivory Coast could hold up mooted moves to Chelsea or Manchester United.