The former England captain, who turned 38 earlier this month, will quit at the top days after helping Paris St Germain to their first French championship in 19 years.
That made him the first Englishman to win titles in four different countries, and PSG were keen to hold on to the midfielder beyond the end of his short-term contract.
But Beckham has instead opted to follow his old mentor Sir Alex Ferguson into retirement, calling a halt to a senior career which began with a Manchester United debut in a League Cup tie at Brighton on September 23 1992.
His final appearance is likely to come for PSG away at Lorient on May 26.
He said: "I'm thankful to PSG for giving me the opportunity to continue but I feel now is the right time to finish my career, playing at the highest level.
"If you had told me as a young boy I would have played for and won trophies with my boyhood club Manchester United, proudly captained and played for my country over one hundred times and lined up for some of the biggest clubs in the world, I would have told you it was a fantasy. I'm fortunate to have realised those dreams."
Beckham won six Premier League titles, two FA Cups and a Champions League with United, where he was voted PFA Young Player of the Year in 1997.
Glenn Hoddle gave him an England debut in September 1996, and he survived the fall-out from an infamous red card at the 1998 World Cup to become his country's most-capped outfield player, 59 of 115 appearances coming as skipper.
Beckham left Old Trafford for Real Madrid in the summer of 2003 and won the Liga title in the last of his four seasons in Spain before signing for LA Galaxy, where he was twice an MLS Cup winner.
He spent two loan spells in Italy with Milan and made a final move to Paris in January this year.
Beckham joined Sky as an ambassador for sport earlier this year and has also spent time promoting football in China.
He said: "Nothing will ever completely replace playing the game I love, however I feel like I'm starting a new adventure and I'm genuinely excited about what lies ahead.
"I'm fortunate to have been given many opportunities throughout my career and now I feel it's my time to give back."
Beckham spoke to his former teammate Gary Neville - an interview you can watch on Sky Sports News from 5pm on Thursday - with Neville saying: "I think he just feels it's the right time. It's been a huge week in terms of retirements. Last week there was Ferguson and Paul Scholes - huge figures in English football over the last 20 years. And now we have another globally influential figure retiring. Beckham feels he's taken football as far as he can.
"He played in the greatest midfield I've ever played with: David, Ryan Giggs, Roy Keane and Scholes. David was a crosser of the ball, a passer of the ball. He had incredible stamina and energy. He was a joy to play with. "
Former England manager Steve McClaren hailed Beckham as a great of the modern game.
McClaren dropped Beckham when he inherited the England job from Sven-Goran Eriksson in 2006 before giving him a recall and said: "He was a great player. He made the very most of his talents through sheer hard work and professionalism and always doing extra work on the training field.
"He inspired his team-mates through his performances.
"He was a winner, he's won so many things in his career, and that was infectious on his team-mates.
"And he was an inspiring personality to young players with his behaviour and professionalism on and off the field.
"But ultimately he was a leader and people followed him.
"The young players followed him in how he played and in his personality, and even off the field the young players of today are following him through his fashion."
Another England manager Roy Hodgson added his tribute and said: "I wish him well in the future whatever he chooses to do and I personally hope that will be in football.
"David is a man of many talents and a lot of people now will be wanting him for different jobs and roles, some of which could take him away from us in football. But I'm rather hoping we'll be able to keep him in football because we can really benefit from his experience, we can really benefit from his charisma and we certainly benefit from the magnificent past he has had as a football player.
"In David Beckham England have a very big fan and a very great supporter.''
FA chairman David Bernstein added: "In the week following Sir Alex Ferguson retiring, which came as a bit of a shock, now we have the iconic David Beckham coming out of the game. It's unexpected even though he is getting to mature years for a footballer. He is an iconic figure in the game and produced wonderful performances for his clubs, particularly Manchester United.
"When you look at his playing and work for England, no one would ever accuse him of being unpatriotic and not giving everything for his country. He is a real loss to the game and I am sure the FA will want to embrace him and to get him closely associated with the organisation. I would personally wish him every luck and success - he will be quite a loss to the game."
Former Manchester United and England team-mate Phil Neville gave his reaction on Twitter and said: "David Beckham - what an unbelievable career - 4 titles in 4 countries over 100 caps for England and the best ambassador this countries has had!"