Afflalo declined an $8 million option for next season; Williams declined a $4.6 million option.
With Afflalo and Williams opting out, the club could have close to $30 million in available cap space this summer.
That number would increase to $34 million if the Knicks renounced their other free agents.
Afflalo, 30, averaged 12.8 points on 44 percent shooting last season. He played primarily as a starter but was relegated to a reserve role late in the season under interim coach Kurt Rambis. Afflalo had said in April that he still believed he could be a starter in the NBA and that belief would factor into his free-agency decision.
Williams, 25, averaged 9.3 points in 18 minutes per game in a reserve role.
With the salary cap rising from $70 million in 2015-16 to $94 million in the coming season, many players with player options for 2016-17 are expected to decline their options and test the market.
The Knicks likely will have close to $12 million more in cap space this summer thanks to Afflalo's and Williams' decisions to decline their options.
The club hopes to upgrade its backcourt this offseason via trade or free agency. On the trade front, the Knicks recently had internal discussions about potentially acquiring Chicago Bulls guard Derrick Rose via trade, sources say. Potential backcourt upgrades in free agency include Mike Conley and Rajon Rondo.
The deadline for Afflalo and Williams to decide on their options is Wednesday. Afflalo's decision to opt out was first reported by Sheridan Hoops.