Crime fiction is the literary genre that fictionalises crimes, their detection, criminals, and their motives. It is usually distinguished from mainstream fiction and other genres such as historical fiction or science fiction, but the boundaries are indistinct. Crime fiction has several subgenres, including detective fiction (such as the whodunit), courtroom drama, hard-boiled fiction, and legal thrillers. Suspense and mystery are key elements nearly ubiquitous to the genre.
In Italy people commonly call a story about detectives or crimes giallo (English: yellow), because books of crime fiction have usually had a yellow cover since the 1930s.