"There is no happiness in this topic for me. I know it's not the usual thing to say, but I feel a great deal of pain," she added. "It's the hardest thing that I could ever imagine. I hate it. I hate that I have to be at this crossroads. I keep saying to myself, I wish it could be easy for me, but it's not. I'm torn: I don't want it to be over, but at the same time I'm ready for what's next."
That includes expanding her family - a topic which is regularly brought up by her five-year-old daughter Olympia, who is desperate to be a big sister.
"Believe me, I never wanted to have to choose between tennis and a family," Williams wrote. "I don't think it's fair. If I were a guy, I wouldn't be writing this because I'd be out there playing and winning while my wife was doing the physical labour of expanding our family."
Williams revealed she has been trying to have another child with husband Alexis Ohanian for the past year.
"We recently got some information from my doctor that put my mind at ease and made me feel that whenever we're ready, we can add to our family," she wrote. "I definitely don't want to be pregnant again as an athlete. I need to be two feet into tennis or two feet out."
Williams, who won her first match in over a year on Monday at the National Open in Toronto, confirmed that she would play at the US Open in Flushing Meadows at the end of the month. That will be her last grand slam event.
Williams has won 23 Grand Slam titles — the most in the Open era and one short of Margaret Court's all-time record.
"Unfortunately, I wasn't ready to win Wimbledon this year," wrote Williams, who lost to Harmony Tan in the first round at the All England Club.
"And I don't know if I will be ready to win New York. But I'm going to try. And the lead-up tournaments will be fun. I know there's a fan fantasy that I might have tied Margaret that day in London, then maybe beat her record in New York, and then at the trophy ceremony say, 'See ya!' I get that. It's a good fantasy. But I'm not looking for some ceremonial, final on-court moment. I'm terrible at goodbyes, the world's worst.
"But please know that I am more grateful for you than I can ever express in words. You have carried me to so many wins and so many trophies. I'm going to miss that version of me, that girl who played tennis. And I'm going to miss you."
For more parenting news and advice, listen to the Herald's parenting podcast, One Day You'll Thank Me