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.
On 1 July 2010, he moved back to Genoa. After a link with Inter in February 2010, the clubs agreed a deal in June 2010 which involved the transfer of young striker Mattia Destro. The transfer became official on 20 July 2010, which Inter signed half of the registration rights of Ranocchia for €6.5 million and sent Destro on loan to Genoa with option to sign him in co-ownership deal (who later purchased outright for €4.5 million). Ranocchia also loaned back to Genoa for a season.
On 27 December 2010, Internazionale bought the remaining 50% registration rights of Ranocchia from Genoa for €12.5 million, valuing him at €19 million in total, which was later confirmed by Genoa chairman Enrico Preziosi who expressed his delight at doing business with Inter. The chairman of Inter, Massimo Moratti, spoke on the transfer to Sky Italia and said: "Finally an Italian. We had kept an eye on him from before. It is our project to go ahead with young players." On 9 January 2011, Ranocchia made his Inter debut in a 2–1 win over Catania. He made his Champions League debut against Bayern Munich in the first leg of the Round of 16; Inter eventually progressed to the quarter-finals where they were eliminated by eventual semi-finalists Schalke 04. Ranocchia completed his first season with Inter by attaining a second-place finish in Serie A, also winning the 2010–11 Coppa Italia; the following season, however, Inter lost out to Serie A Champions and cross-city rivals Milan in the 2011 Supercoppa Italiana Final.
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.
At the end of season, Ranocchia returned to Inter. He was part of the squad in the first day of pre-season training.
On 21 August 2007 he made his debut with the Italy U21 squad in a friendly match against France, replacing Fabiano Santacroce. He took part at the 2009 U-21 Championship, where the Italy under-21 side reached the semi-finals, only to be defeated by eventual champions Germany.
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 has been described as a large, strong, and physically imposing centre back, with good tactical knowledge and concentration, as well as an ability to read the game and time his tackles well. He has predominantly drawn praise for his aerial ability, making him a goal threat from set pieces, and former Inter centre back Marco Materazzi has described Ranocchia as his heir due to his own aerial prowess. A former attacking midfielder, he is also known for being comfortable in possession due to his solid technique and reliable distribution, which has led him to be compared to Alessandro Nesta. Regarded as one of the most promising Italian defenders of his generation in his youth, former Inter full-back and captain Javier Zanetti has also praised Ranocchia for his leadership, which eventually saw him inherit the role of club captain. In recent seasons, however, Ranocchia has drawn criticism due to his decision making and proneness to errors when under pressure, as well as his lack of pace, as his fitness has been affected by several injuries.As of 21 May 2017
As of 29 March 2016
Serie B: 2008–09
Coppa Italia: 2010–11
Armando Picchi Award: 2010–11
Serie A Team of the Year (1): 2010–11