Ten-year-old Mary Lennox is a sour and selfish girl. She's born in Colonial India, and Mary's mother never wanted a baby, so she immediately passes Mary off to an Ayah. The servants keep Mary away from her parents and give her everything she wants. This all changes when, one day, a servant who's not Mary's Ayah greets her in the morning. As Mary plays outside and makes a pretend garden, she hears her mother talking with a young officer about "it" affecting the servants too. The next day, Mary learns that cholera has infected her home. Everyone forgets about Mary. She spends two days shut into her room until finally, two officers discover her and are distraught—Mary's parents are dead and the officers weren't sure whether or not Mary existed. After living briefly with an English clergyman, Mary is sent to England, where she is passed off to Mrs. Medlock, the housekeeper for Mary's uncle, Mr. Craven. Mary tries to act aloof, but she's intrigued by Mrs. Medlock's stories of the house, Misselthwaite Manor, as well as her story of Mrs. Craven's death. Her death turned Mr. Craven into the miserable hunchback he is today, and Mary finds this sad.
The next morning, Mary wakes up to find a maid, Martha, starting a fire in the grate. Mary is enraged when Martha admits that she thought Mary was going to be a black Indian. Mary feels even worse when she learns that she's going to have to learn how to dress herself. Martha shoos her outside and mentions that there's a garden that's been locked since Mrs. Craven's death ten years ago. Mary walks around the grounds. She curtly talks with a gruff old gardener, Ben Weatherstaff, and explores the kitchen gardens. Mary notices a robin in a tree and thinks that the tree seems to be inside a garden with no door. She returns to Ben and asks him about it. He introduces her to the robin, who's a friend of his, and Mary admits she's lonely. Over the next few days, Mary wanders the gardens, visits with the robin, and thinks about the locked garden. One evening, Mary asks Martha about the locked garden. Martha shares that it belonged to Mr. Craven and his wife. Mrs. Craven used to sit on a tree covered in roses, but the branch broke and she died. Mary suddenly hears someone crying, but Martha says that it's just the scullery maid complaining of a toothache.
It's raining the next day, so Mary explores the house. She hears the crying again, but Mrs. Medlock catches Mary before she can investigate. One morning, Mary and Martha discuss that Mary would like to see the moor and Martha's family's cottage. Martha talks about her brother, Dickon, who makes friends with animals. Martha promises that while she's at home later, she'll ask her mother, Mrs. Sowerby, if Mary might visit. Lonely, Mary wanders through the grounds and finds Ben. He tells her that spring is coming and shows her the budding plants. The robin joins them and Mary asking Ben if roses are growing in the garden where the robin lives, but he refuses to answer.
As he hops away, Mary discovers a key ring half-buried in the dirt and pockets it. The next day, Mary returns to where she found the key, and this time she notices a locked door. The key is a perfect fit, and Mary slips inside, suddenly finding herself in a garden brimming with dead-looking roses. At dinner later, Mary wishes she had gardening tools. Together, Martha and Mary draft a letter to Dickon and enclose money so that he can purchase tools and seeds for Mary to start her own garden, which she decides to call the secret garden.
One day, Ben talks to Mary about roses he used to care for a young woman and tells Mary how to tell if roses are alive. Mary skips away and finds Dickon sitting in the woods. She reveals her secret garden to Dickon, who promises to keep the secret, and they weed and prune for several hours. After lunch, Mr. Craven summons Mary for the first time. Mary thinks that he'd be handsome if he didn't look so miserable. She tells him that she doesn't want a governess and just wants earth in which to plant a garden.
In the middle of the night, Mary hears screaming and crying and goes to investigate. She finds a room that contains an ill-looking boy who introduces himself as Colin Craven, Mr. Craven's son. Mr. Craven apparently hates Colin and everyone believes that Colin is going to die or develop a hunchback. Colin forbids everyone from looking at him or talking about him. Only one doctor, the London doctor, has ever said that Colin has a chance. Mary realizes that Colin is very spoiled. When Colin hears that there's a locked garden, he says that he's going to make servants take him there. Mary convinces him that it'd be better if they could play there in secret. He shows Mary a portrait of his mother, which he keeps covered, and then invites Mary to visit him again.
In the morning, Mary tells Martha that she found Colin, but explains that it needs to be kept a secret that the children know about each other. Martha is shocked that Colin seems to like Mary and says that some people say that Colin is fine, just spoiled, and won't flourish indoors. A bit later, Colin summons Mary. They talk about Dickon and the moor, and Mary encourages Colin to think only of living things. The children are laughing when Mrs. Medlock and Dr. Craven walk in. Dr. Craven reminds Colin to remember that he's ill, but Colin says he wants to forget. The children spend the next rainy week together, and Mary tries to ascertain if Colin is trustworthy enough to tell him about the secret garden. Colin decides that he wouldn't mind meeting Dickon.
The next sunny morning, Mary runs outside early and finds Dickon working in the secret garden, accompanied by Captain the fox and Soot the crow. He points out that they need to be careful, as the robin is building a nest and they don't want to scare him. Over the next two days, Martha seems afraid that Colin will be upset by Mary's absence, but Mary doesn't care. Finally, Martha sends Mary to Colin, as he's throwing a tantrum and is inconsolable. Colin threatens to ban Dickon from the manor and Mary declares she's never visiting Colin again. Mary accuses Colin of making people feel bad and insists he's not going to die. Later, Mary wonders if Colin spent all day being afraid. That night, Mary wakes up and hears Colin screaming. The nurse bursts into her room and asks her to calm Colin down. Mary starts to get angry, storms into Colin's room, and screams back at him. She demands to see Colin's back and deems it normal. This is comforting for Colin and the nurse repeats what the London doctor said: Colin is fine, just weak and spoiled, and he needs fresh air. Colin calms down and says he'd like to meet Dickon. The next morning, Mary meets Dickon in the garden and explains the situation with Colin. She later tells Colin about Dickon's creatures and Colin apologizes for his bad behavior. At this, Mary confides in him that she found the secret garden. When Dr. Craven arrives later, he's shocked to see Colin looking well and gives the children permission to take Colin outside.
The next day, Dickon brings his creatures into Colin's room. A week later, Dickon and Mary take Colin outside in his wheelchair and into the secret garden. Immediately enlivened, Colin declares that he's going to get better and live forever. They discuss that Colin will stand when he's not afraid to. A bit later, the children see Ben looking over the wall at them, furious. He's shocked to see Colin, however, and Colin is enraged when Ben calls Colin a "poor cripple." Colin stands in retaliation and commands Ben to enter the garden. He explains that this is his garden now and it must stay a secret. Ben admits that Mrs. Craven made him promise to care for her roses before her death. He then fetches Colin a rose to plant, and Colin decides that his newfound health is Magic.
Over the next few months, Mary confronts Colin about his bad attitude and they decide that the Magic in the garden is real. After a while, Colin summons Dickon, Mary, and Ben so that he can speak about the power of Magic, on which he's going to conduct a scientific experiment. He believes that the Magic is making him well and will help him live. They sit in a circle and Colin repeats a phrase about everything being Magic. Then, he walks around the garden and says that his recovery will remain a secret until he can tell Mr. Craven himself. Gradually, Dickon shares this all with his mother. When she learns that Colin is concerned that his appetite will spoil the secret, she starts sending bread and milk with Dickon. Dickon learns some strength training exercises from the local wrestler Bob Haworth, and the children incorporate these into their routine. The adults are perplexed, as Colin looks better but still acts ill. After a while, Colin decides to stop covering up his mother's portrait, as he believes that she was Magic.
In the fall, Colin suddenly realizes he's well and wants to thank the Magic. Ben suggests they sing the Doxology and Dickon leads them in it. A few minutes later, Mrs. Sowerby enters the garden. She assures Colin that Mr. Craven will like him and tells Mary she's pretty too. She's never heard of Magic, but suggests that it's all the same "Big Good Thing." They eat a picnic and before they leave, Mrs. Sowerby tells Colin that his mother's spirit is in the garden.
At the same time as all of this is happening, Mr. Craven is traveling Europe, gloomy and angry as usual. On the same day that Colin first declares he's going to live forever, Mr. Craven starts to notice how beautiful the natural world is. He begins to experience more happiness and one night, he dreams about his wife in the secret garden. The next morning, he receives a letter from Mrs. Sowerby asking him to return home. Mr. Craven thinks of Colin often as he travels and wonders if it's too late to fix things. When he arrives back at the manor, Mrs. Medlock tells him about Colin's strange state and says that Colin is out on the grounds. Mr. Craven wanders around and thinks he hears children in the secret garden. Suddenly, Mary and Colin burst out of the door and right into Mr. Craven's arms. They tell him all about the garden, Magic, and Colin's miraculous recovery. Mr. Craven is thrilled and the household staff are shocked when they see Mr. Craven and Colin walking back to the house, laughing.