"I knew, as I clutched my firstborn child, that I was losing my second," Meghan said in a piece for the New York Times.
She went on to describe how she watched "my husband's heart break as he tried to hold the shattered pieces of mine".
Meghan wrote that "loss and pain have plagued every one of us in 2020".
The 39-year-old shared her experience to urge people to "commit to asking others, 'are you OK?'" over the Thanksgiving holiday in the US.
A source close to the duchess confirmed to the BBC that the duchess is currently in good health and the couple wanted to talk about what happened in July, having come to appreciate how common miscarriage is.
A Buckingham Palace spokesman said: "It's a deeply personal matter we would not comment on."
The duchess and Prince Harry, the Duke of Sussex, moved to California to live away from the media spotlight, after stepping back as senior royals in January.
Their first child, Archie, was born on 6 May 2019.
The duchess began her article by describing a "sharp cramp" she felt while looking after Archie.
"I dropped to the floor with him in my arms, humming a lullaby to keep us both calm, the cheerful tune a stark contrast to my sense that something was not right," she wrote.
"Hours later, I lay in a hospital bed, holding my husband's hand. I felt the clamminess of his palm and kissed his knuckles, wet from both our tears.
"Staring at the cold white walls, my eyes glazed over. I tried to imagine how we'd heal."
The duchess continued: "Losing a child means carrying an almost unbearable grief, experienced by many but talked about by few.
"In the pain of our loss, my husband and I discovered that in a room of 100 women, 10 to 20 of them will have suffered from miscarriage.
"Yet despite the staggering commonality of this pain, the conversation remains taboo, riddled with (unwarranted) shame, and perpetuating a cycle of solitary mourning.
"Some have bravely shared their stories; they have opened the door, knowing that when one person speaks truth, it gives license for all of us to do the same."
The duchess also referenced a TV interview in which she was asked by a journalist if she was ok, during her tour of South Africa last year.
She said she was asked the question during a time in which she was "trying to keep a brave face in the very public eye".
"I answered him honestly, not knowing that what I said would resonate with so many - new moms and older ones, and anyone who had, in their own way, been silently suffering," she said.
The duchess is the second member of the Royal Family to open up about having a miscarriage.
In 2018 the Queen's granddaughter Zara Tindall spoke about suffering two miscarriages before having her second child.
The duchess's miscarriage happened at a time when she was involved in legal action against the Mail on Sunday over the publication of a letter she wrote to her father. Last month she was granted a postponement of her privacy trial until autumn next year.
'Breaking down stigma'
An estimated one in four pregnancies ends in a miscarriage, according to the charity Tommy's.
Tommy's midwife Sophie King said talking about baby loss in pregnancy is "a real taboo in society" so "mothers like Meghan sharing their stories is a vital step in breaking down that stigma and shame".
She said the duchess's "honesty and openness" sends a "powerful message to anyone who loses a baby: this may feel incredibly lonely, but you are not alone".
Clea Harmer, chief executive of stillbirth and neonatal death charity Sands, said it was a "sad reality" there was a stigma surrounding pregnancy loss and baby death, which "leaves many parents feeling isolated".
"The isolation we have all felt this year has made it even more difficult for parents whose baby has died during the Covid-19 pandemic and has brought back painful emotions for all those who have lost precious loved ones," she said.
Dr Christine Ekechi, of the Royal College of Obstetricians and Gynaecologists, said it was "important" that any stigma or shame surrounding this issue was removed.
"Sadly, early miscarriages are very common and they can be a devastating loss for parents and their families," she said.
And Alice Weeden, from charity the Miscarriage Association, told the BBC: "When somebody, particularly in the public eye, talks about it openly, it's helpful for other people to know that they are not alone."