The movie opens with a TV show featuring Chef Auguste Gusteau (Brad Garrett), owner of the best restaurant in Paris, talking about his bestselling cookbook, which proudly bears his mantra "Anyone Can Cook!"
A rat named Remy (voice of Patton Oswalt) begins talking about his life in monologue fashion. Remy states that he has enhanced senses of both taste and smell, which makes him very particular about what he eats. Remy's brother Emile (Peter Sohn) is impressed by this talent, but their father Django (Brian Dennehy) who leads the rats' colony, could care less - until Remy reveals that he can recognize the scent of rat poison in or near food. Django puts Remy to work sniffing and testing food for the rest of the clan. Remy is not happy about the rats having to steal food from the garbage; he would prefer to go to the kitchen and take the "fresh" samples. But Django hates and fears humans so he forbids Remy (and all other members of the clan) to interact with them.
Despite his father's orders, Remy spends several nights in a human home, reading Chef Gusteau's cookbook and watching television programs about cooking. Before long he has a near-expert level of knowledge about food preparation. One day, Remy takes Emile into the kitchen to get some spices that will go with some other food samples they have gathered. Emile hesitates, but agrees to go with his brother. While inside, Remy sees on TV that a famous food critic named Anton Ego (Peter O'Toole), gave Gusteau's restaurant a less-than-stellar review that resulted in the restaurant losing one of its five stars. A heartbroken Gusteau died soon after, which meant the loss of another star according to tradition.
While watching news of Gusteau's death, Remy accidentally wakes the elderly woman who lives in the home which the rats have colonized. Django orders everyone to get away as fast as possible but Remy stays behind to grab Gusteau's book. The rats manage to escape on miniature rafts into a river. Remy uses the cookbook as a flotation device but is separated from the group by a rapid current in the sewers.
Hours later, Remy sits, reading the cookbook, waiting for a sign of his friends and family. Through a fusion of grief, loneliness and hunger, Remy begins to hallucinate that the illustration of Chef Gusteau is talking to him. Gusteau encourages Remy to go up through the sewers and find out where he is now. Remy travels along several pipes and finds that he is in Paris - just in front of Gusteau's restaurant!
Inside Gusteau's, the new head chef Skinner (Ian Holm) meets Alfredo Linguini (Lou Romano), the son of Chef Gusteau's recently-deceased old friend. Linguini gives Skinner a letter written by his mother in the hope of getting a job at the restaurant. Skinner makes Linguini a garbage-boy and tells him to start work immediately.
As Remy watches the action in the kitchen, he spots Linguini accidentally knocking over a pot of soup and trying to cover up his error by adding random ingredients. Knowing that the combination Linguini has forged will be terrible, Remy jumps down and adds his own ingredients to the mixture. Linguini spots Remy and traps him underneath a bowl before he can run away and without anybody else noticing. Skinner spots Linguini messing with the soup and is furious, but he cannot stop the wait staff from serving the soup. A bowl is served to a food critic, who likes the concoction. Skinner still wants to fire Linguini, but another chef, Colette (Janeane Garofolo), sticks up for Linguini. Skinner relents and allows Linguini to stay.
Remy makes another attempt to escape, but this time Skinner spots him and Linguini manages to catch Remy in a jar. Skinner orders Linguini to take the rat away and kill it. Linguini takes Remy to a river but cannot bring himself to dispose of the rat. Linguini knows that the rat was the one who really made the soup and that Skinner will expect a duplication of the recipe. Linguini, seeing that Remy can apparently understand him, takes the rat home and essentially adopts him.
The next morning, Linguini sees that the rat (who he has nicknamed "Little Chef") has cooked breakfast for them both. When they arrive at the restaurant, Linguini tries to find a way to have Remy cook but without anyone else seeing. After a few tries, they find out that Remy can manipulate Linguini like a puppet by pulling on the boy's hair at strategic moments. Deciding that this is their best method, Linguini and Remy spend the next few days practicing cooking in their spare time. Before long they are able to make a perfect duplicate of the soup that captured the critic's attention. Skinner appoints Colette to teach Linguini about the finer points of haute cuisine. Colette does not relish the task at first; she's the only female chef, worked very hard to obtain her position and sees Linguini as a possible threat to her status.
Later that night Skinner meets with an agent. We learn that since Chef Gusteau's death, Skinner has been making a profit by selling out the Gusteau name and image to a line of cheap frozen food. Taking a moment to read the letter from Linguini's mother, Skinner panics and calls his lawyer. The lawyer (Teddy Newton) explains that Gusteau's will stipulates that if no heir can be found after two years (a deadline which expires in a month), Skinner will inherit the restaurant. Apparently the letter from Linguini's mother states that Linguini is Gusteau's son, and should be the rightful heir! Skinner refuses to believe it while the lawyer suggests doing a DNA test as well as a background check.
Colette begins training Linguini about the fine art of cooking, and a rapport develops between the two.
One night, a group of guests asks the head waiter Mustafa (John Ratzenberger) about what is "new". The staff panics, but Skinner decides to have Linguini prepare an old Gusteau-style recipe for sweetbreads. Skinner knows that Gusteau considered that recipe a "disaster" and hopes that it will be Linguini's downfall.
Colette begins to follow the recipe but Linguini (under Remy's manipulations) alters it severely, which angers her. But a few minutes later, Mustafa bursts in and declares that the customers love the new concoction and there are several more orders for it! The other chefs toast Linguini's success later that evening. Skinner, knowing about the rat, brings Linguini into his office and pulls out a bottle of rare Château Latour in an attempt to get Linguini to talk about his "secrets" but gets nowhere.
Meanwhile Remy, resting outside, spots a mysterious figure in the garbage pails. He is stunned to find that it is his brother Emile! Overjoyed, Remy runs inside to steal some ingredients to fix food for his brother. Afterwards, Emile brings Remy to the new colony. Django is overjoyed to find his second son alive. Remy wants to leave the colony (and return to Linguini) but Django is opposed to the idea. Django brings Remy to a storefront that specializes in rat-killing, stating his belief that humans and rats must always be enemies. Remy, however, feels differently. He leaves the colony and goes back to Linguini.
Next morning, Remy finds Linguini still at the restaurant and exhausted. Colette comes in, still angry at Linguini. In an attempt to apologize, Linguini tries to confess his secret to Colette. Remy, desperate to remain hidden, forces Linguini forward so that he ends up kissing Colette. After a few seconds of hesitation, she reciprocates and a genuine attraction between the two begins.
Food critic Anton Ego is in his study when he hears news of Gusteau's renewed popularity. Stunned, he vows to return there and find out what is truly going on.
Skinner's lawyer returns to confirm Skinner's worst fear - Linguini is indeed Gusteau's son. Skinner decides not to tell Linguini and let the will's deadline (a mere 3 days away) pass - after which he can fire Linguini and suffer no ill effects.
Later that night, Remy finds Emile with a few other rats outside the restaurant. When Remy goes inside to find the key to the food locker, he reads the documents and finds out about Linguini's parentage. Remy tries to take the documents, but Skinner spots him escaping again. Despite a thorough chase, Remy gets away and Linguini learns the truth. Skinner is fired, Linguini takes charge of the restaurant and the Gusteau frozen-food line is halted.
At a press conference a few days later, Anton Ego introduces himself to Linguini and promises to come by the restaurant the next night to review Gusteau's once more.
Linguini, growing arrogant, decides to try and work without Remy's help. In anger, Remy arranges for the rest of his rat-clan to raid the restaurant that night. Linguini finds out and throws all the rats out, including Remy.
That evening, Remy and Emile are sniffing for food outside the restaurant when Remy runs into a trap. It turns out that the trap was set by Skinner. Skinner wants Remy to work for him creating new frozen foods.
Ego arrives at the restaurant, and instead of ordering off the menu he challenges the chef to "hit [him] with your best shot." Skinner, eager to see the downfall of Linguini, asks to have the same dish that Ego is served.
Remy, still caged, is freed by his father and brother. Thankful, he returns to the restaurant to help Linguini. One of the chefs spots Remy returning and tries to kill the rat. But Linguini steps in and protects Remy, confessing the truth to everyone. The chefs, stunned, walk out - even Colette. Linguini thinks that there is no hope for Gusteau's.
Django comes in and admits that he was wrong; seeing Linguini stand up for Remy has changed his attitude about humans. Django recruits the entire rat colony to help out - they will follow Remy's orders to prepare the food.
Just then, a health inspector arrives and sees the kitchen full of rats. One group of rats swarms the inspector, tying him up and locking him in the freezer.
Before long, the rats have formed an intricate system and are preparing all the meals for the restaurant. Linguini, knowing that someone will have to wait tables, puts on a pair of roller skates and begins serving the guests.
Colette, having had a change of heart, returns to the restaurant to help Remy and Linguini. She asks what Remy wants to prepare for Ego. Remy selects ratatouille, an older-style recipe not traditionally up to the standards of Gusteau's (Colette calls it a "peasant dish.") Soon enough, the entrée is prepared and served to Anton Ego.
Ego takes a bite of the ratatouille, and immediately has a flashback to his childhood where his mother prepared the same dish to brighten his spirits after a bicycle accident. He is overwhelmed with emotion for the dish. Skinner, furious, storms into the kitchen - and is tied up and thrown into the freezer alongside the health inspector.
Ego's heart is warmed by the fantastic meal, and insists on thanking the chef. Colette tells him that he must wait until all other customers have left. That evening, Ego learns the whole truth from Linguini, Colette and Remy. After leaving the restaurant, Ego writes a fantastic review for Gusteau's - proclaiming the chef to be "the finest in Paris", while neglecting to reveal the chef's true identity.
Unfortunately, the good fortune does not last. The health inspector and Skinner are freed; as a result, Gusteau's restaurant is shut down. And, as an effect, Ego loses his job and a great deal of credibility for promoting a rat-infested restaurant.
Remy, telling this story to a few friends, states that Ego is now working as a small-business investor. It seems that Ego (along with Colette, Linguini and Remy) has opened a bistro named "La Ratatouille" where both humans and rats (in hidden, separate chambers) are both welcome.