The TV star and stand-up comic shared a post written by his wife Rosie on Instagram, along with an image of a quote that read: "There is a unique pain that comes from preparing a place in your heart for a child that never comes."
He wrote: "Reposted this from my wife's insta. This it says it all. She's been a warrior."
Rosie, who has been married to Ramsey since 2014, said that last week they thought they would be sharing "some lovely news with you all, but sadly that was not to be".
"When we went for our 12-week scan our baby could not be found," she said.
"He or she had passed early on in the pregnancy, leaving behind the pregnancy sac, this is called a Blighted Ovum. (missed miscarriage).
"My body still thought I was pregnant for all those weeks after the baby had passed, hormones were released and everything apart from the baby was still growing."
She said she was unaware of the condition so it was a "great shock", adding: "Unfortunately it didn't all end there as we were told I still needed to have a miscarriage to rid my body of the sac, placenta etc. I was admitted into hospital a few days later to start the procedure."
Rosie said the process was "awful" and that she had "cramping, vomiting, fainting, fever" and that, after five rounds of tablets over around 20 hours, "the doctors told me it hadn't worked as effectively as they'd hoped".
She said she was taken to surgery to have "everything removed" and that it is "now finally over".
Rosie, who has a young son called Robin with the comedian, added: "I know it is going to take time to come to terms with all of this, I feel emotionally and physically exhausted.
"I have so much sympathy for other couples who have/are going through this as I never knew it entailed so much heartache.
"Robin has been wonderful through it all and we feel so blessed to have him in our lives."
She said she was uncertain about sharing her story on social media because her pregnancy was not known about, but that she wanted to talk about it "in order to heal".
She added: "1 in 4 pregnancies end in miscarriage, 1 IN 4! I didn't realise it was that many. People can't go through this experience in silence or alone, it's just too painful."
Ramsey is known for appearing on a number of comedy panel shows, including Mock The Week, 8 Out Of 10 Cats and Celebrity Juice, and he also previously co-hosted I'm A Celebrity's spin-off show and had his own stand-up programme on Comedy Central.
Ramsey later thanked his fans on Twitter for their "lovely messages", and said "they honestly mean the world and really do help".