Wide receiver Williams spent three years with the 49ers but was deemed surplus to requirements having lost his starting job earlier this season after three fumbles in the Wembley victory over the Jacksonville Jaguars.
Cornerback Cox, meanwhile, joined the 49ers in 2012 following a year-long stint with the Denver Broncos but failed to make an impact in San Francisco.
"Decisions like these are always difficult, especially at this time of year," Baalke told The AP.
"Kyle and Perrish have represented the 49ers organization very well, both on and off the field. We appreciate their dedication and contributions and wish them all the best."
The 49ers have also activated rookie linebacker Nick Moody.