The mouse Despereaux is born in a castle under unusual circumstances: his ears are very large, and unlike normal baby mice, he’s born with his eyes wide open. His parents, Antoinette and Lester, are sure he’ll die like the other mice in his litter—but though Despereaux is sickly, he lives. His siblings Furlough and Merlot try to teach Despereaux how to be a proper mouse, but Despereaux isn’t interested in being a proper mouse. Instead, he enjoys music, pretty light, and reading a book in the library about a knight rescuing a beautiful maiden.
One day, Despereaux is so desperate to hear the human King Phillip play and sing a song for his daughter, the Princess Pea, that he leaves his hole and sits at the king’s feet. The princess touches his head—and at this moment, Furlough sees what’s happening and runs to tell Lester. So he doesn’t see the Pea pick Despereaux up, or see Despereaux fall in love with the princess. The king yells at Despereaux to go away, so Despereaux breaks the most important mouse rule and speaks to the Pea. He tells her he honors her, just like the knight says in the library book.
Lester summons the Mouse Council and shares what Furlough saw, and the Mouse Council calls for Despereaux. For his crimes, Despereaux is sent to the dungeon and to the rats, with a red thread tied around his neck by the threadmaster to indicate his criminality. Furlough is the mouse to kick Despereaux down the stairs into the dungeon, where Despereaux tries to comfort himself by telling himself a story. The human jailer, Gregory, picks Despereaux up and agrees to save Despereaux’s life in exchange for a story.
Stepping back in time a few years, a rat named Chiaroscuro and nicknamed Roscuro is born in the dungeons. Unlike most rats, which love darkness and suffering, Roscuro becomes obsessed with light. Though his mentor, Botticelli Remorso, tries to convince Roscuro to be a good rat and torture a new prisoner, Roscuro discovers after stealing the prisoner’s red tablecloth that he doesn’t like torturing people. He wants light. To satisfy his craving, he goes upstairs and invites himself to a party that the king and queen are throwing. But the Princess Pea sees Roscuro hanging from a chandelier. She shouts that there’s a rat, and hearing the word “rat” causes Roscuro to feel intense self-loathing. He falls into the queen’s soup, causing her to die of surprise, and then leaves the room. But as he does, he looks back—and the angry look on the Pea’s face causes Roscuro’s heart to break and heal incorrectly. He steals the queen’s spoon on his way out and vows to get revenge on the princess. The king, meanwhile, outlaws rats, soup, and all soup-making and soup-eating implements after his wife’s death.
The story steps back in time again, to when a poor girl named Miggery Sow is six years old. Nobody cares what Mig wants, so after her mother dies, her father sells her to a man called Uncle for a red tablecloth, a hen, and cigarettes. Uncle hits Mig’s ears so hard she eventually becomes deaf, and her ears resemble cauliflower. When Mig is seven years old, she witnesses the royal family riding past Uncle’s sheep field and begins to hope that one day she can be a princess, just like the glittering Princess Pea.
When Mig is 12, a soldier comes to Uncle’s house to confiscate his soup supplies, as the queen has just died. When he learns that Uncle owns Mig, he insists on taking her as well—slavery is illegal in the Kingdom of Dor. Mig becomes a paid servant at the castle, meets the princess, and fails at most jobs assigned to her.
The three storylines converge on the day that Cook tasks Mig with taking Gregory the jailer’s meal to him. On the way down to the dungeon, Mig sings a song about wanting to be a princess. After eating, Gregory sneezes into his napkin, surreptitiously hiding Despereaux in it. Roscuro, having heard Mig’s song, hatches a plan to get revenge on the princess by manipulating Mig—and on the way back upstairs with the supposedly empty tray, he invites Mig to work with him. Despereaux hears Roscuro describe his plan.
Back in the kitchen, Cook reaches for the napkin on Mig’s empty tray—and Despereaux falls into a cup of oil. Mig fishes him out and attempts to cut his head off with a knife, but instead, she just cuts his tail off. Despereaux flees to the pantry, where he sleeps on a bag of flour and dreams about the knight in shining armor. But the suit of armor in the dream is empty, and Despereaux cries.
Despereaux sleeps for a full 24 hours and while he’s asleep, Roscuro puts his plan into action. After chewing the rope Gregory uses to keep from getting lost in the maze-like dungeon (which leads to Gregory’s death), he and Mig go to the Pea’s room at night with a kitchen knife. They tell the princess that they’re going to the dungeon. There, Mig explains, the two girls will switch places so Mig can be a princess and the Pea can be a servant. Seeing no choice but to give in, Pea puts on the glittery dress Roscuro asks her to and follows Mig to the dungeon—but she empathizes with Mig, who clearly wants to be a princess more than anything. Once they’re in the dungeon, however, Roscuro reveals that he won’t let either girl return upstairs; Mig will never be a princess. The Pea, seeing how devastated Mig is, asks what Mig wants. This is the first time anyone has ever asked Mig this, and Mig shouts that she just wants her mother. The Pea also wants her mother, so the girls refuse to work against each other anymore. They sit with Roscuro for a day and a night.
The king sends men to the dungeon to look for the Pea, but they only discover Gregory’s body. At this point, Despereaux wakes up after overhearing Cook and another servant talking about what’s happened, and he realizes he’s too late. While wandering the castle in search of the king, Despereaux walks in on the Mouse Council. Lester begs Despereaux to forgive him for his role in sending Despereaux to the dungeon—and Despereaux does. Despereaux then attempts to tell the king where the Pea is, but the king refuses to listen to a rodent. Despereaux realizes that he can be the knight in shining armor himself.
Despereaux seeks out the threadmaster, who agrees to give Despereaux a spool of red thread (so Despereaux can find his way through the dungeon) and a needle to use as a sword. It takes Despereaux hours to roll the spool through the castle, and he reaches the kitchen at midnight. There, he finds Cook illegally making soup—and she sees Despereaux. But rather than kill him, she gives him a saucer of the soup and opens the dungeon door for him.
As Despereaux makes his way down the dungeon stairs with the spool, the spool rolls away from him. At the bottom of the stairs, Botticelli Remorso meets Despereaux and agrees to lead him to the princess; secretly, he plans to eat Despereaux once they reach the princess. But as Despereaux runs for the Pea, Roscuro gets in his way—and to save Despereaux, Mig tries to kill Roscuro but ends up cutting his tail off. Despereaux considers killing Roscuro, but realizes doing so won’t fix anything. And smelling the soup on Despereaux’s whiskers, Roscuro admits that he just wants some light for himself. The Pea forgives Roscuro and invites him upstairs to eat soup.
After this, the Pea gives Roscuro access to the castle’s main floors, and seeking to atone for his misdeeds, Roscuro reunites Mig with her father—the prisoner he tortured. Despereaux and the Pea don’t get married, but they do become friends.