Williams, who turns 28 in August, will be a depth addition at both guard and tackle for the Bills. He played in all 16 games for the Carolina Panthers last season, starting 12, after missing all but one game in 2018 because of a knee injury suffered in the opening game.
NFL Network was the first to report the agreement with the Bills.
Before his injury in 2018, Williams had been in line for a big contract after a 2017 season in which he started 16 games for the Panthers at right tackle. Pro Football Focus gave the 2015 fourth-round pick out of Oklahoma a grade of 78.0 that ranked third among right tackles in the NFL.
The 6-foot-3, 330-pound tackle has appeared in 56 games with 41 starts in his five seasons with the Panthers.
ESPN’s David Newton contributed to this report.