Williams, 31, had five sacks in 2015 and with two years left on his deal, was released before he counted $19.9 million against the salary cap next season. Releasing Williams saves the Bills $12.9 million against the salary cap.
The Dolphins are in the midst of their own cap gymnastics.
Linebacker Koa Misi restructured his contract this week and the Dolphins are likely to exercise a clause in the $114-million, six-year deal defensive tackle Ndamukong Suh signed last March to gain another $12-plus million in cap space. Pass rusher Cameron Wake has resisted a complete overhaul of his contract and, especially if Williams comes on board, is a strong candidate to be released.
The Dolphins used the transition tag on defensive end Olivier Vernon, but they could rescind the tag if Williams joins the team.
Several teams are likely to court Williams, but president Mike Tannenbaum is known to be an aggressive bidder. He went far beyond the next-highest bidder to sign Suh in free agency and is determined to build a strong defensive front around the league's highest-paid defender.