In the summer of 1962, brainy, reserved fifth grader Scott Smalls moves with his parents to the San Fernando Valley, where he has difficulty making friends. He tries to join a group of boys who play baseball daily in a local sandlot, but is embarrassed by his inability to catch or throw the ball. An attempt to learn to play catch with his stepfather, Bill, results in a black eye. Nevertheless, he is invited to join the team by their leader and best player, Benny Rodriguez, who mentors him. When catcher Hamilton “Ham” Porter hits a home run into a backyard, Scott attempts to retrieve the ball but is stopped by the other boys, who tell him of “the Beast”, a junkyard dog supposedly so large and savage that it has become a neighborhood legend. Many baseballs hit into the yard over the years have all been claimed by the Beast, which is kept chained up by its owner, Mr. Mertle.
One particularly hot day, the boys visit the community pool. Michael “Squints” Palledorous has a crush on lifeguard Wendy Peffercorn, and fakes drowning in order to give her a big kiss while she administers Mouth-to-mouth resuscitation, Wendy smiles at Squints as he leaves after she angrily escorted him out for the prank. On the Fourth of July the team plays a night game by the light of the fireworks, and Scott observes that although to the rest of them baseball is just a game, it is Benny’s true passion. Later, they are challenged to play against a rival Little League team whom they handily defeat. To celebrate, they visit a fair where they try chewing tobacco and ride a spinning carnival ride; the combination causes them to vomit all over themselves and others.
One day, Benny hits the team’s only baseball so hard that he knocks the cover off. With Bill away on business, Scott borrows a baseball from his trophy room that is autographed by legendary player Babe Ruth. Being ignorant of baseball history, Scott does not realize the ball’s value, and hits his first home run, sending it into the Beast’s yard. When the other boys learn of the autograph, they tell Scott its value and make several attempts to get the ball out of the yard using makeshift retrieval devices, but each is destroyed by the Beast. Benny has a dream in which the spirit of Babe Ruth advises him to retrieve the ball himself, and that this will be the moment that makes him a legend.
Benny goes over the fence and “pickles” the Beast to retrieve the ball, but the English Mastiff breaks its chain and leaps over the fence in pursuit. It chases Benny through town, resulting in several comedic situations, and eventually back to the sandlot. Benny jumps back into Mr. Mertle’s yard, but the Beast crashes through the fence, which falls down on top of it. Scott and Benny lift the fence to free the dog, who shows gratitude by leading them to its stash of baseballs. They meet Mr. Mertle, who turns out to be a former baseball player who played with Babe Ruth but went blind after being struck by a baseball. He kindly trades them the chewed-up ball for one autographed by all of the 1927 New York Yankees. Scott gives this ball to Bill, and their father-and-son relationship improves. The boys continue to play baseball on the sandlot, with the Beast whose real name is Hercules—as their mascot.
Over the next few years, the sandlot kids go their separate ways. Benny’s exploit with the Beast earns him the nickname “the Jet”, and he goes on to play for the Los Angeles Dodgers. Scott becomes a sports commentator, and covers a game against the San Francisco Giants in which Benny successfully steals home. Celebrating his victory, the two exchange thumbs up.