Williams, who has said she is 'evolving away from tennis' herself, said he was an inspiration, BBC reported.
Djokovic praised the "decade of incredible moments and battles".
Federer, 41, will end a career that featured 20 Grand Slam singles titles after the Laver Cup, which begins in London on 23 September.
"You inspired countless millions and millions of people – including me – and we will never forget," said Williams, who played against the Swiss star only once on court, facing off in a mixed doubles match at the Hopman Cup in 2019.
"Welcome to the retirement club. And thank you for being you.
"I have always looked up to you and admired you. I applaud you and look forward to all that you do in the future."
Djokovic, who has faced Federer on 50 occasions since 2006 on the ATP Tour, also posted an emotional tribute on Instagram.
"It's hard to see this day and put into words all that we've shared in this sport together," said the 21-time Grand Slam winner.
"Over a decade of incredible moments and battles to think back on, your career has set the tone for what it means to achieve excellence and lead with integrity and poise. It's an honour to know you on and off court, and for many more years to come."
Federer's decision to retire from the sport after three years blighted by knee injuries has prompted a wave of tributes.
His great rival Rafael Nadal – the only other player, along with Djokovic, with more Grand Slam singles titles than Federer – said it was "a sad day" for sport.
Federer's appeal extended to legends of other sports.
Argentina and Paris St-Germain forward Lionel Messi described Federer as a "genius".
"Unique in tennis history and a role model for any sportsman," said the 35-year-old.
"I wish you the best in your new stage. We will miss seeing you on the court."