Born in Assisi in the province of Perugia, Ranocchia started his career at Perugia then in Arezzo. Ranocchia played for Arezzo's Primavera team in 2005–06 season. He made his professional debut with the Arezzo senior side in Serie B under manager Antonio Conte during the 2006–07 season.
In August 2008, Genoa purchased half of the registration rights of Ranocchia for €1.55 million and sent him on loan to Bari, rejoining Arezzo coach Conte, where he won the Serie B Championship, obtaining promotion to Serie A the following season, and forming a promising defensive partnership with fellow emerging Italian centre-back Leonardo Bonucci. On 26 June 2009 Genoa signed him outright for another €2.45 million from Arezzo; Genoa paid €4 million in total for him within a year.
He made his debut with the Italy senior team on 17 November 2010, in a friendly match against Romania, which ended in a 1–1 draw.
Ranocchia was named to Cesare Prandelli's 32 and 25-man provisional squads for UEFA Euro 2012, but was excluded from the final 23-man squad.
Ranocchia was later also included in Prandelli's 30-man provisional squad for the 2014 FIFA World Cup, but not the final 23-man squad.
Ranocchia was appointed as the new Inter captain ahead of the 2014–15 season, replacing the retired Javier Zanetti. On 30 June 2015 Inter announced that Ranocchia agreed to a four-year contract extension, keeping him with the club until 2019. During the 2014–15 season, Ranocchia made a total of 42 appearances and scored two goals, but was replaced as the club's captain by the young striker Mauro Icardi at the end of the season.
On 28 January 2016, Ranocchia moved on loan to Sampdoria from Internazionale.
On 31 January 2017, Ranocchia moved on loan to Hull City until the end of the 2016–17 season. He made his debut the following day when he came off the bench as a 66-minute substitute for Josh Tymon in a 0–0 away draw against Manchester United. He scored his first goal for the club on 1 April 2017 as Hull beat West Ham United 2–1 at the KCOM Stadium.