Gallows humor is humor about very unpleasant, serious, or painful circumstances. Any humor that treats serious matters, such as death, war, disease, and crime, in a light, silly or satirical fashion is considered gallows humor. Gallows humor has been described as a witticism in response to a hopeless situation. It arises from stressful, traumatic, or life-threatening situations, often in circumstances such that death is perceived as impending and unavoidable.
Sigmund Freud in his 1927 essay Humour (Der Humor) puts forth the following theory of the gallows humor: "The ego refuses to be distressed by the provocations of reality, to let itself be compelled to suffer. It insists that it cannot be affected by the traumas of the external world; it shows, in fact, that such traumas are no more than occasions for it to gain pleasure." Some other sociologists elaborated this concept further. At the same time, Paul Lewis warns that this "relieving" aspect of gallows jokes depends on the context of the joke: whether the joke is being told by the threatened person themselves or by someone else.
Gallows humor has the social effect of strengthening the morale of the oppressed and undermines the morale of the oppressors. According to Wylie Sypher, "to be able to laugh at evil and error means we have surmounted them."
Gallows humor is a natural human instinct and examples of it can be found in stories from antiquity. Its use was widespread in middle Europe, from where it was imported to the United States as part of Jewish humor. It is rendered with the German expression Galgenhumor. The concept of gallows humor is comparable to the French expression rire jaune, which also has a Germanic equivalent in the Belgian Dutch expression groen lachen (lit. green laughing).
Italian comedian Daniele Luttazzi discussed gallows humour focusing on the particular type of laughter that it arouses (risata verde or groen lachen), and said that grotesque satire, as opposed to ironic satire, is the one that most often arouses this kind of laughter. In the Weimar era Kabaretts, this genre was particularly common, and according to Luttazzi, Karl Valentin and Karl Kraus were the major masters of it.