Willis' decision to retire was reported earlier Monday by Yahoo! Sports.
According to unconfirmed reports, longtime 49ers defensive lineman Justin Smith also plans to retire Tuesday.
Willis, 30, appeared in just six games in 2014 before undergoing season-ending toe surgery. After being placed on injured reserve in November, he acknowledged that the chronic injury to his left big toe had been hampering him for years.
But Willis made no indication at the time that he was considering retirement, saying he had "five or six years left in my body. ... When I come back, I will be bigger and better than I was."
Willis has played his entire eight-year career in San Francisco and was one of the top players on the 49ers teams that reached three consecutive NFC Championship Games from 2011 to 2013.
He was selected to the Pro Bowl in each of his first seven NFL seasons. The only defensive players since the league's 1970 merger with longer streaks to start their careers were Lawrence Taylor (11) and Derrick Thomas (9).
Smith, 35, has split his 14-year career between San Francisco and the Cincinnati Bengals. The five-time Pro Bowler recorded 87 sacks, including five last season, in 221 career games.
ESPN.com 49ers reporter Paul Gutierrez contributed to this report.