The 35-year-old, who won World Cups as a centre with the All Blacks in 2011 and 2015 and was a second-row in the New Zealand team who reached the 2013 Rugby League World Cup final at Old Trafford, revealed the news on Twitter.
Williams’ last appearance was for Sydney Roosters last October as part of a short-term stint following Toronto Wolfpack’s withdrawal from their first season in Super League.
He was still under contract for 2021 after the Canadian outfit made him the most expensive signing in either code with a two-year £5m deal.
However, after just five games with them, he was left without a club when the financially-troubled Wolfpack were refused re-entry into the competition.
It was a sad end to a remarkable career that included 58 caps for the All Blacks and a Super Rugby title with the Chiefs in 2012 as well as two NRL titles with the Roosters (2013) and Canterbury Bulldogs (2004).
But, during that time, Williams also ventured into boxing - something he now plans to revisit - where he won all seven of his professional heavyweight bouts.
Former Melbourne Storm, Hull KR, Castleford Tigers and Bradford Bulls centre Webster, who is currently with League 1 club Keighley Cougars, played alongside Williams for the Kiwis in 2007 and was a regular opponent in the NRL.
He said: “There’s not many who have done what Sonny Bill’s done in sport, let alone rugby league.
“Everything he has touched he’s dominated and I don’t think there’s anything he hasn’t won.
“Football’s the only thing he didn’t have a go at and he’d probably have been good at that, too!
“He’s just one of those freak athletes that you get once a generation where everything they touch turns to gold.”
Williams wrote in a tweet: “A massive thank you to the public and fans for all the support over years.
“To my many team-mates, thanks for the lessons and help along the way.
“It wasn’t a perfect journey, but the lessons have helped shape me into the man I’m proud to be off the field today.”
Webster, 37, hopes he pushes on with his boxing career after building a gym in southern Sydney.
“He’s had so many things going on before so he probably hasn’t been able to put everything he wanted into it,” he said, with Williams’ last professional fight being in 2015.
“But now he can: he’s got the physique, he’s strong, fit and I’d like to see where he can take that.”
It is the second legendary former team-mate of Webster’s to retire in as many days after Melbourne hooker Cameron Smith, the 37-year-old former Queensland State of Origin and Australia captain.
Webster is playing on this term and joked: “I don’t know about still going strong but I’m still going.
“I dropped down a league and then another league but Cam Smith carried on right to the end at the very top.
“He’s also proved that you don’t need to be big, you don’t need to be strong; he’s just one of the smartest around and probably the best rugby league player to ever grace the field.
“I was there at the start of his career and to see where he has gone and what he has done is amazing.
“Cam debuted the season before me (2002) but me and Billy (Slater) debuted the same year (2003) and then Cooper Cronk the year after so my claim to fame is I was around at the start of the Big Three!”