They appear in chapter seven, where the Hatter himself is depicted as a diminutive, twitchy man known for his enormous top hat. His conversation jumps around from topic to topic and he continually switches places around the table for no reason, while he makes personal remarks, asks riddles no-one can answer and recites nonsensical poetry.
His companions are the March Hare, whose character is modelled on the phrase, "mad as a March hare", and the Dormouse who sleeps a lot and occasionally ends up with his head in the teapot - in nature, hares are commonly said to be "mad" in March because it's the start of their breeding season.
The odd assortment of guests is perpetually sitting around the table having tea because the Hatter is trapped in time - a punishment meted out by the grumpy Queen of Hearts. The Hatter upset her by singing to her and she accused him of "murdering the time." This appears to be the 19th century equivalent of the modern phrase for having wasted your time: "There's five minutes of my life I can't get back."
The queen sentenced the Hatter to death initially, but then relented and decided to trap him in time instead - in his world, it's always 6pm and always time for tea!
Was there a real Hatter?
Although popular culture refers to the Mad Hatter, Carroll never actually used this phrase, calling him simply the Hatter. It was the Cheshire Cat who told Alice how the Hatter and the March Hare were "both mad." Chapter seven is called A Mad Tea Party, but over time it has become known as the Mad Hatter's Tea Party.
Fans have often debated whether the Hatter is based on a real person. A popular theory was that Carroll modelled the Hatter's physical appearance on Theophilus Carter, a well-known and eccentric Oxford furniture dealer. In the mid-19th century, he could often be seen outside his shop, wearing his trademark top hat.
Some historians claim Carter was an undergraduate at Oxford University at the same time as Carroll in the 1850s - when the author was known by his real name, Charles Lutwidge Dodgson.
A correspondent in The Times newspaper, Rev W Gordon Baillie, wrote about this theory in March 1931, describing Carter as having a "well-developed nose" and a "receding chin." This made him an easy target for caricaturist, Sir John Tenniel, who illustrated Alice's Adventures in Wonderland.
Baillie even suggested that the author had encouraged Tenniel to use Carter as a model for the Hatter as revenge for a disagreement while at Oxford. However, Carroll always insisted that none of his characters were based on real people.
Hat makers' health issues
There was no suggestion that the Hatter's character was modelled on Carter. This had a more sinister origin. During the 19th century, mercury was used in the production of felt hats, as little was known in those days about its dangerous health implications.
Unfortunately, the phrase "mad as a hatter" was based on the fact that hatters commonly suffered health problems due to prolonged exposure to the mercurous nitrate used to cure felt. Many 19th century physicians diagnosed this as "madness", so the phrase had been in widespread use by the 1830s.
Breathing in the vapours over a period of time caused mercury poisoning, leading to neurological damage, memory loss, slurred speech and tremors. In addition, many employees in the textile industry were often overworked and malnourished, so they were particularly prone to developing illnesses.
One such illness was central nervous system tuberculosis - portrayed in novels such as Charles Kingsley's Alton Locke, which Carroll had read. Due to a lack of medical knowledge of neurological conditions, many sick workers were detained in Pauper Lunatic Asylums.
There was no medical help or rehabilitation for the patients, who lived in appalling conditions and were effectively sentenced to die there. Mercury poisoning reached epidemic proportions in the hat-making industry, and dementia was common among workers.
Origins of a "mad" tea party
Carroll was familiar with the conditions at asylums as his uncle, Robert Skeffington Lutwidge, was an officer on the Lunacy Commission - the public body that supervised the running of asylums. Carroll had visited the Surrey County Asylum himself and was familiar with how the inmates were treated.
Lutwidge was a believer in a more modern approach to psychiatric treatment and the earlier practices of imprisonment and straitjackets were phased out. Instead, a “non-restraint system” was trialled, enabling patients to carry out useful work such as farming, gardening and needlework, selling produce to generate income.
Dances, concerts and tea parties were held to entertain the patients. Visitors were invited to attend to show the outside world how patients believed to be incurable were now being helped and re-socialised. Historians have suggested Carroll's visits to the asylums led to his interpretation of the Mad Tea Party.
The riddle
Alice (the young heroine who has entered a strange fantasy "wonderland" after following a white rabbit down a rabbit hole) inadvertently stumbles on the tea party and is drawn in by the Hatter's riddle, "Why is a raven like a writing desk?"
Alice can't work out the answer and is quite perplexed until the Hatter tells her there is no answer, adding, "I haven't the slightest idea!"
Originally, Carroll didn't intend there to be an answer, but readers were so vexed by this that in later editions of the book, he wrote an answer in the preface, claiming "both can produce a few notes." This was simply an afterthought to appease fans.

Are you planning a tea (or dinner) party? Make sure you have only the best solutions for food storage, so that even if your guests are mad… at least the food is great! Check out Solent Plastics' range of premium quality food storage containers today!