Filming took place in Munich in 1970, and the film was released on June 30, 1971. It received positive reviews, but it was a box office disappointment. However, it developed into a cult film due to its repeated television airings and home video sales. In 1972, the film received an Academy Award nomination for Best Original Score.
After school, kids go to a local candy shop, where the owner Bill serves chocolate to the kids. Charlie Bucket, saddened that he has no money, stares through the window as the owner sings about candy. The newsagent Mr. Jopeck, for whom Charlie works after school, gives him his weekly pay, which Charlie uses to buy a loaf of bread. On his way, he passes Wonka's chocolate factory. A mysterious tinker tells him (referring to the factory) "nobody ever goes in ... and nobody ever comes out!" He brings the bread back to his widowed mother, Grandpa Joe and his other three bedridden grandparents. That night, he tells Grandpa about the tinker and what he said, and Grandpa Joe tells him about Wonka and how spies were trying to steal his life's work. Wonka closed the factory, but three years later he started selling candy again and is still unseen to this day.
One day, the family, along with the rest of the world, learns that Wonka has hidden five Golden Tickets in his Wonka Bars. The finders of these special tickets will be given a full tour of his factory, as well as a lifetime supply of chocolate to the "winner". Charlie wants to take part in the search, but cannot afford to buy vast quantities of chocolate bars like other participants. Four of the tickets are found by: Augustus Gloop, a gluttonous German boy; Veruca Salt, a spoiled English girl; Violet Beauregarde, a gum-chomping American girl; and Mike Teevee, a television-obsessed American boy. As they find their tickets, a sinister-looking man is observed whispering in their ears, to whom they listen attentively despite their preoccupations with their particular obsessions. Charlie's hopes are dashed when news breaks that the final ticket had been found by a Paraguayan millionaire.
The next day, as the Golden Ticket craze ends, Charlie finds some money in a gutter and uses it to buy a Wonka Bar. Since he still has some change left after eating the chocolate, he uses it to buy a second bar, which he intends bringing home. On leaving the candy store, he learns from people talking that the ticket found by the millionaire was a forgery and that one ticket is still about somewhere. When Charlie opens the bar, he finds the real golden ticket and races home to tell his family, but is confronted by the same man who had been seen whispering to the other four winners. The man introduces himself as Arthur Slugworth, a rival confectioner who offers to pay Charlie a large sum of money for a sample of Wonka's latest creation, the Everlasting Gobstopper.
Grandpa Joe practically leaps out of bed to serve as Charlie's tour chaperone and Charlie tells him about his meeting with Slugworth. The next day, Wonka greets the children and their guardians at the factory gates and leads them inside, requiring each to sign a contract before the tour can begin. Inside is a psychedelic wonderland full of chocolate rivers, giant edible mushrooms, lickable wallpaper and other ingenious inventions and candies, as well as Wonka's workers, the small, orange-skinned, green-haired Oompa-Loompas. While in Wonka's Inventing Room, the remaining children are each given a sample of Wonka's Everlasting Gobstoppers.
As the tour progresses, each of the first four children ignore Wonka's warnings, resulting in serious consequences: Augustus is sucked through a chocolate extraction pipe system and sent to the Fudge Room, having fallen into a chocolate river from which he was trying to drink; Violet transforms into a giant blueberry after trying an experimental piece of Three-Course-Dinner Gum; Veruca is rejected as a "bad egg" and falls down a garbage chute in the Chocolate Golden Egg Sorting Room; and Mike is shrunk to only a few inches in height after being transmitted by "Wonkavision", a broadcasting technology that can send objects through television instead of pictures. The Oompa-Loompas sing a song after each incident, describing that particular child's poor behavior.
During the tour, Charlie also succumbs to temptation along with Grandpa Joe, as they stay behind in the Bubble Room and secretly sample Fizzy Lifting Drinks. They begin floating skyward and are nearly sucked into a ceiling-mounted exhaust fan. To avoid this grisly fate, they burp repeatedly until they return to the ground. Wonka initially seems unaware of this incident. When Charlie becomes the last remaining child on the tour, Wonka dismisses him and Grandpa Joe and leaves for his office. Grandpa Joe returns to ask about Charlie's lifetime supply of chocolate, Wonka angrily reveals that Charlie had violated the contract signed before the tour began by sampling the Fizzy Lifting Drinks and thus forfeited his prize, and Wonka dismisses them. Grandpa Joe vows to give Slugworth the gobstopper in revenge. Charlie, however, is unable to bring himself to hurt Wonka and places the gobstopper on his desk.
Wonka recants and begs for his guests' forgiveness. He reveals that "Slugworth" is actually an employee named Wilkinson, whose offer to buy the gobstopper (as well as Wonka's tirade) was all part of a morality test for the Golden Ticket winners, and Charlie was the only one who passed the test. The trio enter the "Wonkavator", a multi-dimensional glass elevator, and fly out of the factory in it. As they soar over the city, Wonka tells Charlie that his actual prize is not just the chocolate but the factory itself, as the Golden Ticket search was created to help Wonka search for an honest and worthy child to be his heir. Charlie and his family will reside in the factory and take over its operation when Wonka retires.
- Gene Wilder as Willy Wonka
- Peter Ostrum as Charlie Bucket
- Jack Albertson as Grandpa Joe
- Julie Dawn Cole as Veruca Salt
- Paris Themmen as Mike Teevee
- Denise Nickerson as Violet Beauregarde
- Michael Bollner as Augustus Gloop
- Diana Sowle as Mrs. Bucket
- Dodo Denney as Mrs. Teevee
- Leonard Stone as Mr. Sam Beauregarde
- Roy Kinnear as Mr. Henry Salt
- Ursula Reit as Mrs. Gloop
- Günter Meisner as Arthur Slugworth/Mr. Wilkinson
- Aubrey Woods as Bill, the Candy Man
- David Battley as Mr. Turkentine
- Peter Capell as Tinker
- Werner Heyking as Mr. Jopeck
- Peter Stuart as Winkelmann
- Ernst Ziegler (uncredited) as Grandpa George
- Tim Brooke-Taylor (uncredited) as Computer Man
- Rusty Goffe (uncredited) as Oompa Loompa
- Pat Coombs (uncredited) as Mrs. Henrietta Salt
- Michael Goodliffe (uncredited) as Mr Teevee