11-year-old Charlie Bucket lives in poverty in a small house with his parents and four grandparents. His grandparents share the only bed in the house, located in the only bedroom. Charlie and his parents sleep on mattresses on the floor. One day, Grandpa Joe tells him about the legendary and eccentric chocolatier Willy Wonka and all the wonderful candies he made until the other candymakers sent in spies to steal his secret recipes, which led him to close the factory to outsiders. The next day, the newspaper announces that Wonka is reopening the factory and has invited five children to come on a tour, after they find a Golden Ticket in a Wonka Bar. Each ticket find is a media sensation and each finder becomes a celebrity. The first four golden tickets are found by the gluttonous Augustus Gloop, the spoiled and petulant Veruca Salt, the gum-addicted Violet Beauregarde, and the TV-obsessed Mike Teavee.
One day, Charlie sees a fifty-pence coin (dollar bill in the US version) buried in the snow. He buys a Wonka Bar and finds the fifth golden ticket. The ticket says he can bring one or two family members with him and Charlie's parents decide to allow Grandpa Joe to go with him.
Wonka takes the kids and their parents go inside where they meet Oompa-Loompas, a race of small people who help him operate the factory since he rescued them from poverty and fear in their home country Loompaland. The other kids are ejected from the tour in comical, mysterious and painful ways, befitting their various greedy characters and personalities. Augustus gets sucked up a pipe after falling into the Chocolate River in the Chocolate Room, Violet inflates into a giant blueberry after sampling an experimental three-course chewing gum meal of tomato soup, roast beef and blueberry pie in the Inventing Room, Veruca is thrown down the rubbish chute in the Nut Room after she tries stealing a nut-testing squirrel and they consider her a "bad nut", and Mike gets shrunk after he tries to be the first person to be sent by television in the Television Room's Television Chocolate Technology, during each elimination, the Oompa-Loompas sang a morality song about them. With only Charlie remaining, Wonka congratulates him for "winning" the factory and, after explaining his true age and the reason behind his Golden Tickets, names Charlie his successor. They ride the Great Glass Elevator to Charlie's house while the other four children go home (Augustus squeezed thin, Violet all blue in the face, Veruca covered in trash, and Mike stretched ten feet tall). Afterwards, Wonka invites Charlie's family to come live with him in the factory.