The Australian, who has won three grand slams and is the reigning Wimbledon and Australian Open champion, said she was retiring from the sport for a second time to "chase other dreams".
The Queenslander revealed she was retiring in an Instagram video recorded with friend and former doubles partner Casey Dellacqua.
Barty said: "I kind of wasn't quite sure how I was going do this but I think so many times in my life both my professional and my personal, you've been there for me.
"And I just couldn't think 'there's no right way, there's no wrong way'. It's just my way and this is perfect for me to share it with you to talk to you about it with my team, my loved ones, that I'll be retiring from tennis.
"And so first time I've actually said it out loud and yeah, it's hard to say, but I'm so happy and I'm so ready and I just know at the moment in my heart for me as a person, this is right."
The right-hander said winning at Wimbledon - the first time an Australian had claimed a singles title at the Championships in nearly 20 years - had been her "one true dream".
Her voice broke as she told Dellacqua that retirement was "something I've been thinking about for a long time".
"I've had a lot of incredible moments in my career that have been pivotal moments," she said.
"Wimbledon last year changed a lot for me as a person and for me as an athlete when you work so hard your whole life for one goal, and I've been able to share that with so many incredible people.
"But to be able to win Wimbledon, which was my dream, my one true dream that I wanted in tennis, that really changed my perspective."
Barty promised in the caption to the video there would be "more to come tomorrow" at a press conference.
Former world number one Simona Halep pondered whether Barty might switch sports, as the Australian did following the 2015 US Open when she played for the Brisbane Heat in the Women's Big Bash League.
"Ash, what can I say, you know I have tears right? My friend, I will miss you on tour. You were different, and special, and we shared some amazing moments," the Romanian tweeted.
"What's next for you? Grand Slam champion in golf?! Be happy and enjoy your life to the max xo Simo."
Andy Murray paid his tribute to Barty, tweeting: "Happy for @ashbarty gutted for tennis what a player."
Australian of the Year Dylan Alcott, the only man to complete the Golden Slam in quad singles, said Barty was an "even better person" than she was a tennis player.
Alcott tweeted: "Ash Barty. Amazing tennis player but even better person. A champion in every sense of the word. Very proud of you mate."