Hardboiled (or hard-boiled) fiction is a literary genre that shares some of its characters and settings with crime fiction (especially detective stories). The genre's typical protagonist is a detective who witnesses daily the violence of organized crime that flourished during Prohibition (1920–1933) and its aftermath, while dealing with a legal system that had become as corrupt as the organized crime itself. Rendered cynical by this cycle of violence, the detectives of hardboiled fiction are classic antiheroes. Notable hardboiled detectives include Philip Marlowe, Mike Hammer, Sam Spade, Lew Archer, and The Continental Op.
The style was pioneered by Carroll John Daly in the mid-1920s, popularized by Dashiell Hammett over the course of the decade, and refined by James M. Cain and by Raymond Chandler beginning in the late 1930s; its heyday was in 1930s–50s America.
From its earliest days, hardboiled fiction was published in and closely associated with so-called pulp magazines, most famously Black Mask under the editorship of Joseph T. Shaw. In its earliest uses in the late 1920s, "hardboiled" didn't refer to a type of crime fiction; it meant the tough (cynical) attitude towards emotions triggered by violence.
Pulp historian Robert Sampson argues that Gordon Young's "Don Everhard" stories (which appeared in Adventure magazine from 1917 onwards), about an "extremely tough, unsentimental, and lethal" gun-toting urban gambler, anticipated the hardboiled detective stories.