Mary Lennox is born in India to parents who never wanted her, handed to servants, and left to grow into a tyrannical, sour-faced little girl. When cholera kills her parents and household, she is shipped to England to live with an uncle she has never met, Archibald Craven, at Misselthwaite Manor on the edge of a vast Yorkshire moor. The house is huge, half-shut, and full of locked rooms, and her uncle, a hunchbacked widower broken by grief, is almost always away.
Bored and contrary, Mary is pushed outdoors by the plain-spoken maid Martha and the gruff gardener Ben Weatherstaff. A friendly robin shows her where a buried key lies, and then the door, into a walled garden that has been locked for ten years since Mr. Craven's wife died there. Mary makes it her secret. She begins to clear the choked beds, finds green shoots pushing up under the dead growth, and without quite noticing starts to grow less sallow, less cross, and genuinely alive.
Through Martha she meets Dickon, a moor boy who charms animals and seems made of the open air. He shares the secret, helps Mary tend the garden, and teaches her the moor's plants and creatures. Meanwhile Mary follows a faint crying through the corridors at night and discovers Colin, her cousin: a hidden, bedridden boy convinced he will die young and grow a hunchback, who rules the servants through tantrums and has never been allowed to try to walk.
Mary, blunt rather than soothing, refuses to pity Colin and tells him about the garden. The secret pulls him out of his sickroom. Wheeled in among the waking roses with Mary, Dickon, and the animals, he forgets to be afraid, stands on his feet to spite Ben Weatherstaff, and resolves to get well in secret so as to astonish his father. The children call the force that revives garden and boy alike "Magic," and Colin makes a half-playful, half-earnest experiment of chanting strength into himself.
As the garden floods back into bloom, both children thicken and strengthen, and the book argues directly that good thoughts are as powerful as sunlight while bad ones poison like germs. Far away, Mr. Craven, who has spent ten years filling his mind with blackness, feels something lift and is drawn home by a dream and a letter. He comes to the garden door, sees his son run to him strong and laughing, and walks back across the lawn to the manor beside the boy he had given up for lost.