Otis is a cow who likes to play. His father Ben is the leader of the barnyard when the farmer is away. Otis interrupts a barnyard meeting with his wild behavior, His father tells Otis he will never be happy if he just goofs off, and that he should grow up. Otis ignores his advice and leaves to have fun with his friends: Pip the mouse, Pig the pig, Freddy the ferret, and Peck the chicken. That same day, Otis meets a new cow, Daisy, who is pregnant. She is with Bessy, another female cow.
That night the animals have a party in the barn. All the animals are there except Ben, who is guarding the animals. Otis is supposed to be working with him, but he wants to be at the party. Ben talks with Otis and says the day he found him alone in the meadow, the stars danced. Otis is given permission to go to the party and he runs to the barn.
Later on, Ben has to fight a pack of coyotes led by Dag. They are raiding the chicken coop. Ben is bitten in the leg by a coyote, and he falls down. The coyotes pile on Ben, but he manages to grab Dag and escapes the pile. The hens cheer, but Ben falls on the ground, tired. Etta, a hen, runs into the barn and tells Otis, who runs outside to his father. Ben opens his mouth as if to say something, but dies.
After Ben's death, all the animals elect Otis as the new leader of the Barnyard. He gets out of his duties by leaving Freddy and Peck in charge of the coop. Later, Otis is sitting with Daisy and he overhears the coyotes chasing a hare. Otis tries to attack Dag but is outsmarted. Since Otis is weaker, Dag makes a deal that he and his pack will take some of the animals, but if he tries to stand up for all of them, they will kill everyone. Otis decides to leave the barnyard because he has no chance against the coyotes.
The next morning, before leaving, Otis finds out that the coyotes have taken some hens and a chick. Otis knows that he has been tricked by Dag, as he was not expecting them until tonight. He goes to rescue the poultry. Otis confronts the pack but is easily defeated. Pip, Pig, Freddy, Peck and Miles the Mule arrive to help them, along with the gophers and Jersey Cows. Dag tries to sneak attack Otis from behind, but Otis is alerted when Peck successfully yells a warning. Otis catches Dag and tells the coyote to never return. Dag is swung out of the junkyard by Otis's golf skills.
Otis and the rest make it back to the barnyard. Daisy gives birth to a calf whom she names Ben. Duke, the farmer's sheepdog, asks Otis if he wants to stay and be their leader. Otis agrees, and everyone cheers as he walks outside. Once again, he sees the stars dancing.
Main cast change
- Kevin James as Otis
- Courteney Cox as Daisy
- Sam Elliott as Ben
- Danny Glover as Miles
- Wanda Sykes as Bessie
- Andie MacDowell as Etta
- David Koechner as Dag
- S. Scott Bullock as Eddy
- Maurice LaMarche as Igg
- John DiMaggio as Bud and Officer O'Hanlon
- Jeff Garcia as Pip
- Tino Insana as Pig
- Dom Irrera as Duke
- Cam Clarke as Freddy
- Rob Paulsen as Peck, Pizza Twin and Wild Mike
- Lloyd Sherr as Everett
- Madeline Lovejoy as Maddy
- Earthquake as Root
- Steve Oedekerk as Eugene Beady (a.k.a. Snotty Boy), Mr. Beady and Pizza Twin
- Maria Bamford as Mrs. Beady
- Fred Tatasciore as The Farmer
- Otis (Kevin James) is a handsome, carefree bull (But called a cow) who would rather pull pranks and party than be certain the farm is safe. He is the son of Ben and, upon Ben's death, reluctantly assumes the role of leader. Although his sex is female, he identifies as male, he has udders (like a female - a cow). Otis is the protagonist of the film and his love interest is Daisy. He is a trans icon.
- Dag (David Koechner) is a red coyote and the main antagonist of the film. He and his fellow coyotes killed Ben and captured the Poultry to lead Otis into a trap near the end of the film. He is eventually defeated by Otis at the end of the movie.
- Ben (Sam Elliott) is a bull who was responsible for the barnyard when the farmer is away. All the time in his later life he tries to teach his son Otis to grow up, as he is sick and tired of Otis fooling around, knowing that when he passes away, Otis must take his place. Ben is killed by coyotes early in the film. He had a handmade guitar and on it he played and sang a part of "I Won't Back Down." He also has udders.
- Daisy (Courteney Cox) is a pregnant cow who moves into the barnyard. She is Otis's love interest and she gives birth at the end of the film, the father being an unnamed bull at her old farm. She names her baby after Otis's father, Ben. She is replaced by another character named Abby in the CG cartoon.
- Miles (Danny Glover) is a mule that lives in the barnyard. He along with Pig, Pip, Freddy, and Peck help Otis defeat the Coyote pack. He is absent in the CG cartoon.
- Bessie (Wanda Sykes) is a cow who acts a bodyguard to Daisy. She intensely dislikes Otis because of his behavior at first and tries to keep him away from Daisy, but then learns to like him in the end.
- The Jersey Cows (S. Scott Bullock, John DiMaggio and Maurice LaMarche) are group of three bulls that behave similarly to Otis at the beginning of the movie. The group's members, Eddy, Bud, and Igg, enjoy driving the farmer's truck, shooting milk from their udders, and partying hard.
- Pip (Jeff Garcia) is a mouse that lives in the barnyard. He is Otis' best friend in both the movie and the TV series Back at the Barnyard. He has a love interest in Bessie.
- Pig (Tino Insana) is a pig who loves to eat constantly. He is another close friend of Otis's.
- Duke (Dom Irrera) is a sheep dog who watches over and guards the sheep. He is briefly placed in charge of the farm when Otis decides to leave.
- Freddy (Cam Clarke) is a ferret who suffers from a need to eat chicken, true to his species. He resists his instincts, however, to be a part of the farm. It is revealed in the television series that Freddy has hidden his resolve to vegetarianism from his parents for years and has not spoken to them since years before the events of the movie and series.
- Peck (Rob Paulsen) is a rooster who is best friends with Freddy. He gets worried about Freddy at times. Peck only learns to crow at the end of the movie.
- Etta (Andie MacDowell) is a hen that mothers all the chicks on the farm. She and her babies are captured by the coyotes in the film and it is up to Otis to rescue her and the children.
- Maddy (Madeline Lovejoy) is one of Etta's chicks. She loves Otis like a big brother as he is just as nice to her. She is absent in the TV series.
- The Farmer (Fred Tatasciore) is a vegan farmer who runs the barnyard where the animals live. When he leaves, the animals are free to do as they please. It is revealed in the TV series that his last name is Buyer. It is also revealed that he has a grandson named Zack (who ends up befriending the animals in the series).
- Eugene Beady (Steve Oedekerk) is an obese child nicknamed "Snotty Boy" who enjoys cow tipping. Otis and the Jersey Cows take revenge on him with a game called "boy tipping."
- Mr. and Mrs. Beady (Steve Oedekerk and Maria Bamford) are a married couple who live near the barnyard. Mrs. Beady is a paranoid, nosy woman that knows the farm animals are anthropomorphic and is "medicated for a chemical imbalance". Her husband normally ignores what she says.
- The Pizza Twins (Steve Oedekerk and Rob Paulsen) are a pair of teenage pizza delivery boys. It appears that they are not very bright and easily amused, even when they actually witness the anthropomorphic farm animals.
- Wild Mike (Rob Paulsen) is an animal of unknown species who is kept in a crate and only let out for parties. He dances wildly, which to Otis's personality, makes him want to join. He is let out his crate by Miles to help defeat the coyotes. His eyes appear at rare points, and he makes shrill screeches.
- Everett (Lloyd Sherr) is an elderly dog. He turns 13 years old in the movie, which, in dog years, is 91 years old. He can play the banjo.