Twelve-year-old Alex Metcalf wakes on an unfamiliar bus wearing his Atlanta Braves T-shirt, sitting near a man-sized toad and a girl made of patchwork fabric. Convinced he is dreaming, Alex meets Dorothy, the team leader and pitcher of a baseball team called the Oz Cyclones. The roster includes characters from classic children's literature: Scraps the patchwork girl, Jack Pumpkinhead, Tik-Tok the brass robot, Pinkerton the flying monkey, Toad of Toad Hall, Br'er Rabbit, and a blond boy named Button Bright. Dorothy, desperate for a competent first baseman, puts Alex on the team despite Scraps's warning that he is a "Lark," a daydream person imagined by a single real-world child, who could vanish at any time.
The Cyclones play their first game at Ebbets Field, the legendary Brooklyn ballpark. Alex hits a towering home run but showboats during his trot, accidentally knocking down the Big Bad Wolf, the most dangerous escaped villain in Ever After, the world of storybook characters, near third base. Three magicians, including a boy named Charles Wallace, recapture the escaped wolf in a cloud of purple magic, but not before the crowd laughs at the wolf being toppled by a child in a baseball jersey. Humiliated, the wolf demands Alex's name. Alex gives it without thinking, and Charles Wallace warns him that the wolf can use his name against him.
The dream does not end. Button Bright's body soon flickers transparent, and Dorothy reveals he has faded away entirely because no children believe in him anymore. She explains the nature of Ever After, the world where storybook characters live as long as children believe in them. A Lark, she tells Alex, is the daydream of a single real-world child who imagines a better version of himself. She believes Alex is the daydream of a baseball-obsessed boy. Alex refuses to accept this. Dorothy reveals the tournament's stakes: The winning team receives wishes from the Wizard of Oz, and she assembled the Cyclones from obscure characters in danger of being forgotten, hoping to win wishes that would save them.
The Big Bad Wolf, a master of disguise who can change his size at will, escapes his captors and begins hunting Alex. He poses as the Cyclones' bus driver and attacks Alex on the bus. Alex escapes through the emergency exit, and Nanny Mae, a government agent assigned as Alex's bodyguard, drives the wolf away with a bazooka. Alex is clawed across the stomach. While unconscious, he experiences fragmented visions of hospital rooms, beeping machines, and his mother sleeping in a chair beside a bed.
Alex tries to leave Ever After but discovers the world loops in on itself. When he rides a giant firework rocket built by Ma Liang, a Chinese boy with a magic paintbrush, they fly across the entire landscape only to arrive back where they started. There is no exit. With help from Mrs. Which and Mrs. Whatsit, two magical beings from the novel A Wrinkle in Time who can travel through time, Alex returns a day earlier to give the Cyclones a second chance at a game they lost without him.
Against a powerful manga team whose characters possess superpowers, Dorothy loses confidence, fearing new characters will replace classic Storybooks. Alex rallies the team and carries the offense. On a train afterward, the Cheshire Cat, a grinning member of the Grimm Reapers from Alice in Wonderland, challenges Dorothy to a bet: If she strikes him out, the Grimm Reapers, a team of literary villains, quit the tournament; if he gets a hit, he gets her ruby and silver cleats. Dorothy throws two brilliant strikes, but the Cheshire Cat reveals himself as the Big Bad Wolf in disguise and crushes the third pitch for a home run. Dorothy's magic cleats transfer to the wolf's feet. Without her shoes, she can no longer click her heels to travel or touch home plate, since the shoes were what allowed her to "go home."
The wolf begins devouring Storybooks across Ever After. The Wizard authorizes handing Alex over to stop the attacks, and government agents are sent to capture him. Nanny Mae defies orders and fights them off, but during the chase Alex falls 15 stories and dies. He wakes on the pavement without a scratch. During his moment of death, he dreams clearly of a hospital room: He is bald, tubes run from his arms, and his mother sleeps beside his bed. Storybooks and Larks cannot die from physical harm; they cease to exist only when their believers forget them. Alex finally accepts the truth: He is a Lark, the daydream of a real boy who is dying. The wolf later strikes a deal with the Wizard: He joins the tournament as a Reaper in exchange for stopping his attacks, and the order to surrender Alex is rescinded.
Alex develops The Itch, a constant scratching that signals his believer is forgetting him. Overwhelmed by despair, he tries to flee to the Wild Woods, a dark forest at the edge of Ever After where despairing Larks go to tear themselves apart. His teammates restrain him repeatedly, but he eventually escapes. Dorothy, Toad, and Tik-Tok track him into the forest, where the wolf attacks. The wolf reveals his plan: to use his tournament wish to become real, cross into the real world, and eat the real Alex, erasing the Lark permanently. Alex uses Tik-Tok's chest oven to light a torch and ignites the dry forest floor, setting the wolf's fur ablaze with the help of the wolf's own huffing. A flaming paw swats Alex deep into the woods before the wolf retreats.
Alex recovers and promises not to run again, but his Itch worsens and his play deteriorates. Against the Royals, trailing by four in the ninth inning, the Cyclones rally. At the plate with the go-ahead run on base, Alex has an epiphany: Even if he cannot save himself, he can use his wish for someone else. His determination returns, and he belts a game-winning home run.
Before the championship, Alex visits the Wizard's Magic Mirror and sees his dreamer: The real Alex lies bald and wrapped in a blanket, his head in his mother's lap. Alex touches the glass and whispers for his dreamer not to die, asking for just one more day.
The final game pits the Cyclones against the Grimm Reapers at Emerald Stadium. Alex bets the wolf that if the Cyclones lose, he will surrender without a fight; if they win, Dorothy gets her cleats back. The Fairy Godmother, the magical official overseeing the tournament, binds the wager. The Reapers play dirty and take a commanding lead, but Alex turns their own stories against them. Dorothy and Toad bait Baba Yaga, a Reaper witch, into using banned magic, getting her ejected. Br'er Rabbit tricks the dragon out of a brass genie lamp, and the freed genie traps Long John Silver, the Reapers' pirate, inside it. Jack, with a baseball stuffed in his pumpkin head giving him encyclopedic knowledge, hits a grand slam. A hidden ball trick on Rumpelstiltskin, a Reaper, puts the Cyclones ahead.
Then Alex fades away completely, leaving only footprints in the dirt. Dorothy weeps but resolves to finish. The wolf grows enormous, creates a tornado, and steps to the plate wielding a stadium post. Dorothy pitches into the storm, and the wolf pops the ball high into the swirling winds. Alex reappears at first base. Dorothy grabs his hand, but Alex tells her she must let go so he can catch the ball. The wind lifts him into the sky, where he spots the baseball among the debris and grabs it. The Fairy Godmother confirms the catch, and the Cyclones win.
Dorothy's cleats return to her feet. The magicians trap the wolf and free dozens of swallowed Storybooks from his belly. Each Cyclone receives a wish: Toad wants a flying car, Jack wants baseballs to fill his head with knowledge, Pinkerton wants the power of speech, and Dorothy wishes to be happy again. Alex reveals he wished for the real Alex not to be sick anymore, knowing that if the boy recovers, he will no longer need his daydream and Alex will eventually cease to exist. He has wished for his own end to save his dreamer's life. When Alex asks what comes next, Dorothy tells him they need to start practicing for the next tournament. Alex notes his Itch has stopped, suggesting the real boy is getting better, and Dorothy looks toward the future with renewed optimism.