After being released from West Bromwich Albion as a teenager, Williams played for non-league side Hednesford Town before turning professional at Stockport County in 2003, later becoming their captain.
[9] The defender impressed during his first season at Championship level, eventually going on to be named Wales Footballer of the Year at an FAW awards dinner in November 2009.
[11] Williams was part of a defence that conceded only 37 goals during that campaign, and was selected in the 2009–10 Championship PFA Team of the Year at the end of the season.
[14] The season also saw him equal and surpass a club record of 106 consecutive matches, previously jointly held by Andy Legg and Gilbert Beech.
On 24 September 2011, Williams scored his first ever Premier League goal in a 4–1 loss at Chelsea, after heading in a Mark Gower free kick.
[19] In July 2013, after acting as captain for the majority of Swansea's matches during the previous two seasons, Williams was permanently handed the club captaincy after Monk stepped down from the role.
[26] On 4 April 2017, he was sent-off at Manchester United for handling a goalbound shot by Luke Shaw, from which Zlatan Ibrahimović scored a penalty to equalise in a 1–1 draw.
He was also booked in that match for pushing Lyon goalkeeper Anthony Lopes into an advertising board, prompting a brawl involving both sets of players and Everton supporters.
[42][43] In the match, he played the full 90 minutes for John Toshack's men in their 2–0 friendly away win in Luxembourg, making an early error through a poor backpass to goalkeeper Lewis Price, but recovered possession in time.
[44] On 1 April 2009, Williams scored an own goal in a 2–0 loss to Germany in qualification for the 2010 FIFA World Cup, deflecting Mario Gómez's cross at the Millennium Stadium.
[46] On 11 October 2010, he scored his first international goal in a 5–1 friendly win over Luxembourg in Parc y Scarlets, finishing a header from debutant Steve Morison.
[49] On 1 July in Lille, Williams headed the equalising goal, against Belgium in the quarter-finals as Wales eventually won 3–1 to progress to the semi-finals for the first time in their international football history.
[53] In his time at Hednesford Town, Williams supported himself with various jobs including at a petrol station, as a waiter at Beefeater, and running a sideshow at Drayton Manor.
[53] He is also a patron of Street Football Wales which fights social exclusion, and the Ethan Perkins Trust, which raises funds for research, support and awareness into childhood brain tumours.