Charlie Bucket is a kind and loving boy living in poverty with his parents and four bedridden grandparents. They all rely on his father for income, employed at a toothpaste factory, responsible for putting the caps on the tubes. Down the street is Willy Wonka's chocolate factory, which reopened after industrial espionage forced him into seclusion and to sack his employees. Charlie's Grandpa Joe worked for Wonka before the termination.
Wonka announces a contest whereby children that find five Golden Tickets hidden in Wonka Chocolate bars will be given a tour of the factory and one a chance to be presented with an unknown grand prize. Four tickets are quickly found: the greedy and gluttonous Augustus Gloop from Düsseldorf; the spoiled and rotten Veruca Salt from London; the competitive and boastful Violet Beauregarde from Atlanta; and the arrogant and aggressive Mike Teavee from Denver. Charlie hopes to find a ticket but chances are small as money is tight so the best has to be made of is his annual birthday present of one Wonka chocolate bar and a bar bought by Grandpa Joe's Money. All hope is crushed when the last ticket is claimed in Russia. Charlie, on finding some money in the street, just intends to enjoy one chocolate bar when news breaks that the last ticket was fake. Charlie finds the bar he just bought has the last Golden Ticket. Bystanders attempt to separate him from it, only for the shopkeeper to see that he keeps the ticket and gets back home with it.
Grandpa Joe offers to accompany Charlie on the tour, but Charlie explains how he was offered money for the ticket and intends to sell it. Grandpa George reminds Charlie that money is far more common than the tickets, and convinces Charlie to keep it. The visitors find Wonka to be peculiar, lonely and acting odd at the mention of "parents". The tour shows how fantastical the factory operates under the efforts of the short humans called Oompa-Loompas. The other four children succumb to temptation, and end up being caught in the factory workings and have to be safely recovered by the Oompa-Loompas, albeit in worse shape than at the start of the tour: Augustus falls into a river of chocolate and sucked up a pipe before being rescued from the fudge processing center; Violet expands into an oversized blueberry when she tries an experimental piece of chewing gum; Veruca is thrown away as a "bad nut" by trained squirrels; and Mike is shrunk down to a few inches tall after being the first person transported by Wonka's new television advertising invention.
Charlie is congratulated as the only remaining child and the winner of the grand prize, Wonka's heir to the factory. Unfortunately, Wonka stipulates that Charlie's family has to stay behind so Charlie rejects the offer. Charlie learns that Wonka had a troubled past with his father, Wilbur Wonka; a dentist. Willy was forbidden from eating candy of any type or quantity and had torture device-like braces affixed to his teeth. But once Willy got a taste, he wanted to become a confectioner, against his father's wishes and He left home to follow his dream. Wonka later returned to find his father and home completely gone. Wonka's candy's are selling poorly and comes to associate his unhappiness with the sorry financial state of his company, so he makes an effort to find Charlie who locates Wilbur. When they visit, it appears that despite his strict avoidance of candy, the dentist has followed Willy's success and they reconcile. Wonka allows Charlie's family to move into the factory while he and Charlie plan new product lines to produce.