The 34-year-old world No.3's appearance at Roland Garros had been in doubt after he missed the Madrid Open with back problems and suffered an early defeat at the Italian Open in the build-up to the claycourt major he won in 2009.
The last time the 17-times grand slam champion was absent from one of the sport's four majors was at the 1999 US Open.
"I regret to announce that I have made the decision not to play in this year's French Open," father of four Federer said in a message posted on Facebook.
"I am still not 100 per cent and 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."
Federer's withdrawal will have a significant impact on the draw as nine-times champion Rafael Nadal, ranked fifth in the world, will now move to fourth seed, while defending champion Stan Wawrinka is bumped up to three.
Spaniard Nadal could have faced world No.1 Novak Djokovic or second seed Andy Murray, as early as the quarter-finals. That scenario has now been avoided.
Federer, who for much of his career has been injury-free, needed a left knee operation after the Australian Open this year, saying afterwards he had torn his meniscus while running a bath for his twin daughters.
Federer, who has been troubled by back problems over the past few years, said he was determined to recover full fitness and prepare for Wimbledon.
"I remain as motivated and excited as ever and my plan is to achieve the highest level of fitness before returning to the ATP World Tour for the upcoming grass court season," said the Swiss, who owns seven Wimbledon titles.
"I am sorry for my fans in Paris, but I very much look forward to returning to Roland Garros in 2017."