The main heroes of the story are the thirteen-year-old boys weirdly connected by their birth date. Willam Halloway was born one minute before midnight and James Nightshade - one minute after. They are best friends and neighbors. The story starts when they are lying on the grass one warm and serene October evening. The salesman goes past them, he sales the lightning rods. The salesman warns the boys that their houses can be struck by lightning. He points to the Nightshades’ house and suddenly leaves one lightning rod near the boys, letting them decide whether to buy it or not. Will thinks that it is a good idea to install the rod. But Jim is curious, he wants to see if the storm indeed can hit the house and what will happen than.
Later the boys go to the library, where Mr. Halloway - Will’s father - works as a janitor. While they are going home they get handbills that are given away by two stranger men: Mr. Cooger and Mr. Dark. They present their carnival, circus and amusement park that will soon come to the city. The boys go home and sleep up to three o’clock in the morning. They wake up because of the piano sound and the clicking of train wheels. Amused, the boys go outside and follow the train to the big meadow, where they see that people unload the train and set up carnival tents. For the first glance it looks like ordinary travelling circus or something alike, but something it the process is incredibly unsettling and boys, terrified, hurry home.
However, when they return there in the morning, the carnival still looks normal. Everything is safe and works fine, except the Mirror Maze, the reflections in which are creepy and entrancing. The boys meet their teacher, Miss Foley and, seeing that she is going to attend the Maze, ask her not to go. Miss Foley doesn’t listen and enter the attraction - just to walk away out of it pale and terrified of the incredibly eerie images looking at her and seeming alive. She tells the boys that her nephew named Robert must be somewhere here and she has to find him until he gets lost.
Will still feels that the carnival isn’t a good place to have fun, but Jim wants to know what will happen later (like with the lightning rod before). Later Jim decides to go to the Mirror Maze himself and is unable to look away from the mirrors and exit by himself. Will comes to the rescue and takes him from the meadow. While walking home the boys find the travelling salesman’s bag.
Jim thinks that at night the carnival will transform again, so late in the evening they secretly return. Jim notices that the carousel has the sign on it saying it is broken. One of the carnival owners, a red-haired Mr. Dark notices them and asks them to go away and come in the morning. He promises that they can ride the carousel once for free, right after it’s repaired. The boys pretend that they go away, but they hide and look. Another carnival owner, Mr. Cooger sits on the carousel and launches it backwards. The music is also playing backwards making everything even more eerie. Suddenly the boys see that Mr. Cooger grows younger with every turn, transforming into a boy of roughly their age. The boy runs away, Will and Jim chase him.
They see that Mr. Cooger knocks at the door of Miss Foley house, pretending to be her nephew who indeed got lost. Despite it’s already very late, Will and Jim also knock to say hello to their teacher and her “nephew” (and to make sure she is still fine). They have to return home, though, to be scolded and punished for leaving homes at night.
Later they still return back to Miss Foley’s home to see her and Mr. Cooger chatting. “Robert” spots them and throws the jewellery into them, crying that there are burglars in the house. The boys have to flee. They return to the carnival and see that still young Mr. Cooger tries to return his true age spinning on the carousel. Jim, who always desired to grow faster, also wants to have a ride, but Will doesn’t allow him. Their silent quarrel turns into the fight and the boys accidentally break the control panel of the carousel. Now it can’t be stopped and Mr. Cooger can’t jump away also. When he manages to leave the carousel, he looks like a dried living corpse. The terrified boys call the police and the medics.
When the police finally arrives and starts investigating everything, Mr. Cooger disappears in the overall mess. Jim and Will go to search him and find that the medics and the policemen are now invited to the Freak Tent to see the new stunt of “Mr. Electrico” who is, actually, Mr. Coogar’s corpse. He returns to life while he is strapped to the electric chair and electrocuted. The ambulance workers are shocked, but the policemen applaud. The boys decide that it’s enough for them today and return to their homes.
But Will soon wakes up in horror. Unable to sleep he comes to the window and sees that the lightning rod (that Jim’s family decided to install after all) disappeared from the roof. He hears the sound of an air balloon approaching. Jim hears it too and also wakes up. The both boys see that it is one of the carnival freaks, the Dust Witch, piloting an air balloon and clearly looking for the boys. She pours some silvery mercury-looking slime to Jim’s roof and leaves. The boys decide that slime can’t mean anything good and climb to the roof to wash it away and finally try to sleep again. But Will still is afraid of the Witch. Deciding to attack first, he takes his bow and arrows (the real ones) and goes outside. The Witch sees him and starts pursuit. Will runs to the abandoned house at the outskirts of the town and shoots the balloon piercing it. The Witch crashes.
The boys sleep and don’t see that the carousel is working again this night and that Miss Foley exits her house and goes to the meadow. In the morning the exhausted boys go to the police station to learn how the investigation is going. Jim says that he had a weird dream about the funeral of an air balloon. Will is just about to tell him the rest of the story, but suddenly they see a crying little girl. She looks very much like Miss Foley in her childhood. Will states that the girl is Miss Foley who accepted the offer of Mr. Cooger to ride a carousel. But Jim can’t be sure. The boys decide to go and search for the adult Miss Foley, but her house is quiet: she isn’t there. In the meantime the carnival freaks start a parade and go to the town. The boys understand that the parade is actually a hunt for them and they need to hide. They run to take the crying girl with themselves, but she is nowhere to be found.
Will calls his father and says that they need to hide. Mr. Halloway immediately goes to search for them and finds them right when the parade is going pass their hiding spot. Mr. Halloway straightly asks Mr. Dark if he is for Jim and Will - and he agrees, showing his palms, with the names “Jim” and “Will” tattooed on each. When the parade goes away, Mr. Halloway asks the boys to come to the library, so they try to learn more about the carnival in the books.
When they indeed come to the library, Mr. Halloway is already prepared. He found the old newspapers with the carnival ads. The carnival is always the same, never changing for years. Mr. Halloway supposes that it is an embodiment of evil of some kind. When they are working on a plan, Mr. Dark finally finds them. Mr. Halloway tries to protect the boys, but Mr. Dark cruelly wounds him. The Dust Witch (who survived the crash) also comes in and casts a spell that allows her to fully control the boys’ bodies. Mr. Dark orders her to kill Will’s father and goes away taking the boys with him. But Mr. Halloway read not only newspapers before the attack. He learned something about the Dust Witch - her only weakness is smile and laugh. So he forces himself to stop fearing and laugh into her face. Dust Witch has to retreat.
Mr. Dark returns to the meadow where the personnel of the carnival is preparing the “final trick” that looks more like a sacrifice. Jim and Will go through the Mirror Maze and enter the Wax Museum where the crowd is already gathered. The trick is performed by the invincible Dust Witch. One of the audience is welcomed to fire a rifle at her. Mr. Halloway, who followed the kids, volunteers. He plays to the carnival rules, receiving the crowd’s applause, but then he says that he need his son as an assistant, to make the trick more spectacular. The crowd approves and Will is freed. Mr. Halloway and Will examine the bullet and see that it is made of crayon. But Mr. Halloway still doesn’t try to change it, just scratches a crescent moon on its surface. When he returns to the Dust Witch he loudly announces that the moon is his smile and fires the rifle. The Witch dies on the spot.
Mr. Halloway returns for Jim but is lost in the Mirror Maze. In the mirrors he sees countless aged figures who look tormented and try to turn him into one of them. But when Will, seeing that his father stays in the Maze for too long, runs to the rescue, he sees that Mr. Halloway starts laughing, accepting his ageing and death as something funny. The mirrors break and the Maze ceases to exist. Mr. Halloway and his son continue searching for Jim. As Will suspected, Jim is on the carousel, having his “free ride” and ageing. The corpse of Mr. Electrico still lies nearby, slowly crumbling to the dust. Will begs his friend not to do this and tries to catch his hand and pull Jim out of the carousel. They struggle until Mr. Halloway finally runs to the carousel and switches it off. Jim flies away from it due to huge inertia, hits the ground and, seemingly, dies.
A little boy runs to the carousel, screaming and crying, asking to help him. Mr. Halloway steps forward but then he remembers the boys’ description of Mr. Dark and kills the creature that looks like a boy. The tattoos on Mr. Dark’s body disappear. It seems that there were the names of all the carnival freaks and now they all are freed from his control. Will cries in terror, but Mr. Halloway says that to defeat the evil in the carnival they have to have the real fun. They perform a crazy hysterical dance and song, but gradually it becomes funny for real. Their dance revives Jim and he joins them.
Now they all are free. For a minute all the three want to ride the carousel: the boys want to be adults and Mr. Halloway wishes to return to his childhood. But they eventually realize that it will make them no much better than Mr. Dark and Mr. Cooger. So they run to the end of the meadow just for fun. No one wins, they all reach the start of the road to the town simultaneously.