Cardiff Coroner's Court heard that Claire Jones became pregnant after an affair with work colleague Marcus Bezerra.
Claire said she knew she was pregnant but thought the pain she suffered in the early hours of December 28 from last year was from diarrhea, reports the Sun.
She hid her condition from friends and family, including partner of 11 years David Stoneman.
Claire, on Monday, said that she only realized what had happened when she saw a foot in the toilet bowl.
Jones, of Pontnewydd, Cwmbran, South Wales, told the inquest: "While I was still on the toilet, I flushed it, and I felt something pull.
"I stood up slightly, and I could see a foot in the bowl of the toilet."
Cardiff Coroner Mary Hassell asked Claire if she realized she had given birth, but she replied: "No".
Claire said: "I could see the baby's foot, so I pulled the baby out. I sat by the toilet. I put him on my lap. He wasn't crying. I was trying to feel for a pulse and there was nothing."
When asked why she did not call for help, Claire said: "Because nobody knew I was pregnant. Because he wasn't breathing, I just panicked. I didn't know what to do."
She said she tried to revive him by blowing into his mouth and massaging his heart.
Claire said: "I just kept trying and trying, and it wasn't working. There was nothing I could do. He was blue. I wrapped him in a towel. I don't remember how, but I must have put him in the boot of the car."
The corpse was found in Jones' vehicle after she was arrested. She was given a suspended sentence for concealing the baby's birth.
The coroner's court is investigating the circumstances of the baby's death.