The 21-year-old left-back, who was capped by England Under-19s in 2012 and was part of the Blackburn side which reached the FA Youth Cup final that year, was previously under contract until the summer.
But Hanley, who joined Swansea on a free transfer following his release from Blackburn in January 2014 and has been a regular in the club’s under-21 side this season, will now remain at the Liberty Stadium until June 2016.
“I’ve really enjoyed my first full season at the club and I feel as though I have improved as a player,” Hanley told the official Swansea website.
“I want to progress here, and I know there’s a lot of hard work ahead for me.”
Swansea’s only senior left-back is Neil Taylor but the Wales defender is suspended for the next two Premier League games at Leicester and Newcastle after picking up 10 bookings this season.