The story revolves around a poor young boy named Charlie Bucket born to a penniless, starving family. His two sets of grandparents reside in their children's dilapidated, tiny house and lead a bedridden existence, and Charlie is fascinated by the universally-celebrated candy factory located in his hometown owned by famous chocolatier Willy Wonka. His Grandpa Joe often narrates stories to him about the chocolate and about its mysterious proprietor, and the mysteries relating to the factory itself; how it had gone defunct for years until it mysteriously re-opened after Wonka's secret candy recipes had been discovered (albeit no employees are ever seen leaving the factory).
Soon after, an article in the newspaper reveals that Willy Wonka has hidden a Golden Ticket in five chocolate bars being distributed to anonymous locations worldwide, and that the discovery of a Golden Ticket would grant the owner with passage into Willy Wonka's factory and a lifetime supply of confectionary. Charlie longs for chocolate to satisfy his hunger and to find a Golden Ticket himself, but his chances are slim (his father has recently lost his job, leaving the family all but destitute) and word on the discovery of the tickets keeps appearing in various news articles read by the Bucket family, each one discovered by far going to self-centered, bratty children: an obese, gluttonous boy named Augustus Gloop, a spoiled brat named Veruca Salt, a record-breaking gum chewer named Violet Beauregarde, and Mike Teavee, an aspiring gangster who is unhealthily obsessed with television. Eventually, Charlie finds a ticket of his own.
The children, once at the factory, are taken to the Chocolate Room, where they are introduced to Oompa-Loompas, from Loompaland, who have been helping Wonka operate the factory. Whilst there, Augustus falls into the chocolate and is sucked up by a pipe and eliminated from the tour. They are soon taken to the Inventing Room, where Violet chews a piece of experimental magic chewing gum, and blows up into a blueberry, she is the second child rejected from the tour. After an exhausting jog down a series of corridors, Wonka allows them to rest outside of the Nut Room, but refuses them entry. Veruca, seeing squirrels inside, and demands one from Wonka, but when she is refused, she invades the Nut Room, where the squirrels attack her and throw her down the garbage chute, and soon her parents afterwards, being judged as bad nuts. They go on the Great Glass Elevator to the Television Chocolate Room, where Mike accidentally shrinks himself to a few inches tall using a teleporter Wonka invented.
Charlie, being the last child left, wins the prize. Together they go to Charlie's house in the glass elevator and take the whole family back to the chocolate factory to live out the rest of their lives.
A fan of the book since childhood, film director Tim Burton states, "I responded to Charlie and the Chocolate Factory because it respected the fact that children can be adults." In a 2006 list for the Royal Society of Literature, author J. K. Rowling named Charlie and the Chocolate Factory among her top ten books every child should read.
A 2004 study found that it was a common read-aloud book for fourth-graders in schools in San Diego County, California. A 2012 survey by the Oniversity of Worchester determined that it was one of the most common books that UK adults had read as children, after Alice's Adventures in Wonderland; The Lion, the Witch, and the Wardrobe; and The Wind in the Willows.
Accolades for the book include:
- New England Round Table of Children's Librarians Award (USA, 1972)
- Surrey School Award (UK, 1973)
- Millennium Children's Book Award (UK, 2000)
- Blue Peter Book Award (UK, 2000)
- National Education Association "Teachers' Top 100 Books for Children" based on a poll (USA, 2007)
- School Library Journal "Top 100 Chapter Books" of all time based on a poll (USA, 2012)
Although the book has always been popular and considered a children's classic by many literary critics, a number of prominent individuals have spoken critically of the novel over the years. Children's novelist and literary historian, John Rowe Townshed has described the book as "fantasy of an almost literally nauseating kind" and accused it of "astonishing insensitivity" regarding the original portrayal of the Oompa-Loompas as black pygmies, although Dahl did revise this later. (It is not known whether Townshed would have found the term "strange midgets" comparably offensive.) Another novelist, Eleanor Cameron, compared the book to the candy that forms its subject matter, commenting that it is "delectable and soothing while we are undergoing the brief sensory pleasure it affords but leaves us poorly nourished with our taste dulled for better fare". Ursula K. Le Guin voiced her support for this assessment in a letter to Cameron. Defenders of the book have pointed out it was unusual for its time in being quite dark for a children's book, with the "antagonists" not being adults or monsters (as is the case for most of Dahl's books) but the naughty children, who receive sadistic punishment in the end.