Humor (or humour) is a quality that induces laughter and/or feelings of amusement. The ability to experience humor is nearly universal throughout all ages and cultures; past and present. The term has its origins in the medicinal practices of the ancient Greeks, who believed that human health and happiness were controlled by the balance of four bodily fluids called "humours;" black bile, yellow bile, phlegm, and blood.

Most humor features at least one of two main components: a reflection of reality or an element of surprise. In a humorous reflection of reality, the real world is distorted through methods such as hyperbole and satire to make an indirect statement about reality. Recognition of the difference between reality and its fictional portrayal is what gives rise to the humor. The element of surprise works by setting up expectations and then going in a completely different direction, such as in the punch-line of a joke. The surprise may come from clever word-play, a story that is intentionally anti-climactic, such as a shaggy dog story, or something that is completely absurd and unrelated to what came before, as in a non sequitur. The possibilities for this type of humor are nearly endless.

There are numerous theories attempting to account for the existence of humor. Many psychological and physiological theories view the experience of humor as normal, healthy behavior that relieves stress and promotes immune system functioning and general health. Spiritual "theories" with no basis in science also abound. These often label humor as a "divine gift" due to the pleasant sensations it arouses and its lack of any obvious function. Perhaps the most prevalent theory today is an evolutionary explanation which defines humor as a reward for the brain's recognition of a pattern. According to this explanation, the sense of humor evolved as a way of encouraging quick, unconscious pattern recognition; which may have been a major contributing factor to the advanced cognitive development of the human species.