The novel centers on the mischievous orphan Tom Sawyer, who lives in the quaint village of St. Petersburg, Missouri under the care of his kind Aunt Polly along with his ill-natured brother Sid and angelic cousin Mary. As a collection of stories, the novel is loosely structured, but follows the arc of Tom's transformation from a rebellious boy who longs to escape authority to a responsible community member committed to respectability.
Tom's first adventure occurs as a result of him playing hooky, stealing snacks, sneaking in late, and various other misdeeds. As punishment, Aunt Polly tells him to whitewash her fence on a Saturday. Tom convinces his friends that whitewashing the fence is actually a privilege, and gets them to not only do the work for him but to pay him with various trinkets for the opportunity. On his way home he develops a crush on the new girl in town, Becky Thatcher.
The next day he heads to Sunday school, where he trades the trinkets he tricked his friends into giving him on Saturday in exchange for tickets they earned for memorizing scripture. With these tickets Tom earns an honorary Bible. His teacher knows that Tom is being dishonest, but rewards him to show off to Judge Thatcher, who is visiting that day. Judge Thatcher then tests Tom by asking him the names of Jesus's first two disciples and Tom responds incorrectly.
On the way to school Monday he runs into Huckleberry Finn and they agree to meet up in the graveyard at midnight to test a cure for warts. Tom's late for school, and forced to sit with the girls as punishment. He uses this opportunity to profess his love to Becky. Over lunch Becky spurns his marriage proposal after learning he was recently engaged to Amy Lawrence.
That night, from a hidden spot in the graveyard, Tom and Huck watch a fight break out among the grave robbers Injun Joe, the drunkard Muff Potter, and Dr. Robinson. Injun Joe stabs the doctor, and then frames Muff for the crime. The boys are so scared of Injun Joe that they vow to never tell anyone.
Shattered by Becky's rejection, Tom decides to run away as a pirate, recruiting Joe Harper and Huck to join him. They sneak off to Jackson's Island, a small island near town in the Mississippi River. Tom secretly returns to St. Petersburg one night to eavesdrop on his family as they mourn him, think he's drowned. He returns with his friends to interrupt their funeral ceremony. When they do they are welcomed as heroes.
At school, Tom startles Becky as she is secretly peeking through their teacher Mr. Dobbins' anatomy book and she tears a page. Though she has continued to reject him, he tells Mr. Dobbins he tore the page, and is whipped, earning Becky's admiration.
Tom's conscience nags him as Muff's trial approaches. When it comes, he takes the stand as a surprise witness to clear Muff's name. Injun Joe escapes through a window, however.
Tom asks Huck to hunt for treasure with him. Their efforts lead them into a haunted house. They hide when they hear Injun Joe and a stranger there. The boys watch as the outlaws discover a treasure chest full of gold underneath the floor, which they take to hide at "Number Two."
Tom has Huck watch for the men at the Temperance Tavern, thinking room number two may be where the treasure is. Meanwhile he goes on a picnic with Becky at MacDougal's Cave. When Injun Joe and the stranger appear, Huck tracks them, overhearing their plan to get revenge on the widow Douglas. Huck goes to the Welchman to save the widow, and a posse of men scare off the outlaws but fail to capture them.
Tom and Becky are lost in the cave, fearing for their survival. Hunting for a way out, Tom encounters Injun Joe, who runs away. Eventually Tom finds an outlet and the children are welcomed home.
Tom realizes "Number Two" must be in MacDougal's Cave, where he and Huck find the treasure. The get to keep the gold and are now respected throughout St. Petersburg as wealthy, courageous young men. The widow Douglas takes Huck in to take care of him and civilize him. Miserable, Huck runs away. Tom finds him and promises to let Huck join his new gang on the condition that he return to the widow's house. Huck agrees.