The story opens with a character named "the man Jack," who kills a family while they sleep. But when the man Jack searches for the true object of his mission, the baby of the family, he finds the child missing. The boy has recently learned to climb out of his crib and did so that night. After finding the front door open, the baby makes his way up the road to the town's graveyard. The boy comes across Mr. and Mrs. Owens, two ghosts who live in one of the mausoleums.
When the spirit of the boy's murdered mother begs them to protect the baby, Mr. and Mrs. Owens agree, much to the chagrin of the graveyard's other inhabitants. The others argue throughout the night, even after Silas, a shadowy figure who is neither living nor dead, agrees to be the boy's guardian, since he can enter the living world and get the baby food. Finally the Lady on the Gray arrives, dressed in cobwebs. It is said that we all meet her when we die. She rides her horse up to where the graveyard occupants are meeting and tells them that they should have charity. With that, the matter is decided. The boy will stay with the ghosts and will be given the Freedom of the Graveyard. Since no one knows his name and the boy is too little to tell them, they decide to call him "Nobody" or "Bod" for short.
As Bod grows up, he is told that he must stay within the graveyard, because it isn't safe for him outside. Silas meets with Bod every night to give him food and answer the young boy's questions. He also teaches the boy to read by pointing out letters on the gravestones.
One day, when Bod is 5 years old, he meets a young girl playing among the bushes. Her name is Scarlett, and the two become friends. The graveyard has become a nature reserve in the town, and Scarlett's mother often brings her there to play. From his ghostly teachers, Bod has learned to fade from sight, so only Scarlett can see him. Her mother believes Scarlett has an imaginary friend.
One day the two children decide to explore the oldest burial spot in the graveyard. It is an unmarked grave in a hill in which treasure is rumored to be buried. Others have tried to steal the treasure and have either never been seen again or come out too frightened to ever return.
Bod and Scarlett enter the ancient grave. Bod leads the way because he can see in the dark. A tattooed man appears and threatens the children. Since Scarlett can see the figure, and she can't see dead people, they realize the figure is not real. He is a kind of scarecrow sent to keep people away from the treasure. Bod then hears a voice calling itself The Sleer. It says it protects the Master's treasures, but all Bod can see is a brooch, a cup and a small stone knife on an altar. Disappointed, he leads Scarlett from the tomb. The children have been gone for hours, and Scarlett's parents have called the police fearing that she had been kidnapped. Bod meets Scarlett one more time before she and her parents move to Scotland.
The following year, Silas arranges for another guardian, Miss Lupescu, to stay with Bod while he has to travel. Bod doesn't like this interim guardian. She speaks with a foreign accent and refuses to call him by his name, referring to him instead as “boy.” She makes him odd food to eat, such as beet soup, and teaches him about the different kinds of people in the world, including ghouls and the hounds of god. She teaches him how to call for help in many different languages, even that of the night-gaunts, beasts that fly on the road to a city called Ghulheim.
Bod hates his lessons with Miss Lupescu and spends the night sulking by one of the gravestones. Ghouls, creatures who look like shrunken, shriveled men, wake him. They call themselves by important titles, such as the Duke of Westminster and the Bishop of Bath and Wells. They promise Bod that if he comes with them, he can live in a world with wonderful food and lots of fun adventures, away from the beet soup and boring lessons of Miss Lupescu. They lead him down one of the graves, and for the first time in his short life, he is unable to see in the darkness. They come to a world with a crimson sky and continue traveling. The ghouls tell Bod that they must turn him into a ghoul if he is to stay in their world. Bod is surrounded by more of the creatures and cannot escape. In the sky above, he sees giant creatures flying. The ghouls are afraid of these beasts that they call night-gaunts. Bod calls to them for help but the ghouls stop him.
The following day, as the ghouls have almost reached the city of Ghulheim, the night-gaunts return in force and attack the ghouls. Bod is rescued from the fray by a huge gray animal with flaming eyes and large paws. The ghouls call it a hellhound. As Bod tries to flee the beast, he slips off a cliff. He hears the hellhound call out in Miss Lupescu's voice. Before he reaches the ground, one of the night-gaunts catches him and carries him to safety. The giant dog approaches, and Bod realizes it is indeed his temporary guardian. Miss Lupescu explains that the night-gaunts sent for her when they heard Bod's cry the night before. She is really a hound of god. Bod climbs onto her back, and the two of them return to the graveyard. Bod has a newfound respect for Miss Lupescu and eagerly renews his studies with her.
Bod makes friends with Liza, the spirit of a young woman who had been drowned and burned as a witch. Liza helps Bod's leg to heal after he falls from a tree. He wants to do something to thank her. She regrets that she was buried without a headstone, and Bod plans to get her one. Since he has no money, he returns to the tomb of the Sleer and takes the brooch. For the first time in his life, he leaves the graveyard and finds a shop he hopes will buy the brooch. Bolger, the store's proprietor, recognizes the piece's worth and seeks to steal it from Bod. Bolger locks the boy in his office and calls an accomplice. He also pulls out an old business card, given to him by the man Jack years ago. Bolger suspects that the man Jack wanted Bod, and he debates using the magic words on the back of the card to summon him.
Before the man Jack can be summoned or Bod can be harmed, Liza finds the boy. When he admits to trying to sell the brooch to buy her a headstone, she decides to help him escape. She casts a spell that makes him invisible. Bolger and his friend fight about what to do with the brooch until they become unconscious. Bod and Liza take the brooch and the man Jack's card and flee. Silas finds Bod and brings him back to the graveyard where the boy tells his guardian everything that happened. Later, Bod uses a paperweight and paint that he stole from Bolger's store to make a small headstone for Liza's grave.
When Bod touched the man Jack's business card, it alerted the assassin to his presence. Ten years have passed since the night Bod's parents were murdered, and the man Jack convenes with the other “Jacks” of the world (Jack Dandy, Jack Ketch etc.) to decide how best to proceed in killing the boy.
Silas decides the time has come to let Bod attend school, but he must not engage the other children or teachers while he is there. He must use the ghosts' fading gift to make himself unnoticeable. Bod enjoys learning, but soon makes the mistake of stopping two bullies, Nick and Mo, who have been stealing from the other children. Once he has been truly seen by the other children, they have no trouble remembering him. When Bod tells Silas what happened, his guardian is angry. He orders Bod not to return to school. Bod argues that he'll leave the graveyard before he lets bullies rule his life.
Bod defies Silas' order to stay inside the graveyard gates and goes to town. He finds Nick's house and practices dreamwalking. Dreamwalking allows Bod to enter the boy's dream. In it, he threatens Nick to make him stop bullying the other children. Before Bod can get back to the safety of the graveyard, Mo arrives with two policemen, one of whom is her uncle. She claims Bod was in her yard breaking things.
They throw Bod into the back of their police car and tell him they're going to lock him up for the night. As they drive through the town, Silas throws himself onto the hood of the car as if he's been hit. Bod tells the policeman that they've run over his father. In the panic that ensues, Bod fades and Silas transports him back to the graveyard. The two apologize to each other for the argument they had, realizing they both had made mistakes.
Bod's friend Scarlett returns to town as an angry 15-year-old. One day when she takes the wrong bus home from school, she ends up by the graveyard. She remembers it from her childhood and goes in to investigate. A middle-aged man asks for her help in making a gravestone rubbing. He offers her a ride home when it begins raining. She takes his cellphone before getting in the car so she can call the police if he tries to hurt her.
The man takes her home and introduces himself as Mr. Jay Frost. After Scarlett's mom tells him about Scarlett's imaginary childhood friend, who lived in the graveyard, Mr. Frost turns on the charm, eventually getting invited to the house for dinner. That night, Scarlett dreams of the graveyard and sees Bod, but neither recognizes the other until they introduce themselves.
Scarlett visits the graveyard in the daylight so she can determine if her dream was real. Bod appears, and the two are overjoyed to be reunited. She returns on the weekend, and Bod tells her about the murder of his parents and how he will one day avenge their deaths. She wonders why Silas won't tell him more about their murder.
When Bod won't elaborate more about who Silas is, Scarlett becomes angry and storms away. But she is intrigued with his story, so asks Mr. Frost how someone can investigate a past murder. He tells her to search the newspapers of the time, and she enlists the help of the local librarian to do just that.
She discovers the story, but finds it strange that it was only printed once in the local paper, and the reporter never mentioned the missing baby boy. She also finds out that Mr. Frost is living in the house where the murders took place. She tells him the story, and he offers to find out more facts for her. When he does, he tells her to bring the friend who was interested in the story so he can explain everything in person.
Silas and Miss Lupescu have been away from the graveyard, engaged in a clandestine and dangerous journey, trying to track down the men intent on killing Bod. Bod has promised to stay in the graveyard until they return, but Mr. Frost's offer to tell him about his family's murder compels him to leave its safety.
He and Scarlett go to Mr. Frost's house to learn the truth. He tells Bod that he found a letter in the baby's room. He will bring Bod upstairs first to read it, and then, if the boy says it's all right, Scarlett can read it, too. Bod follows Mr. Frost up to the nursery, but when they get into the room, Mr. Frost pulls, not a letter but a knife, from the floorboards. He is actually the man Jack, and he is determined to kill Bod. Bod manages to fade and lock the man Jack in the room. Other Jacks arrive, but Scarlett and Bod escape.
The Jacks follow them to the graveyard where Bod uses the help of his spirit friends and his own knowledge of the graveyard to keep the men from catching him or Scarlett. He learns that the Jacks are magical and evil men who have been around for centuries. It was prophesized years ago that a boy who could walk between the worlds of the living and the dead would destroy their order. That's why they want to kill Bod.
The man Jack finds Scarlett in the tomb of the Sleer. Bod follows them down. The man Jack is thrilled to discover where they are, as it is a sacred place for the Jacks. The brooch, cup and knife can all be used to create more of their kind, but first he must kill Bod on the altar. The Sleer wakens, looking for its master. In triumph, the man Jack claims he is the Sleer's master. Before he can kill Bod, the Sleer appears; it is a kind of giant, three-headed snake. It wraps the man Jack in its coils and drags him into the walls of the tomb.
Scarlett is appalled that Bod used her as bait to draw the man Jack into the tomb, knowing what the Sleer would do to him. Bod tries to convince her that he isn't evil, but she is terrified of him. Silas takes her home and wipes away her memories of Bod and the graveyard. He plants the idea in her mother's head that they should return to Scotland and forget everything that had recently happened with Mr. Frost. Bod is upset to lose his friend, but Silas comforts him by taking him outside of the graveyard and getting him a pizza. It is the first time the two have sat together among the living.
In the following months, Bod's ability to see the dead begins to disappear. He can no longer pass into certain mausoleums or graves. He is 15 and must be set free to be among the living now that the threat of the Jacks is gone. He says a poignant goodbye to Silas and his mother, and sets off to see the world.