Charlie and the Chocolate Factory (1964) is a children's book by British author Roald Dahl. The story features the adventures of young Charlie Bucket inside the chocolate factory of eccentric candymaker Willy Wonka.
Charlie and the Chocolate Factory was first published in the United States by Alfred A. Knopf, Inc. in 1964, and in the United Kingdom by George Allen & Unwin in 1967. The book was adapted into two major motion pictures: Willy Wonka and the Chocolate Factory in 1971, and Charlie and the Chocolate Factory in 2005. The book's sequel, Charlie and the Great Glass Elevator, was written by Roald Dahl in 1972. Dahl had also planned to write a third book in the series, but had never finished it.
The story was originally inspired by Roald Dahl's experience of chocolate companies during his schooldays. Cadbury would often send test packages to the schoolchildren in exchange for their opinions on the new products. At that time (around the 1920s) Cadbury and Rowntree's were England's two largest chocolate makers, and they each often tried to steal trade secrets by sending spies into the other's factory, posing as employees. Because of this, both companies became highly protective of their chocolate making processes. It was a combination of this secrecy and the elaborate, often gigantic, machines in the factory that inspired Roald Dahl to write Charlie and the Chocolate Factory.
Charlie Bucket, a nice boy from a poor family, lives with his parents and both sets of elderly grandparents (Grandpa Joe, Grandma Josephine, Grandpa George and Grandma Georgina). From these four, especially Grandpa Joe, he hears stories about the candymaker Willy Wonka and the chocolate factory he built in Charlie's hometown. As time passed, rival chocolate makers sent in spies, posing as workers, in order to steal his recipes. Frustrated by this, Mr. Wonka decided to send home his workers and close the factory. Years of silence passed until one day, when the factory mysteriously came back to life. The gates remain locked however; the factory has resumed operations with workers whose identity is a mystery. Nobody, including Wonka, is seen going in or out of the factory anymore.
One day, the headline of Mr. Bucket's evening paper states that Wonka is holding a worldwide contest, in which five Golden Tickets are hidden under the wrappers of his candy bars; the prize for those who find them is a day-long tour of the factory and a lifetime supply of chocolate. The contest becomes a worldwide mania, with people resorting to increasingly desperate and unscrupulous measures to find the tickets, and anyone who succeeds becomes front-page headline news and a worldwide celebrity. Charlie and four bad children, the gluttonous Augustus Gloop, spoiled Veruca Salt, gum-addicted Violet Beauregarde, and television-obsessed Mike Teavee, win the contest and go on the tour, led by Wonka. Grandpa Joe accompanies Charlie, while each of the other four children are chaperoned by both of their parents. As the group moves from room to room, the tour turns into a punishment for the bad children as one child after another falls victim to his/her particular vices and is removed. Augustus falls into a chocolate river and is sucked up a pipe to the fudge room; Violet turns into a blueberry after consuming experimental chewing gum; Veruca is thrown down a garbage chute after attempting to take one of Wonka's nut-cracking squirrels for her own; and Mike is shrunk after meddling with dangerous television equipment. They leave the factory with permanent reminders of their misbehavior as well as their lifetime supply of chocolate: Augustus is squeezed thin, Violet is purple, Veruca is covered in garbage, and Mike is ten feet tall and very thin (Wonka had him stretched to repair the damage caused by the TV equipment).
Charlie is the only child who does not misbehave throughout the factory. Seeing that he is the only one left, Wonka announces that he has "won." He receives the entire factory and will take over the company after Wonka retires. The reason Wonka had sent out the Golden Tickets was to find a child to be his heir, as he himself has no family to carry on his work. Wonka, Charlie and Grandpa Joe board a special glass elevator . As they are propelled up from the factory, the book ends, but the story continues in the sequel, Charlie and the Great Glass Elevator.
There are four main rooms that the tour goes through, losing one child at a time.
 Chocolate Room
The Chocolate Room is the first room that the many different people are able to go into. It is said that everything in this room is eatable: the pavements, the bushes, even the grass. There are trees made of taffy that grow jelly apples, bushes that sprout lollipops, mushrooms that spurt whipped cream, pumpkins filled with sugar cubes instead of seeds, jelly bean stalks, and spotty candy cubes. The main icon of the room is the Chocolate River, where the chocolate is mixed and churned by the waterfall, but must not be touched by human hands. Willy Wonka proclaims, "There is no other factory in the world that mixes its chocolate by waterfall." Pipes that hang on the ceiling come down and suck up the chocolate, then send it to other rooms of the factory, such as the Fudge Room, and Augustus Gloop is sucked into one pipe after falling into the river while drinking from it.
 The Inventing Room
