In present-day New York City, an Eastern bluebird named Buster runs away from his siblings and he meets an intelligent orange Tyrannosaurus named Rex, who is playing golf. He explains to Buster that he was once a ravaging dinosaur, and proceeds to tell his personal story.
In a prehistoric forest, Rex is terrorizing other dinosaurs when a spaceship lands on Earth with a little alien named Vorb. Vorb captures Rex and gives him "Brain Grain", a special breakfast cereal that vastly increases Rex's intelligence. Rex is given his name and introduced to other dinosaurs that are also anthropomorphized by the magic of Brain Grain: a blue Triceratops named Woog, a purple Pterodactyl named Elsa and a green Parasaurolophus named Dweeb. They soon meet Vorb's employer Captain Neweyes, the inventor of Brain Grain, who reveals his goal of allowing the children of the present time to see real dinosaurs, fulfilling their biggest wishes. He plans to take them to Doctor Julia Bleeb who will guide them to the American Museum of Natural History, and warns them to avoid Professor Screweyes, his insane brother.
Neweyes drops the dinosaurs off in the Hudson River in the present day, but they are unable to meet with Bleeb. Instead, they meet a young boy named Louie, who plans on running away to join the circus. Louie agrees to help the dinosaurs get the dinosaurs to the museum. Riding on Elsa, Louie soon encounters a girl named Cecilia, who is miserable with her life because of her neglectful parents. She agrees to run away with Louie and help the dinosaurs. To prevent mass panic, Louie decides that the dinosaurs need to stay hidden during their journey to the museum. He disguises them as floats in the Macy's Thanksgiving Day Parade. During the parade, Rex hears all the children wishing to see real dinosaurs, so he starts to sing "Roll Back the Rock (To the Dawn of Time)". But when he sees the Apatosaurus balloon coming out in the parade, Rex mistakes it for being real and hand shakes it too tight with his claws, causing its air sealer to pop open. The balloon runs out of air and falls on the dinosaurs, who are otherwise unharmed. When the audience realizes that live dinosaurs are among them, they fly into a panic and the dinosaurs escape and flee to Central Park in a red pick up truck while being pursued by the police and the army at the same time.
Meanwhile, Louie and Cecilia meet Professor Screweyes himself, who is running his "Eccentric Circus". Unaware of Screweyes' sinister nature, the children sign a contract to perform in his circus troupe. However, when the dinosaurs arrive at the circus, Screweyes explains that he delights in scaring people and believes that the dinosaurs would make a great addition to his circus. Using his "Brain Drain", pills that are the polar opposite of his brother's Brain Grain, Screweyes devolves Louie and Cecilia into chimpanzees. When he offers the dinosaurs to consume the pills and join his circus, they reluctantly accept and Screweyes releases Louie and Cecilia. Knowing their friendship will be lost forever, Rex transforms Louie and Cecilia back to their human form by removing the effects of the Brain Drain with his gentle pats. And before leaving, he sadly tells the two children to remember him.
As the kids awake the next morning, they are greeted by a circus clown named Stubbs, who works for Professor Screweyes. Upon seeing the dinosaurs returned to their natural savage states, Louie and Cecilia, with the help of Stubbs, plan to sneak into the night's show and save the dinosaurs. That night, Professor Screweyes opens his circus with the Grand Demon Parade and unveils the dinosaurs before the very eyes of his audience. Screweyes says he can control Rex, and proceeds to hypnotize him. Everyone watching the show gets frightened during the performance, and many run away. However, a crow activated the flare lights, breaking Rex out of the trance on purpose. Realizing he has been tricked, Rex becomes enraged and tries to attack Screweyes. However, Louie steps in and desperately tells Rex that killing Screweyes will not be worth it. When Rex does not understand his words, Louie tearfully begs him to put Screweyes down, telling him to be the "king" (a translation for the word "rex"). Touched by Louie's impassioned pleas, Rex changes back to his intelligent state and releases Screweyes. And to Screweyes' shock, the audience cheered with wonder and joy as Louie hugs Rex, then he and Cecilia also return Elsa, Woog and Dweeb to their kind and friendly natures. A moment later, Captain Neweyes arrives in his ship and congratulates Louie and Cecilia, who proceed to kiss in front of a whole crowd of people. Stubbs announces his resignation from Professor Screweyes' employ. Neweyes, Louie, Cecilia and the dinosaurs board the aircraft, leaving Screweyes to be swarmed upon and kidnapped by the crows.
The dinosaurs spend the rest of their days in the museum, allowing children to see live dinosaurs, and thus fulfilling their wishes. Back in the present, Rex told Buster that he and his fellow dinosaurs are still in the museum. He even explain that Louie and Cecilia reconcile with their respective parents, and the two become a couple. Rex returns Buster to his family before leaving for the museum.