Federer, the record 17-time Grand Slam title winner, described the 49-year-old as his "childhood hero" and revealed that the Swede will work with him and coach Severin Luthi for 10 weeks starting at the Australian Open.
The 32-year-old becomes the latest star to tap a former Grand Slam title-winning player as coach.
Novak Djokovic hired Boris Becker, a six-time major champion, Richard Gasquet has taken on double French Open winner Sergi Bruguera, Marin Cilic has renewed his partnership with 2001 Wimbledon king Goran Ivanisevic while Kei Nishikori signed up Michael Chang, the 1989 winner at Roland Garros.
Undoubtedly, they are moves inspired by Andy Murray's success with Ivan Lendl, a former world number one and eight-time major winner, which has yielded the 2012 US Open and 2013 Wimbledon titles.
Edberg had been hitting with Federer over the winter as the Swiss gears up for what could be a make-or-break season.
"I am happy to announce that beginning in Melbourne, Stefan Edberg will join Severin Luthi on my coaching team," said Federer, the former world number one whose ranking is now down at six after failing to make a major final for the first time since 2002.
"Severin, who has been part of my team for the last seven years, will do most of the weeks and Stefan has agreed to work with us for at least 10 weeks starting at the Australian Open in Melbourne.
"Stefan was my childhood hero, and I am really looking forward to spending time and learning from him."
Edberg, 47, won the Australian Open in 1985 and 1987, Wimbledon in 1988 and 1990 and back-to-back US Opens in 1991 and 1992.
"I'm really excited to be part of Roger's team and I hope together we can bring out his best tennis," said Edberg.
Federer, who announced on Christmas Eve that he and wife Mirka are to become parents for a third time, split with long-time coach Paul Annacone in October.
Murray tweeted he was delighted to see so many famous faces back in the sport.
"How great is it to have all these legends of the game coaching?! Absolutely loving it..#mycoachis betterthanyoursnanananana," he wrote.
World number two Djokovic, who will be defending his Australian Open in January, brought Becker on board in his search for a crucial mental edge to help him boost his Grand Slam record which has seen six wins but also six heart-breaking defeats.
"We thought about different names. It had to be a person who has been in the particular situation I have been in," Djokovic explained to reporters in Abu Dhabi this week where he has been playing in an exhibition tournament.
"We're not going to make any major changes -- I already feel like I'm a complete player."
The only man not interested in changing is world number one Rafael Nadal who has been coached by his uncle Toni since childhood.
"I will stick to my team. I always feel when I play bad, it is my fault and when I'm winning I'm doing the right things. I had success in my career with the same team," said Nadal.
Federer, whose last Grand Slam title came at Wimbledon in 2012, begins his season next week in Brisbane.
Edberg was immediately congratulated by compatriot Magnus Norman, the 2000 French Open runner-up, who is now coach of world number eight Stanislas
"Edberg and me doing many things alike.. Moved back to Sweden after tennis..Worked in finance..Owns tennis academy.. Now coaching Swiss player," Norman tweeted.
"A few things brings us apart.. He has 6 Grand Slams.. 41 titles..was world number 1 and..over 20 million USD in prize money."