Will Halloway and Jim Nightshade, two thirteen year old boys born two minutes apart (Will one minute before midnight on October 30th, Jim one minute after midnight on October 31st) are lying on the grass outside their houses. Will is cautious and innocent; Jim is dark, impulsive, and thinks he needs to know everything. A storm brews in the distance and Tom Fury, a traveling lightning rod salesman, give the boys a lightning rod and predicts that Jim's house will be struck that night. Will convinces Jim to mount the rod on his roof.
The boys head to the library, where Will's father, Charles Halloway, works as a janitor. He is 54 years old and preoccupied with what he sees as his old age. His relationship with his son is awkward. Both Charles and the boys notice advertisments for "Cooger & Dark's Pandemonium Shadow Show," and remark that it's odd for a carnival to come to town in autumn. They also notice a sign advertising "the Most Beautiful Woman in the World." All they see, however, is a block of ice with an empty space in the middle about the size of a person.
That night, Will overhears his parents talking about him: Charles says that Will makes him feel old. As Will falls asleep, he hears his father leave the house for the library. Jim, meanwhile, sits in his room and contemplates removing the lightning rod from his house, just to see what happens. Across town, Tom Fury walks past a store window and sees a beautiful woman frozen in a block of ice. He wonders if he could melt it with the warmth from his hands.
At three in the morning, the boys awake to the distant sound of a train. Looking out their windows, they see a train that seems impossibly old, from the time of the Civil War. The boys rush to meet it. A calliope plays, but there is nobody at the keys. The train lets out a whistle that sounds like the death wail of thousands of people at once. The train stops in a meadow and a circus seems to magically and ominously assemble. The boys run home. Charles is in the library and sees them run by. Walking home, he looks into the window where the block of ice once lay. All that remains is a puddle of water.
In the morning, the boys return to the meadow and find what appears to be a normal carnival. They run into their teacher, Miss Foley. She is looking for her nephew, Robert, who is staying with her for a few days. They both remard that the Mirror Maze gives them chills. Miss Foley walks into the Maze and soon the boys hear her cry for help. They rush in and pull her out by the arm, which looks like that of an old woman. She tells the boys that inside she saw a little girl who looked just like her when she was younger. The little girl looked like she was drowning in the mirrors.
At dusk, Jim disappears. Will walks to the Mirror Maze, and Jim is there. Will pulls him out. Jim is mesmerized by what he saw, but he won't tell Will what it was. On the way home, they trip over Tom Fury's lightning rod bag. Tom is nowhere to be seen. Jim needs to find out more about the carnival. The boys approach the carousel, which is chained off with an "out of order" sign. As Jim gets on, a large man with red hair, Mr. Cooger, pulls him off. A second man, Mr. Dark, who is tatooed all over his body, comes to Jim's aid. Mr. Dark hands the boys a business card that magically changes colors. Jim and Will offer fake names. "Show's over," says Mr. Dark, and tells the boys to run home for supper.
Instead, Jim hides in a nearby tree, and Will reluctantly follows. Mr. Cooger gets on the carousel and rides it backwards about thirty times around. When he gets off, he looks thirty years younger, a boy of about twelve. The boys follow the young Mr. Cooger and end up at Miss Foley's house. They ring the bell but decide not to warn her until they are sure. Miss Foley speaks the young Mr. Cooger as though he is her nephew Robert. They resolve to call Miss Foley to warn her when they get home, but upon returning they are punished for being late and sent to immediately to bed. While in bed, Will recognizes the carousel's tune as Chopin's "Funeral March."
Later that night, Will sees Jim sneaking out his window. Will follows and again finds himself at Miss Foley's house. Jim is calling up to Robert/Mr. Cooger's window. Will realizes that Jim wants to ride the carousel forward so that he can be older. The two boys begin to fight. Robert appears in an upstairs window and throws Miss Foley's jewelry down onto the lawn, framing them for robbery. Robert shouts for the police and then runs down the street. Will and Jim follow.
They follow Robert/Mr. Cooger to the carousel. The boys try to stop him from riding forward by working the controls, but they break, and the carousel spins out of control. When it finally stops, Mr. Cooger is a two hundred year old mummy. They run away and call the police. When they return, Mr. Cooger is no longer there. They then enter a tent, and the mummy is in a corner sitting in a chair. He looks dead. Mr. Dark tells them that it is only their latest carnival attraction, "Mr. Electrico." He flips a switch and 100,000 volts of electricity course through Mr. Cooger's body. He comes alive and slowly begins to speak, wishing both boys a "short and sad life." The police laugh and the boys run away. Meanwhile, Miss Foley calls the police and reports that Will and Jim tried to rob her house.
The boys are dropped off near the police station and hear Miss Foley and Charles speaking to the police. Will wisely decides to turn himself - and Jim - in. Back at home, Will and his father bond with a heart-to-heart conversation about life, death, and happiness. Will tells his father to stay away from the carnival and then shows his father a ladder that he has hidden at the side of the house, and both climb it to Will's room, Charles feels almost young again.
Will wakes up an hour later to discover that Jim has taken down the lightning rod. He senses a large balloon outside, piloted by the Dust Witch, a carnival freak with her eyes sewn shut. She sees by waving her hands and fingers. She brushes Jim's roof and marks it with silver paint. The two boys wash off the roof with a hose, and then Will follows the balloon and shoots it down with an arrow. It floats off to die in the carnival meadow.
The next morning, the boys come across a small girl crying. They realize in horror that it is Miss Foley. She has ridden the carnival backwards. The two boys promise to get help, but then they hear a parade. It is the carnival, searching the town for them. They run to hide in a storm drain along the parade route. Later, they return and she is gone. She does not appear again in the novel.
Charles is at a bar when Mr. Dark shows up and asks the bartender if he has seen Will and Jim. Charles gets up and quietly leaves. He walks to right above the storm drain in which Will and Jim are hiding. He notices the boys, but just then Mr. Dark walks up. Charles stalls and feigns ignorance. The Dust Witch approaches, sensing the ground with her fingers. She seems to sense the boys below, but Charles blows smoke in her face and begins to speak loudly, distracting her. Mr. Dark walks away with the Dust Witch, and Charles tells the boys to meet him at the library.
At the library, Charles looks through old newspapers and books about evil. The boys arrive and tell Charles everything that has happened in the past couple of days. He believes them. Charles then tells them about his research. Mr. Cooger and Mr. Dark have been running the same carnival for at least a hundred years, probably more. He tells the boys that he thinks the carnival feeds off of people's fears and desires and has been around in some form for thousands of years. Mostly, the carnival feeds off a fear of death. This fear causes people to want to ride the carousel. When things don't turn out as they had planned, the Mr. Dark promises to return them to their original state - but only if they serve some indefinite amount of time as a carnival freak. Then they hear the library door open and close, and the boys run and hide.
Mr. Dark offers to make Charles younger if he tells him where the boys are hiding. Charles is tempted by the thought of being younger, but he refuses. Mr. Dark crushes Charles's hand and walks out of the room, and Charles tries to run after him but feels a sharp pain in his chest. Walking through the halls and stacks of the library, Mr. Dark shouts to Will that his mother rode the carousel, and that she is now a little girl. Will sobs, and Mr. Dark finds them both high up on a shelf. He grabs them and walks out of the library. Outside, Mr. Dark tells the Dust Witch to go in and kill Mr. Halloway.
Back in the library, Charles is lying on the floor when the Dust Witch approaches. She places her fingers over his chest, and he can feel his heart begin to slow. Just as it is about to stop, a smile forms on has face, and he begins to giggle. He laughs at the seeming inanity of life and the unimportance of death, and he laughs at the ridiculous image of the Dust Witch standing over him "tickling" the air. The Dust Witch recoils at the laughter as if burned and flees, wounded.
The boys are under the spell of Mr. Dark, and they do exactly what he tells them. He leads them through the mirror maze and to the wax museum, where they stand like wax statues. Charles follows a few minutes later. Mr. Dark tells the remaining carnival visitors that he is about to perform the Amazing Magic Bullet Trick. He asks for volunteers from the audience. The Dust Witch approaches and tells him that Charles is not dead, and to cancel the trick. Mr. Dark is about to comply when Charles appears and volunteers, jumping up on stage. Reluctantly, Mr. Dark proceeds. Charles tells the audience that he needs someone to help him hold the gun, since his hand is badly wounded. He calls out for his son, and soon the entire audience is doing the same. Will appears, still mostly under a spell, but he walks up on stage.
Mr. Dark gives Charles a bullet and tells him to mark it with his initials. Instead, he marks it with a crescent smile. He goads the crowd into fits of laughter, which releases Will from Mr. Dark's spell. Charles knows how the magic bullet trick works, and when the real metal bullet has been replaced by one made of wax, he takes it out of the gun and marks it again with a smile. He levels the gun at the Dust Witch and fires. The wax bullet melts in the barrel as expected, but the Dust Witch falls to the ground dead.
Jim is still in the wax museum, and Charles and Will run through the mirror maze to find him. Soon, though, Charles sees himself as endless reflections, each older than the next. The lights go out. Charles is in despair and wants the lights to stay out so that he doesn't have to see the reflections, but Will lights a match and tells his father that he loves him. Charles looks directly into his reflections and lets out a tremendous laugh. The mirrors shatter. They still can't find Jim, however.
They walk towards the carousel. On their way, they see a group of carnival freaks carrying Mr. Electrico/Mr. Cooger. Something startles them. They drop him, and he dissolves into a cloud of dust. Will and Charles spot Jim, still partly under Mr. Dark's spell, walking towards the carousel, which is running forward. Jim hesitates and then grabs on with one hand. Will runs to try and pull him off but misses, and Jim goes one rotation around the carousel. Will grabs Jim when he comes around, but somehow they both end up on the carousel. They travel another half-rotation before Will is able to throw himself and his friend off. Jim has aged one-and-a-half years and Will has aged six months.
Jim isn't moving, possibly dead. Charles and Will are about to attend to him when a small boy approaches Charles. He says that Mr. Dark has been chasing him, and he begins to lead Charles away. But Charles grabs the boy and pulls up his shirt, exposing the tattooed body of Mr. Dark. Charles hugs the boy to deprive him of the fear he needs to survive. Mr. Dark falls to the ground dead.
Jim still isn't moving. Will is crying, but Charles tells his son to laugh. It is takes a while, but eventually he succeeds, and this laughter brings Jim back to consciousness. All three of them are now laughing and dancing, and they race to the railroad. Charles feels a small pain in his chest but ignores it, and races along with the boys. Then they walk together into town.