The Wales international’s previous deal was set to expire at the end of the season.
Swansea manager Brendan Rodgers said: “Joe is fantastic. He is a player who at a lot of clubs would not be deemed big enough or strong enough.
“I was aware of his talent (before joining Swansea last summer), but, while he is not at the same level, he is that Xavi or Iniesta type of player.
“He is 5ft 7in, not physically tall or great in stature but he is brilliant on the ball, has great intelligence and good mobility.
“For me it was vital for the likes of him and Neil Taylor to re-sign, they feel I am a manager that can work with young players and these boys are big signings for us.
“Joe is a wonderful talent and I am delighted he has signed.”