Having "bats in the belfry" means that a person is crazy or eccentric; this idiomatic expression originated in the late 19th century. The disorganized flight of the bat is comparable to somewhat chaotic mental energy, and the belfry is a metaphor for a person’s head. In reality, belfries are upper portions of buildings or towers in which bells are hung.
From a symbolic perspective, bats in the belfry may be synonymous with clouded mental activities or enthusiastic but illogical thoughts. The term, batty, has also been frequently used to mean a little crazy or not possessing of the soundest mental health. Saying someone is bats may also cast aspersions on that person’s sanity.
There is some dispute on when the expression first appeared in print. Some etymologists and word enthusiasts date this to the last decade of the 19th century. In 1899, there are at least two known print mentions. One use of this phrase occurs in William J. Kountz’ novel, Billy Baxter’s Letters, and another appears in a book by Elbert Hubbard, supposedly quoting the artist, James Whistler. In Hubbard’s book, Little Journeys to the Homes of Eminent Painters, he writes that Whistler dismissed a fellow artist as someone with bats in the belfry.
Mention of the expression occurs throughout the 20th and 21st centuries. Most early references are American and word enthusiasts believe the phrase originated in the US. It certainly gained use in places like England within a few decades, and associating bats with craziness is not exclusively American. For example, by the time Agatha Christie was writing her Miss Marple stories, she regularly used the term batty to describe characters, particularly older ladies. It was this dismissal of old ladies as not all there that often played to Miss Marple’s advantage and allowed her to sleuth successfully.
J.K. Rowling certainly continued that tradition of associating bats with insanity with her Harry Potter books. Many critics argue that it’s highly significant that Professor Snape’s animagus was a bat, as he was not the most mentally balanced or happy individual. It’s interesting that though bats in the belfry is likely American in origin, the word "batty" is a much more common slang term in England.
Either form of the idiom is likely to be recognized in both countries. Ongoing American use of the longer phrase can be found in many examples. For instance, a popular 1940s Metro-Goldwyn-Mayer cartoon, Bats in the Belfry, features three singing bats. Much later, Overkill, a thrash metal band, wrote a song with this title.
There are a number of similar expressions. Among them are wrong in the upper story, which again connects the head to the top floor of a building. Alternately, the lights are on and no one is home, conceives of the person as a house, which is lacking some formal element required for sanity. These are not particularly polite ways to refer to others, though they may be humorously applied to one's self.