Phoenix Suns (2016–2018)
On March 8, 2016, Williams signed a 10-day contract with the Phoenix Suns. He made his NBA debut on March 17 during a 103–69 loss to the Utah Jazz, recording one point and one steal in two minutes. The following day, he signed a multi-year deal with the Suns. On April 9, he recorded a then season-high seven rebounds in a 121–100 win over the New Orleans Pelicans. In the Suns' season finale on April 13, Williams recorded his first double-double in the NBA with season highs of 14 points and 12 rebounds (alongside 3 blocks) in a 114–105 win over the Los Angeles Clippers.
With the Suns' Summer League team in 2016, Williams was the only player to average a double-double throughout the event, averaging 11.8 points and a league-leading 11.2 rebounds over six games, which earned him All-NBA Summer League First Team honors. On September 1, 2016, his contract for the 2016–17 season was fully guaranteed by the Suns. On November 18, 2016, he had a season-best game with 15 points and 15 rebounds in a 116–96 win over the Indiana Pacers. On December 14, he was assigned to the Northern Arizona Suns of the NBA Development League. He was recalled the next day. On February 10, 2017, he had 14 points and 11 rebounds to go with a season-high four blocks in a 115–97 win over the Chicago Bulls. With Tyson Chandler sustaining an injury early in the game and Alex Len missing the game with a suspension, Williams made the most of his 24 minutes on the court. On February 24, 2017, he scored a then season-high 16 points on 8-of-9 shooting in 15 minutes off the bench in a 128–121 overtime loss to the Chicago Bulls. Two days later, he scored a career-high 17 points and tied his career high with 15 rebounds in a 100–96 loss to the Milwaukee Bucks, becoming just the 10th NBA player with multiple 15/15 games in his first 35 career games in the past 19 seasons. On March 5, Williams had 11 points and matched his career best with 15 rebounds in a 109–106 win over the Boston Celtics. On March 9, he had 16 points and 10 rebounds for his fifth straight double-double off the bench in a 122–110 loss to the Los Angeles Lakers. He became the first player in Suns history with five straight double-doubles off the bench. On April 5, 2017, he scored 16 and grabbed a career-best 17 rebounds in a 120–111 loss to the Golden State Warriors.
On July 26, 2017, Williams re-signed with the Suns to a multi-year contract. On September 25, 2017, he was ruled out for six months after undergoing a meniscus repair of his right knee. On March 15, 2018, he was assigned to the Northern Arizona Suns. He was recalled on March 16, reassigned on March 20, and recalled again on March 25. On March 26, he made his season debut for Phoenix against the Boston Celtics. In 16 minutes off the bench, he recorded three points and five rebounds in a 102–94 loss.
On July 2, 2018, Williams was waived by the Suns.