The Inventing Room is the second room that the tour goes through. Mr. Wonka states that all of his ideas are simmering and bubbling in this room, and that Slugworth would give his false teeth to stay five minutes inside. This room is home to Wonka's new—and still insufficiently tested—candies, such as Everlasting Gobstoppers, Hair Toffee, and Wonka's greatest idea so far, Three-Course Dinner Chewing Gum. This candy is a three course dinner all in itself, containing, "Tomato soup, roast beef and baked potato, and blueberry pie and ice cream". However, once the chewer gets to the dessert, the side effect is that they turn into a giant "blueberry"; this happens to Violet Beauregarde after she rashly grabs and consumes the experimental gum.
Violet is subsequently taken to the Juicing Room so that the juice can be removed from her immediately. The tour then leaves the Inventing Room.
 The Nut Sorting Room
After an exhausting jog down a series of corridors, Wonka allows the party to rest briefly outside the Nut Room, though he forbids them to enter. This room is where Wonka uses trained squirrels to break open good walnuts for use in his sweets. All bad walnuts are thrown down in a garbage chute which leads to an incinerator. Veruca Salt desperately wants a squirrel, but becomes furious when Wonka tells her she cannot have one. She tries to grab a squirrel for herself, but it rejects her as a "bad nut" and an army of squirrels haul her across the floor and throw her down the garbage chute. Wonka assures her parents that she is stuck on top of the garbage chute and they quickly enter the Nut Room. As Mrs. Salt leans over the hole to look for Veruca, the squirrels rush up behind her and push her in. The same fate befalls Mr. Salt as he watches her disappear into the chute.
In the 1971 movie version, the nut sorting room is an egg room, with large geese laying golden chocolate eggs. The sorting mechanism is the same, but Veruca places herself on the mechanism while trying to get a goose. However, in the 2005 movie version, it had followed the original storyline with Veruca wanting a squirrel and being rejected and thrown down a garbage chute. And her daddy have to go inside the chute to get her but she went inside the rubbish room in 1998.
 The Television Room
The television Room is home to Wonka's latest invention, Television Chocolate, where they take a giant bar of Wonka chocolate and shrink it, then send it through the air in a million pieces to appear in a television. The bar can be taken from the screen, and even consumed. At Wonka's behest, Charlie takes the newly shrunk bar (Mike believes the bar is just an image on a screen). Mike Teavee is amazed at this new discovery, and attempts to send himself through television, resulting in him being shrunk down to be no more than an inch high. Wonka suggests that he be put through the Gum Stretcher, where he tests the stretchiness of gum. He also planned to give him vitamins, notably Vitamin Wonka. The Oompa Loompas escort the Teavee family to the Gum Stretcher.
In the 2005 and 1971 movie versions, Mike Teavee is stretched by the Taffy Puller. In the 1971 version, Mike's mother accompanies him to the factory, while his father accompanies him in the 2005 film.
 Other rooms
Other rooms, mentioned but not visited, are listed below in alphabetical order. Each is given the name of the product it contains, which is presumably made or extracted there.
- Butterscotch and Buttergin
- Candy-Coated Pencils for Sucking
- Cavity-Filling Caramels: "No more dentists!"
- Coconut-Ice Skating Rinks
- Cows that give Chocolate Milk
- Devils Drenchers to set your breath alight
- Eatable Marshmallow Pillows
- Exploding Candy for your Enemies
- Fizzy Lemonade Swimming Pools
- Fizzy Lifting Drinks
- Glumptious Globgobblers: "all the perfumed juices go squirting down your throat"
- Hot Ice Creams for Cold Days
- Invisible Chocolate Bars for Eating in Class
- Lickable Wallpaper for Nurseries
- Luminous Lollies for in Bed at Night
- Magic Hand-Fudge: "When you hold it in your hand, you taste it in your mouth!"
- Mint Jujubes for the Boy Next Door: "They'll give him green teeth for a month!"
- Rainbow Drops: "Suck them and you can spit in six different colors!"
- Scarlet Scorchdroppers: "makes the person who sucked them feel as warm as toast"
- Stickjaw for Talkative Parents
- Strawberry-Juice Water Pistols
- Square Candies that Look Round
- Pishlets for children who can't whistle
- The Rock-Candy Mine: "10,000 feet deep!"
- Toffee-Apple Trees for Planting out in your Garden
- Wriggle-Sweets that Wriggle Delightfully in your Tummy after Swallowing
 Controversy and Original Story
