"Things are looking up on and off the pitch and I'm so happy to be part of it," Williams told the official Swansea website.
"The manager said I was a big part of his plans and wanted me to stay longer.
"I enjoy working with him so it didn't take me long to come to an agreement with the club over this new deal.
"It was a hard first season in the Championship last year, but I think I've learnt and grown a lot as a player since I came here. I've enjoyed my football and now I'm looking to kick on.
"I'm happy with the way I'm playing, but you can always get better.
"It certainly doesn't stop here for me. I need to keep learning off the gaffer and those I'm involved with on the international scene.
"My aim is still to get into the Premier League with Swansea - and sooner rather than later.''