Nadine Wright told a court that a nurse stood by watching and that she only received medical attention three days later, after the prison governor intervened.
Wright, 37, made the allegations as she attended a sentencing hearing for breaching earlier court orders and admitting shoplifting.
Her barrister, Philip Gibbs, told Leicester crown court: "There was blood everywhere and she was made to clean it up.
"The baby was not removed from the cell. It was quite appalling. It was very traumatic."
The incident is alleged to have happened at HMP Peterborough last month.
The court heard Wright, formerly of Newbold Verdon, Leicestershire, has been battling heroin addiction since her teens and lived a 'chaotic lifestyle'.
Her mother died in September and, with all her mental health issues, was ill-equipped to deal with the loss, said Mr Gibbs.
He said Wright had been unable to claim benefits and stole £13.94 of food from a Co-op store because she was hungry. Within 24 hours of being locked up in HMP Peterborough, she miscarried.
It was not stated in court how many months pregnant she was.
Wright pleaded guilty to breaching two community orders and was jailed for ten months.
HMP Peterborough is a category B privately run prison managed by Sodexo Justice Services. A spokesperson said it could not comment on individual cases.
Suggested For You
Get top stories and blog posts emailed to me each day. Newsletters may offer personalized content or advertisements. Learn more