The Mad Hatter is a character who appears in the Lewis Carroll book Alice's Adventures in Wonderland, and also in the follow-up book, Through the Looking Glass. Like the Cheshire Cat, another famous Carroll character, he is so distinctive that many people recognize him and his preposterous headgear outside the context of the Alice world. As a result, he sometimes appears in popular culture.
This character is puzzling and enigmatic, and as his name suggests, he appears to be crazy. Certainly his behavior is peculiar, and the Cheshire Cat actually specifically warns Alice that the character is insane. However, in the books, he is never directly referred to as the Mad Hatter, although he is sometimes known as “Hatter.”
Alice first meets the Mad Hatter at a peculiar tea party. His vocation is readily identifiable from his large and ornate hat, which still bears a price tag. The Hatter and the March Hare have in fact been having the same tea party for an extended period of time, ever since the Queen of Hearts declared that the Mad Hatter had murdered time by singing especially badly in a public performance. Originally sentenced to death, he escaped, but decided that time had actually stopped, condemning him to an endless tea party.
At the tea party, guests switch seats constantly, and exchange scraps of conversations, peculiar verses, and strange riddles like “how is a raven like a writing desk?” When the Mad Hatter pops up again later in Alice, the Queen threatens him with decapitation after recognizing him, but he escapes to live again in Through the Looking Glass. However, he doesn't evade his legal troubles, as he finds himself condemned for a crime he hasn't committed yet.
Like some other Carroll characters, the Mad Hatter is probably based on a real life person. Some people believe that the character is a fictionalization of Theophilus Carter, an eccentric who would have been known to Lewis Carroll.
The Mad Hatter's name is a reference to a common slang term, “as mad as a hatter.” The origins of this term appear to relate to the harmful chemicals which many hatters used in their trade to treat materials like felt and leather. These chemicals would have been inhaled constantly in hat manufacturing shops, causing brain damage which could have resulted in a variety of psychological symptoms.