Babe, an orphaned piglet, is chosen for a "guess the weight" contest at a county fair. The winning farmer, Arthur Hoggett, brings him home and allows him to stay with a Border Collie named Fly, her mate Rex and their puppies, in the barn.
A duck named Ferdinand, who crows as roosters are said to every morning to wake people so he will be considered useful and be spared from being eaten, persuades Babe to help him destroy the alarm clock that threatens his mission. Despite succeeding in this, they wake Duchess, the Hoggetts' cat, and in the confusion accidentally destroy the living room. At the barn meeting, Rex sternly instructs Babe to stay away from Ferdinand (now a fugitive) and the house. Sometime later, when Fly's puppies are put up for sale, Babe asks if he can call her "Mom".
Christmas brings a visit from the Hoggetts' relatives. Babe is almost chosen for Christmas dinner but a duck is picked instead after Hoggett remarks to his wife Esme that Babe may bring a prize for ham at the next county fair. On Christmas Day, Babe justifies his existence by alerting Hoggett to sheep rustlers stealing sheep from one of the fields. The next day, Hoggett sees Babe sort the hens, separating the brown from the white ones. Impressed, he takes him to the fields and allows him to try and herd the sheep. Encouraged by an elder ewe named Maa, the sheep cooperate, but Rex sees Babe's actions as an insult to sheepdogs and confronts Fly in a vicious fight for encouraging Babe. He injures her leg and accidentally bites Hoggett's hand when he tries to intervene. Rex is then chained to the dog house, muzzled and sedated, leaving the sheep herding job to Babe.
One morning, Babe is awakened by the sheep's cries and finds three dogs attacking them. Although he manages to scare them off, Maa is mortally injured and dies as a result. Hoggett arrives and, thinking that Babe killed her, prepares to shoot him. Fly is so anxious to find out whether he is guilty or innocent that, instead of barking orders at the sheep, she talks to them to find out what happened. Learning the truth, she barks to distract Hoggett, delaying him until Esme mentions that the police say feral dogs have been killing sheep on neighboring farms and asks him why he has taken his shotgun out.
When Esme leaves on a trip, Hoggett signs Babe up for a local sheepherding competition. As it is raining the night before, Hoggett lets him and Fly into the house. However, Duchess scratches him when he tries to speak to her, so Hoggett immediately confines her outside. When she is let back in later, she gets revenge on Babe by revealing that humans eat pigs. Horrified, he runs out to the barn and learns from Fly that this is true. The next morning, Fly discovers that Babe has run away. She and Rex alert Hoggett and they all search for him. Rex finds him in a cemetery and Hoggett brings him home. However, he is still demoralized and refuses to eat. Hoggett gives him a drink from a baby bottle, sings to him "If I Had Words" and dances a jig for him. This restores Babe's faith in Hoggett's affection and he begins eating again.
At the competition, Babe meets the sheep that he will be herding, but they ignore his attempts to speak to them. As Hoggett is criticized by the bemused judges and ridiculed by the public for using a pig instead of a dog, Rex runs back to the farm to ask the sheep what to do. They give him a secret password, first extracting a promise that he will treat them better from now on. He returns in time to convey the password to Babe, and the sheep now follow his instructions flawlessly. Amid the crowd's acclamation, he is unanimously given a perfect score. While he sits down next to the farmer, Hoggett praises him with the standard command to sheep dogs that their job is done, "That'll do, Pig. That'll do."