Crime fiction, detective story, murder mystery, mystery novel, and police novel are terms used to describe narratives that centre on criminal acts and especially on the investigation, either by an amateur or a professional detective, of a crime, often a murder.  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 multiple subgenres,  including detective fiction (such as the whodunit), courtroom drama, hard-boiled fiction, and legal thrillers. Most crime drama focuses on crime investigation and does not feature the courtroom. Suspense and mystery are key elements that are nearly ubiquitous to the genre.
The One Thousand and One Nights (Arabian Nights) contains the earliest known examples of crime fiction.  One example of a story of this genre is the medieval Arabic tale of "The Three Apples", one of the tales narrated by Scheherazade in the Arabian Nights. In this tale, a fisherman discovers a heavy locked chest along the Tigris River, and he sells it to the Abbasid Caliph, Harun al-Rashid, who then has the chest broken open, only to find inside it the dead body of a young woman who was cut into pieces. Harun orders his vizier, Ja'far ibn Yahya, to solve the crime and find the murderer within three days, or be executed if he fails his assignment.  The story has been described as a "whodunit" murder mystery  with multiple plot twists.  The story has detective fiction elements. 
Two other Arabian Nights stories, "The Merchant and the Thief" and "Ali Khwaja", contain two of the earliest fictional detectives, who uncover clues and present evidence to catch or convict a criminal, with the story unfolding in normal chronology and the criminal already being known to the audience. The latter involves a climax where titular detective protagonist Ali Khwaja presents evidence from expert witnesses in a court.  "The Hunchback's Tale" is another early courtroom drama, presented as a suspenseful comedy. 
The earliest known modern crime fiction is E. T. A. Hoffmann's 1819 novella "Mademoiselle de Scudéri". Also, Thomas Skinner Sturr's anonymous Richmond, or stories in the life of a Bow Street Officer is from 1827; another early full-length short story in the genre is The Rector of Veilbye by Danish author Steen Steensen Blicher, published in 1829. A further example of crime detection can be found in Letitia Elizabeth Landon's story The Knife, published in 1832, although here the truth remains in doubt at the end.
Better known are the earlier dark works of Edgar Allan Poe.  His brilliant and eccentric detective C. Auguste Dupin, a forerunner of Arthur Conan Doyle's Sherlock Holmes, appeared in works such as "The Murders in the Rue Morgue" (1841), "The Mystery of Marie Rogêt" (1842), and "The Purloined Letter" (1844). With his Dupin stories, Poe provided the framework for the classic detective story. The detective's unnamed companion is the narrator of the stories and a prototype for the character of Dr. Watson in later Sherlock Holmes stories. 
Wilkie Collins' epistolary novel The Woman in White was published in 1860, while The Moonstone (1868) is often thought to be his masterpiece. French author Émile Gaboriau's Monsieur Lecoq (1868) laid the groundwork for the methodical, scientifically minded detective.
The evolution of locked-room mysteries was one of the landmarks in the history of crime fiction. The Sherlock Holmes mysteries of Doyle's are said to have been singularly responsible for the huge popularity of this genre. A precursor was Paul Féval, whose series Les Habits Noirs (1862–67) features Scotland Yard detectives and criminal conspiracies. The best-selling crime novel of the 19th century was Fergus Hume's The Mystery of a Hansom Cab (1886), set in Melbourne, Australia.
The evolution of the print mass media in the United Kingdom and the United States in the latter half of the 19th century was crucial in popularising crime fiction and related genres. Literary 'variety' magazines, such as Strand, McClure's , and Harper's , quickly became central to the overall structure and function of popular fiction in society, providing a mass-produced medium that offered cheap, illustrated publications that were essentially disposable.
Like the works of many other important fiction writers of his day—e.g. Wilkie Collins and Charles Dickens—Arthur Conan Doyle's Sherlock Holmes stories first appeared in serial form in the monthly Strand in the United Kingdom. The series quickly attracted a wide and passionate following on both sides of the Atlantic, and when Doyle killed off Holmes in "The Final Problem", the public outcry was so great, and the publishing offers for more stories so attractive, that he was reluctantly forced to resurrect him.
In Italy, early translations of English and American stories and local works were published in cheap yellow covers, thus the genre was baptized with the term libri gialli or yellow books. The genre was outlawed by the Fascists during WWII, but exploded in popularity after the war, especially influenced by the American hard-boiled school of crime fiction. A group of mainstream Italian writers emerged, who used the detective format to create an antidetective or postmodern novel in which the detectives are imperfect, the crimes are usually unsolved, and clues are left for the reader to decipher. Famous writers include Leonardo Sciascia, Umberto Eco, and Carlo Emilio Gadda. 
In Spain, The Nail and Other Tales of Mystery and Crime was published by Pedro Antonio de Alarcón in 1853. Crime fiction in Spain (also curtailed in Francoist Spain) took on some special characteristics that reflected the culture of the country. The Spanish writers emphasized the corruption and ineptitude of the police, and depicted the authorities and the wealthy in very negative terms. 
In China, modern crime fiction was first developed from translations of foreign works from the 1890s.  Cheng Xiaoqing, considered the "Grand Master" of 20th-century Chinese detective fiction, translated Sherlock Holmes into classical and vernacular Chinese. In the late 1910s, Cheng began writing his own detective fiction series, Sherlock in Shanghai, mimicking Conan Doyle's style, but relating better to a Chinese audience.  During the Mao era, crime fiction was suppressed and mainly Soviet-styled and anticapitalist. In the post-Mao era, crime fiction in China focused on corruption and harsh living conditions during the Mao era (such as the Cultural Revolution). 
Crime fiction provides unique psychological impacts on readers and enables them to become mediated witnesses through identifying with eyewitnesses of a crime. Readers speak of crime fiction as a mode of escapism to cope with other aspects of their lives.  Crime fiction provides distraction from readers’ personal lives through a strong narrative at a comfortable distance.  Forensic crime novels have been referred to as "distraction therapy", proposing that crime fiction can improve mental health and be considered as a form of treatment to prevent depression. 
In the history of crime fiction, some authors have been reluctant to publish their novels under their real names. More recently, some publish pseudonymously because of the belief that since the large booksellers are aware of their historical sales figures, and command a certain degree of influence over publishers, the only way to "break out" of their current advance numbers is to publish as someone with no track record.
In the late 1930s and 1940s, British County Court Judge Arthur Alexander Gordon Clark (1900–1958) published a number of detective novels under the alias Cyril Hare, in which he made use of his profoundly extensive knowledge of the English legal system. When he was still young and unknown, award-winning British novelist Julian Barnes (born 1946) published some crime novels under the alias Dan Kavanagh. Other authors take delight in cherishing their alter egos; Ruth Rendell (1930–2015) writes one sort of crime novels as Ruth Rendell and another type as Barbara Vine; John Dickson Carr also used the pseudonym Carter Dickson. Author Evan Hunter (which itself was a pseudonym) wrote his crime fiction under the name of Ed McBain.
As with any other entity, quality of a crime fiction book is not in any meaningful proportion to its availability. Some of the crime novels generally regarded as the finest, including those regularly chosen by experts as belonging to the best 100 crime novels ever written (see bibliography), have been out of print since their first publication, which often dates back to the 1920s or '30s. The bulk of books that can be found today on the shelves labelled "Crime" consists of recent first publications usually no older than a few years.
Furthermore, only a select few authors have achieved the status of "classics" for their published works. A classic is any text that can be received and accepted universally, because they transcend context. A popular, well-known example is Agatha Christie, whose texts, originally published between 1920 and her death in 1976, are available in UK and US editions in all English-speaking nations. Christie's works, particularly featuring detectives Hercule Poirot or Miss Jane Marple, have given her the title the Queen of Crime, and made her one of the most important and innovative writers in the development of the genre. Her most famous novels include Murder on the Orient Express (1934), Death on the Nile (1937), and the world's best-selling mystery And Then There Were None (1939). 
Other less successful, contemporary authors who are still writing have seen reprints of their earlier works, due to current overwhelming popularity of crime fiction texts among audiences. One example is Val McDermid, whose first book appeared as far back as 1987; another is Florida-based author Carl Hiaasen, who has been publishing books since 1981, all of which are readily available.
From time to time, publishing houses decide, for commercial purposes, to revive long-forgotten authors, and reprint one or two of their more commercially successful novels. Apart from Penguin Books, which for this purpose have resorted to their old green cover and dug out some of their vintage authors. Pan started a series in 1999 entitled "Pan Classic Crime", which includes a handful of novels by Eric Ambler, but also American Hillary Waugh's Last Seen Wearing ... . In 2000, Edinburgh-based Canongate Books started a series called "Canongate Crime Classics" —both whodunnits and roman noir about amnesia and insanity—and other novels. However, books brought out by smaller publishers such as Canongate Books are usually not stocked by the larger bookshops and overseas booksellers. The British Library has also (since 2012) starting republishing "lost" crime classics, with the collection referred to on their website as "British Library Crime Classics series".
Sometimes, older crime novels are revived by screenwriters and directors rather than publishing houses. In many such cases, publishers then follow suit and release a so-called "film tie-in" edition showing a still from the movie on the front cover and the film credits on the back cover of the book—yet another marketing strategy aimed at those cinemagoers who may want to do both: first read the book and then watch the film (or vice versa). Recent examples include Patricia Highsmith's The Talented Mr. Ripley (originally published in 1955), Ira Levin's Sliver (1991), with the cover photograph depicting a steamy sex scene between Sharon Stone and William Baldwin straight from the 1993 movie, and again, Bret Easton Ellis's American Psycho (1991). Bloomsbury Publishing PLC, though, have launched what they call "Bloomsbury Film Classics"—a series of original novels on which feature films were based. This series includes, for example, Ethel Lina White's novel The Wheel Spins (1936), which Alfred Hitchcock—before he went to Hollywood—turned into a much-loved movie entitled The Lady Vanishes (1938), and Ira Levin's (born 1929) science-fiction thriller The Boys from Brazil (1976), which was filmed in 1978.
Older novels can often be retrieved from the ever-growing Project Gutenberg database.
Detective fiction is a subgenre of crime fiction and mystery fiction in which an investigator or a detective—whether professional, amateur or retired—investigates a crime, often murder. The detective genre began around the same time as speculative fiction and other genre fiction in the mid-nineteenth century and has remained extremely popular, particularly in novels. Some of the most famous heroes of detective fiction include C. Auguste Dupin, Sherlock Holmes, and Hercule Poirot. Juvenile stories featuring The Hardy Boys, Nancy Drew, and The Boxcar Children have also remained in print for several decades.
A whodunit or whodunnit is a complex plot-driven variety of detective fiction in which the puzzle regarding who committed the crime is the main focus. The reader or viewer is provided with the clues to the case, from which the identity of the perpetrator may be deduced before the story provides the revelation itself at its climax. The investigation is usually conducted by an eccentric, amateur, or semi-professional detective.
The historical mystery or historical whodunit is a subgenre of two literary genres, historical fiction and mystery fiction. These works are set in a time period considered historical from the author's perspective, and the central plot involves the solving of a mystery or crime. Though works combining these genres have existed since at least the early 20th century, many credit Ellis Peters's Cadfael Chronicles (1977–1994) for popularizing what would become known as the historical mystery. The increasing popularity and prevalence of this type of fiction in subsequent decades has spawned a distinct subgenre recognized by the publishing industry and libraries. Publishers Weekly noted in 2010 of the genre, "The past decade has seen an explosion in both quantity and quality. Never before have so many historical mysteries been published, by so many gifted writers, and covering such a wide range of times and places." Editor Keith Kahla concurs, "From a small group of writers with a very specialized audience, the historical mystery has become a critically acclaimed, award-winning genre with a toehold on the New York Times bestseller list."
Ellery Queen is a pseudonym created in 1929 by American crime fiction writers Frederic Dannay and Manfred Bennington Lee and the name of their main fictional character, a mystery writer in New York City who helps his police inspector father solve baffling murders. Dannay and Lee wrote most of the more than thirty novels and several short story collections in which Ellery Queen appeared as a character, and their books were among the most popular of American mysteries published between 1929 and 1971. In addition to the fiction featuring their eponymous brilliant amateur detective, the two men acted as editors: as Ellery Queen they edited more than thirty anthologies of crime fiction and true crime, and Dannay founded and for many decades edited Ellery Queen's Mystery Magazine, which has been published continuously from 1941 to the present. From 1961, Dannay and Lee also commissioned other authors to write crime thrillers using the Ellery Queen nom de plume, but not featuring Ellery Queen as a character; several juvenile novels were credited to Ellery Queen, Jr. Finally, the prolific duo wrote four mysteries under the pseudonym Barnaby Ross.
John Dickson Carr was an American author of detective stories, who also published using the pseudonyms Carter Dickson, Carr Dickson, and Roger Fairbairn.
The "locked-room" or "impossible crime" mystery is a type of crime seen in crime and detective fiction. The crime in question, typically murder, is committed in circumstances under which it appeared impossible for the perpetrator to enter the crime scene, commit the crime, and leave undetected. The crime in question typically involves a situation whereby an intruder could not have left; for example the original literal "locked room": a murder victim found in a windowless room locked from the inside at the time of discovery. Following other conventions of classic detective fiction, the reader is normally presented with the puzzle and all of the clues, and is encouraged to solve the mystery before the solution is revealed in a dramatic climax.
Mystery is a fiction genre where the nature of an event, usually a murder or other crime, remains mysterious until the end of the story. Often within a closed circle of suspects, each suspect is usually provided with a credible motive and a reasonable opportunity for committing the crime. The central character is often a detective, who eventually solves the mystery by logical deduction from facts presented to the reader. Some mystery books are non-fiction. Mystery fiction can be detective stories in which the emphasis is on the puzzle or suspense element and its logical solution such as a whodunit. Mystery fiction can be contrasted with hardboiled detective stories, which focus on action and gritty realism.
Genre fiction, also known as popular fiction, is a term used in the book-trade for fictional works written with the intent of fitting into a specific literary genre, in order to appeal to readers and fans already familiar with that genre.
Thriller is a genre of fiction with numerous, often overlapping, subgenres, including crime, horror and detective fiction. Thrillers are characterized and defined by the moods they elicit, giving their audiences heightened feelings of suspense, excitement, surprise, anticipation and anxiety. This genre is well-suited to film and television.
Crime is a typically 19th-, 20th- and 21st-century genre, dominated by British and American writers. This article explores its historical development as a genre.
A mystery film is a genre of film that revolves around the solution of a problem or a crime. It focuses on the efforts of the detective, private investigator or amateur sleuth to solve the mysterious circumstances of an issue by means of clues, investigation, and clever deduction.
An inverted detective story, also known as a "howcatchem", is a murder mystery fiction structure in which the commission of the crime is shown or described at the beginning, usually including the identity of the perpetrator. The story then describes the detective's attempt to solve the mystery. There may also be subsidiary puzzles, such as why the crime was committed, and they are explained or resolved during the story. This format is the opposite of the more typical "whodunit", where all of the details of the perpetrator of the crime are not revealed until the story's climax. An early example in English is R. Austin Freeman's The Case of Oskar Brodski published in Pearson's Magazine in 1912, but Crime and Punishment (1866) by Dostoevsky predates it.
The Golden Age of Detective Fiction was an era of classic murder mystery novels of similar patterns and styles, predominantly in the 1920s and 1930s.
Kenneth Martin Edwards is a British crime novelist, whose work has won multiple awards in the UK and the United States. As a crime fiction critic and historian, and also in his career as a solicitor, he has written non-fiction books and many articles. He is the current President of the Detection Club and in 2020 was awarded the Crime Writers' Association's Diamond Dagger, the highest honour in British crime writing, in recognition of the "sustained excellence" of his work in the genre.
Leslie S. Klinger is an American attorney and writer. He is a noted literary editor and annotator of classic genre fiction, including the Sherlock Holmes stories and the novels Dracula, Frankenstein, and Strange Case of Dr. Jekyll and Mr. Hyde as well as Neil Gaiman's The Sandman comics, Alan Moore's and Dave Gibbons's graphic novel Watchmen, the stories of H.P. Lovecraft, and Neil Gaiman's American Gods.
Matthew Livingston is the fictional teenage detective who appears in a mystery series geared towards young readers and teenagers. The books are written by Marco Conelli, a retired detective in the NYPD and a literary award-winning author.
Chinese crime fiction is an umbrella term which generally refers to Sinophone literature concerned with the investigation and punishment of criminal acts. In mainland China the most popular subgenre is "detective fiction".
The closed circle of suspects is a common element of detective fiction, and the subgenre that employs it can be referred to as the closed circle mystery. Less precisely, this subgenre – works with the closed circle literary device – is simply known as the "classic", "traditional" or "cozy" detective fiction.
Gong'an or crime-case fiction is a subgenre of Chinese crime fiction involving government magistrates who solve criminal cases. Gong'an fiction first appeared in the colloquial stories of Song dynasty. Gong'an fiction was then developed and become one of the most popular fiction styles in Ming and Qing dynasties. The Judge Dee and Judge Bao stories are the best known examples of the genre.