The youngster was found in a fifth-floor flat in the Leith area of Edinburgh after police broke down the door on Saturday.
The mother, who was found dead on the living room floor, was named locally as 33-year-old Anne-Marie McGarrity.
Her son Michael is said to have survived on crisps and fruit juice and the contents of the fridge when he could not reach the lock on the door.
When found, he was described as painfully thin and badly dehydrated, and he could barely stand.
Cathy Orr, child health commissioner at NHS Lothian, confirmed the boy was recovering at the Royal Hospital for Sick Children in Edinburgh.
She said today: "The boy is doing well in hospital and, if all is well, will be discharged into appropriate care within a few days."
A spokesman for Lothian and Borders Police said: "Following inquiries with various agencies, officers broke into a flat in the Leith area of the city.
"Inside they found the body of a woman, and a three-year-old child. The child is currently being checked out at a local hospital. There do not appear to be any suspicious circumstances regarding the death of the woman and a post-mortem examination will be carried out."
The Daily Record newspaper said Ms McGarrity is thought to have died of natural causes.
The child's grandmother Eleanor McGarrity told the Daily Record she had alerted officers after staff at Michael's nursery became worried about him and phoned her.
She said: "Michael is a tough wee soul but I can't believe how he just got on with things by himself. It appears that he played with his Thomas the Tank Engine and went to his potty regularly.
"He was like a skeleton on Saturday night. He was very, very weak and very thin. He is still lethargic and sleepy and his speech is affected because of the dehydration. But we are confident he will make a full recovery. He is such a brave wee soul."
She said there seemed to have been "plenty of food" in the flat, such as fresh fruit, yoghurts, cheese, crisps, and cartons of Ribena and apple juice.
She added: "He was Anne-Marie's only child and she did the things mums do - she took him to the playgroup and read to him. She did not deserve this to happen, and I can't bring myself to go back to her flat at the moment.
"The police would not even let me see her to identify her. They did it through blood tests."
A spokeswoman for Edinburgh City Council said that there was no social work care order on Michael.
"However, we are working with other agencies to establish what happened and provide support for the family at this time. The child was not in our care and is not in our care now."Reuse content