The story follows two detectives, one retiring and one his replacement, jointly investigating a series of ritualistic murders inspired by the seven deadly sins. Over the course of the investigation they attempt to track down the killer before he has a chance to murder his seven victims. The film was written by Andrew Kevin Walker. It stars Brad Pitt and Morgan Freeman as the detectives and Kevin Spacey as the serial killer.
In an unnamed city, veteran detective William R. Somerset (Morgan Freeman) is partnered with his replacement David Mills (Brad Pitt) for a week-long orientation before his retirement. The two are ill-matched: Somerset is cynical, contemplative and patient, while Mills is passionate, short-tempered, and impatient. Mills' ambition is exasperated by Somerset's laconic expertise, which makes him increasingly insecure.
Their first case together is the death of a morbidly obese man who has died by mysterious but non-natural causes. The autopsy reveals that he was force-fed until his stomach ruptured by an unknown assailant. The next day, Mills assigned to the murder of a wealthy-but-loathed defense attorney who was forced to mutilate himself; the word "Greed" is written on the floor of his office. Somerset revisits the first murder and finds the word "Gluttony" written behind the refrigerator. Recognizing their religious significance to the Catholic Seven Deadly Sins, Somerset spends all evening studying them at the local library and leaves his research on Mills' desk. Mills, however, is incapable of comprehending the literary source material, and relies on Cliffs Notes for help.
Somerset attends dinner at Mills' ramshackle apartment and earns the admiration of David's wife Tracy (Gwyneth Paltrow), whose sensibilities seem closer to his than David's. While pouring over forensic photos, they find clues indicating the attorney's wife; the wife confirms that a painting in the office has been re-hung. They discover a message in fingerprints behind the painting and trace them to a convicted drug dealing pedophile and storm his apartment with the aid of a S.W.A.T. team. They find, however, that he has been reduced to a critically emaciated state, and the word "Sloth" is written on the wall above him; the killer has tied him to his bed for an entire year. Although rescued, the prolonged immobility has put the man into a vegetative state.
Tracy meets with Somerset in secret and tells him that she is pregnant, and that the dilapidated living conditions of the city are giving her second thoughts about seeing the child to term. Somerset agrees with her position but also gives her reason for hope, leaving her to make the decision for herself.
Frustrated with the killer's intelligence and evasiveness, Somerset uses a contact in the federal government to provide illegally obtained library records to trace potential suspects. The research points to the reading habits of a man named John Doe (Kevin Spacey) and go to question him. They arrive at his apartment just as Doe returns from an errand and upon seeing them, Doe fires a gun at them and flees. Mills gives chase throughout the building and down to the streets—becoming injured in the process—but is ambushed by Doe in an alley; Doe inexplicably spares Mills' life and escapes. Doe remains at large, and while forensics confiscates his funding and clues to additional targeted victims, they find no evidence of Doe's identity, not even fingerprints.
They learn that Doe has collected an order from a S&M shop specializing in customized leather creations and used it to murder a prostitute for the sin of "Lust." Having abducted a man at a brothel, Doe forced the man to wear the device—a strap-on dildo with a bladed shaft—and rape the prostitute to death. The following day, Doe assaults a young model in her apartment, cuts off her nose, and glues a telephone and bottle of pills to her respective hands, forcing her to choose between suicide and disfigurement; she chooses the former, and becomes "Pride." Mills and Somerset return to the precinct house, only to be blindsided when John Doe walks into the department and surrenders; they discover that Doe has been routinely removing his fingerprints with razor blades to avoid detection. After a lengthy consultation, Doe's attorney informs the detectives and their superiors that Doe will plead insanity for his crimes unless they agree to escort him to an undisclosed location in the afternoon to collect the final victims. Reluctantly, they accept.
Doe directs them to a field of high-tension power lines outside the city. During the trip, Doe explains that his killings were intended by Divine mandate to turn the sins of the sinner against them in literal form both as punishment and as a warning to all people who disobey Biblical law. Mills becomes increasingly hostile with Doe for his cryptic comments toward him. Upon arrival at the field, Mills escorts Doe out to the open just as parcel delivery truck arrives and Somerset intercepts it. The driver informs him that he was paid to deliver a package at the specific location and time by Doe; he surrenders a box addressed to Mills. Somerset hesitatingly opens the box and recoils at its contents. In a panic, he runs back to them just as Doe reveals to Mills that he visited Tracy earlier that morning and decapitated her after failing to assume the role of husband; having been jealous of Mills' normal life, Doe has committed the sin of "Envy," and provokes Mills to assume the role of "Wrath" to kill him as punishment. Somerset attempts to talk Mills down, but when Doe mentions Tracy's unborn baby, Mills loses control and empties his gun into Doe. He then wanders off in a fugue state.
The police force arrives on the scene at dusk, and Mills is taken into custody; his fate is unknown. Without a replacement, Somerset abandons his retirement plans. As he and the department captain (R. Lee Ermey) leave, Somerset quotes Ernest Hemingway's For Whom the Bell Tolls: "'The world is a fine place and worth fighting for.' I agree with the second part."
Filming took place in Los Angeles, California.
Fincher approached making Seven like a "tiny genre movie, the kind of movie Friedkin might have made after The Exorcist." He worked with cinematographer Darius Khondji and adopted a simple approach to the camerawork, which was influenced by the television show COPS, "how the camera is in the backseat peering over people's shoulder". Fincher allowed Walker on the set while filming for on-the-set rewrites. According to the director, "Seven is the first time I got to carry through certain things about the camera – and about what movies are or can be".
The crowded urban streets filled with noisy denizens and an oppressive rain that always seems to fall without respite were integral parts of the film, as Fincher wanted to show a city that was "dirty, violent, polluted, often depressing. Visually and stylistically, that's how we wanted to portray this world. Everything needed to be as authentic and raw as possible." To this end, Fincher turned to production designer Arthur Max to create a dismal world that often eerily mirrors its inhabitants. "We created a setting that reflects the moral decay of the people in it", says Max. "Everything is falling apart, and nothing is working properly." The film's brooding, dark look was achieved through a chemical process called bleach bypass, wherein the silver in the film stock was not removed, which in turn deepened the dark, shadowy images in the film and increased its overall tonal quality.