The 36-year-old has decided to bring an end to his career following a season in which he struggled to hold down a regular place in a QPR side that was relegated from the Premier League.
Ferdinand was absent for the closing stages of the Premier League campaign and his wife, Rebecca Ellison, died after a battle with cancer on May 1.
Ferdinand hailed the “genius” of Sir Alex Ferguson, under whom he won six Premier League titles at Manchester United, as the key factor in his career.
In a statement, he said: “After 18 years as a professional footballer, I now feel it’s the right time for me to retire from the game that I love.
“As a 12-year-old boy, kicking around a football on the Friary Estate in Peckham, I never dreamt that I would play for my boyhood club West Ham, captain Leeds United, win the Champions League with Manchester United, or re-join my
first manager Harry Redknapp at Queens Park Rangers.
“I will always regard the 81 times that I played for England, with immense pride. These are all treasured memories that will last a lifetime.
“Starting a career, every young man needs mentors. I found mine in Dave Goodwin, the district manager at Blackheath, and Tony Carr, the youth team manager at West Ham. They installed in me personality traits that lasted throughout my career. I will always be grateful to them.
“I’d like to thank Chris Ramsey, Harry Redknapp, David O’Leary and David Moyes who managed me at various times in my career, all the backroom staff who looked after me over the years, and the players that I played with. I would also like to thank the team who managed me off the pitch, Jamie Moralee and everybody at New Era.
“Winning trophies over my 13 years at Manchester United allowed me to achieve everything that I desired in football. From a young child to today, that was all I cared about.
“None of that would have been possible, without the genius of one man, Sir Alex Ferguson. His greatest accomplishment in my eyes will always be how he developed us as men, not just as footballers. He will in my opinion, always be the greatest manager in British football history.
“I’d also like to thank and pay tribute to my wife Rebecca and my family, including my mother and father, for their sacrifices, their encouragement and their advice throughout my career.
“And finally, I’d like to thank all the fans from all the clubs – for without them professional football would not exist. I will miss each and every one of you on my Saturday afternoons.”
The former England captain added: “This season I really found out that it was time to hang the boots up and get back in the house and watch other people play the game.”
QPR wished Ferdinand all the best on Twitter saying: “All the best to @rioferdy5 following his retirement from football.”
Gary Neville, who played with Ferdinand for England and the Red Devils many hundreds of times, said: “Congratulations to @rioferdy5 on his great career. Best I played with and best pairings I’ve seen with Vida/JT. Covered me very well too!”
Ferdinand, who started his career at West Ham in 1995, became the most expensive English player when he joined United from Leeds for £29.1m in 2002 and won 81 caps for his country.