The 17-time Grand Slam champion will join Belinda Bencic for Switzerland at the eight-team tournament, which runs from Jan. 1-7.
Federer missed the second half of the 2016 season to fully recover from his knee surgery, which he had last February, and had targeted the Australian Open for his return. His last match was a semifinal loss at Wimbledon, and he did not compete at the Rio Olympics and the US Open.
Nick Kyrgios and Daria Gavrilova will return to defend the title they won this year when they became the first Australians since Mark Philippoussis and Jelena Dokic in 1999 to win the Hopman Cup.
"Australia hadn't won it for a long, long time, so, to be coming back there, it's pretty exciting to be defending the title," Kyrgios said.
Also in the field will be Jack Sock and Coco Vandeweghe from the United States, and Petra Kvitova and Adam Pavlasek from the Czech Republic.