Responding to criticisms from the NAACP, Canadian children's author Eleanor Cameron, and others for the book's portrayal of the Oompa Loompas as dark skinned and skinny African pygmies who worked in the factory for cacao beans, Dahl changed some of the text, and Schindelman replaced some illustrations (the illustrations for the British version were also changed). That new version was released in 1973 in the USA. In the revised version the Oompa Loompas are described as having funny long golden-brown hair and rosy-white skin. Their origins were also changed from Africa to fictional Loompaland. Other minor changes appeared in the new version, notably the replacement of pre-decimal with decimal money.
The original book was Charlie's Chocolate Boy and was about ten horrid children who won tickets to the weekly Wonka's Factory visit. Roald completely re-wrote it when his nephew Nicholas said "Uncle Roald, I don't like it at all".
 Lost chapter
In 2005, a short chapter which had been removed during the editing of the book circulated, entitled "Spotty Powder", was published. The chapter featured the elimination of Miranda Piker, a "teacher's pet" with a headmaster father. Wonka introduces the group to a new candy that will make children temporarily appear sick so that they can miss school that day, which enrages Miranda and her father. They vow to stop the candy from being made, and storm into the secret room where it is made. Two screams are heard, and Wonka agrees with the distraught Mrs. Piker that they were surely ground into Spotty Powder, and were indeed needed all along for the recipe, as "We’ve got to use one or two schoolmasters occasionally or it wouldn’t work." He then reassures Mrs. Piker that he was joking. Mrs. Piker is escorted to the boiler room by the Oompa-Loompas, who sing a short song about how delicious Miranda's classmates will find her.
The book was first made into a feature film as a musical titled Willy Wonka & the Chocolate Factory, directed by Mel Stuart, produced by David L. Wolper and starring Gene Wilder as Willy Wonka, character actor Jack Albertson as Grandpa Joe and Peter Ostrum as Charlie Bucket. Released worldwide on June 30, 1971 and distributed by Paramount Pictures, the film had an estimated budget of $3 M. The movie grossed only $4 M and was considered a box-office flop. Like many films based on books, there were several notable differences in the film from the book. For example, Charlie's father did not appear in the film as he was dead, the fake ticket was the "final" ticket and was "found" by a Paraguayan man rather than the "second" ticket being "found" by a Russian woman, Charlie misbehaved as well and was nearly removed himself, the other four children were accompanied around the factory by just one of their parents rather than both parents, the "nut" room was changed to the "egg-laying" room and the film did not show the final fates of the bad children after they were removed. Most notably, a morality test and a contract came attached to the Golden Tickets to determine the worth of the finders.
Another film version, entitled Charlie and the Chocolate Factory and directed by Tim Burton, was released on July 15, 2005; this version starred Johnny Depp as Willy Wonka and Freddie Highmore as Charlie Bucket. The Brad Grey production was a hit, grossing about $470 M worldwide with an estimated budget of $150 M. It was distributed by Warner Bros. this time. The 1971 and 2005 films are consistent with the written work to varying degrees. The Burton film in particular greatly expanded Willy Wonka's personal backstory. Both films likewise heavily expanded the personalities of the four "bad" children and their parents from the limited description in the book. There were further differences in this film version from the book, including the fact that Mike Teavee was also obsessed by video games and the Internet as well as television (the book pre-dates home computers and video games) and provided an explanation of how he found his Golden Ticket; this was never explained in the book nor the 1971 film.
It has also been produced by Swedish Television as still drawings narrated by Ernst-Hugo Järegård.
Concurrently with the 2005 film, a line of candies was introduced in North America, Europe and Oceania that uses the book's characters and imagery for its marketing. Presently sold in in the United States, the United Kingdom, Australia, New Zealand and Canada, the candies are produced in the United States, New Zealand, the Czech Republic, the United Kingdom, Ireland and Brazil, by Nestlé.
On July 11, 2005, the Charlie and the Chocolate Factory video game was released for the PlayStation 2, Xbox, Nintendo GameCube, Nintendo DS, Wii, Game Boy Advance and Windows PC by developers Backbone and High Voltage Software and publisher 2K Games.
On 1 April 2006, the British theme park Alton Towers opened a family boat ride attraction themed around the story. The ride features a boat section where guests travel around the chocolate factory in bright pink boats on a chocolate river. In the final stage of the ride, guests will enter one of two glass elevators where they will join Willy Wonka as they travel the factory, eventually shooting up and out through the glass roof.