The 34-year-old did not play in the Madrid Open earlier this month after hurting his back during practice for the tournament.
Federer returned for the Italian Open but was beaten in the third round by Dominic Thiem.
"I have been making steady progress, but I am still not 100%," said the world number three.
"I feel I might be taking an unnecessary risk by playing in this event before I am really ready.
"This decision was not easy to make, but I took it to ensure I could play the remainder of the season and help to extend the rest of my career."
It means Federer will miss a Grand Slam for the first time this century.
The Swiss has struggled with injury this year, having undergone knee surgery after January's Australian Open.
The former world number one returned for the Monte Carlo Masters in April and reached the quarter-finals, where he was beaten by Jo-Wilfried Tsonga.
Federer, winner of the 2009 French Open, has played in just four events in 2016.
Roger Federer has withdrawn from this year's French Open after failing to recover from a back injury.