Jim Nightshade, 13 years, 11 months, and 23 days old, lives next door to Will Halloway, 13 years, 11 months, and 24 days old, in quiet Green Town, Illinois. Will was born one minute before midnight on October 30, and Jim was born one minute after midnight on October 31. They are the best of friends, although Jim is a little more devilish, more of a risk taker, than thoughtful Will.

One day in late October (in fact, the 23rd), a lightning-rod salesman comes to town and predicts a coming storm will strike Jim’s house. He is so certain of the impending threat that he gives the boys a lightning rod for free.

After midnight that very night, the boys awaken with a premonition, a sense of something stirring, and slip out of their homes to investigate. They observe a mysterious train arrive and the set-up of a carnival advertised as Cooger & Dark's Pandemonium Shadow Show, in a field outside the town.

When the boys return the next day, it looks like a normal carnival: there's a Mirror Maze, a Wax Museum, a "witch" who tells fortunes, a carousel with a calliope organ. Mr. Dark, a tall man with a pale face and skin covered with illustrations, senses Jim's hungry curiosity, and is drawn to it. The boys happen to witness Mr. Cooger, a man with flaming-red hair, ride the merry-go-round backward 28 revolutions and shrink down to a 12-year-old boy!

Other strange things happen. The lightning-rod salesman gets squashed to dwarf size. The witch hovers over Jim's house one night in a hot-air balloon and marks his roof. Little 12-year-old Mr. Cooger shows up at the home of Miss Foley, the boys' seventh-grade teacher, and convinces her that he's her nephew. He accuses the boys of stealing her jewelry, then races back to the carousel to get big again so he can overpower the boys because they are onto him, but he falls, knocks himself out, and ends up riding the carousel into ancient old age. Then Miss Foley turns up shrunken to a crying little girl!

Something is definitely not right about the carnival. It's evil, or at least it seems to feed on the weaknesses and fears of the townspeople. Jim is fascinated by it -- he wants to ride the carousel forward just a few times and get bigger right away -- but Will is more wary. Their differing opinions of what is going on with the carnival and its attractions leads to a split between the two friends.

It is up to Will and his father, Charles Halloway, an older parent who works as a janitor at the town library and loves books, to get to the bottom of things before the carnival alters and ensnares more of their fellow Green Town citizens.