A young boy resides within the pages of a comic book, possessing the incredible ability to bring to life anything he imagines, including his friends, Moose and Porcupine. Fast forward to the present day, we find Harold, now an adult, humorously addressing the all-knowing [narrator](alfred-molina) as "old man." Everything changes when the narrator mysteriously vanishes. Determined to find him, Harold uses his trusty purple crayon to draw a door that leads him into the real world, with Moose joining him on this extraordinary quest, while Porcupine remains behind.
As they venture into this new world, Harold and Moose pedal away on a bike Harold conjured with his crayon. They embark on a mission to locate the old man, whom Harold believes to be his father. During their adventure, they encounter Terri, [Mel's](zooey-deschanel) mother, who unintentionally collides with the bike, causing a flat tire. In a stroke of whimsy, Harold draws a new bike right before Terri’s bewildered eyes, unaware of how he achieved it. Captivated by their charm, Mel convinces Terri to let the duo stay temporarily in a room above her garage.
As night falls, Mel and Harold bond downstairs, sharing stories while Harold breaks off a piece of his crayon and gifts it to Mel. The next morning, Terri tells Harold and Moose they need to depart as Mel heads to school. However, Mel insists on joining their adventure to locate Harold's father. Thus, the trio makes their way to the local library, where they meet [Gary](jemaine-clement), a librarian struggling to articulate his lengthy ideas and who happens to harbor a crush on Terri. The children enlist Gary's help in finding Harold's dad through the internet, but their efforts yield no results.
Upon leaving the library, Harold creatively draws an airplane that displays Terri's phone number in the sky, summoning the old man. Meanwhile, Terri experiences a flurry of unexpected calls from strangers and learns that Mel has been implicated in a bullying incident at school, prompting a call for her to return home immediately. While trying to assist Terri at work, Moose's mischief results in her getting fired, but it turns out she wasn't fond of her job anyway.
The newfound friends wander around town, where Harold learns about Terri's aspiration to be a pianist and draws a piano for her. They reconvene with Gary, who clarifies that the "old man" they’ve been seeking is none other than author [Crockett Johnson](alfred-molina). Amidst the adventure, they reconcile with Porcupine, who had been arrested for a leather jacket he "borrowed." However, with Harold's crayon, they ingeniously escape their predicament.
When they finally reach Crockett's house, they discover the unfortunate news that he has passed away. This revelation deeply saddens Harold, causing his imaginative creations, including Moose and Porcupine, to start fading. In an emotional confrontation, Gary persuades Harold to relinquish his crayon, which he does. Seizing the opportunity, Gary imprisons Harold and dons a fantasy warrior facade. But Mel arrives and cleverly utilizes the crayon piece from earlier to liberate both himself and Harold.
The scene escalates as Harold and Mel confront Gary, who has used Harold's crayon to build his own fantastical realm, which quickly turns chaotic—a battle ensues for the crayon. In a moment of desperation, Gary swallows the crayon piece, gaining fantastical powers that transform the landscape into molten lava.
Mel calls upon his own imaginary friend, Carl, and together they manage to make Gary spit out the crayon, restoring everything to normal. In a final act of grace, Harold helps Gary pursue his own dream by drawing a door for him, leading him into a beautiful fantasy world before it is unfortunately burned by Carl.
As the tale unfolds, Harold, Moose, Porcupine, Mel, and Terri take a thoughtful trip to a museum dedicated to Crockett Johnson's work. There, Harold discovers a profound note revealing the true essence of his creation. Ultimately, Harold, Moose, and Porcupine return to their own dimension, leaving behind a pack of Crayola crayons for Mel, enabling him to explore his own imaginative adventures.