In an unidentified city of near-constant rain and urban decay, Detective William R. Somerset (Freeman) is preparing to retire and leave the horrors of the city; before he does, he is partnered with Detective David Mills (Pitt), a cocky and short-tempered young cop who has recently voluntarily transferred to the precinct. The two investigate the murder of an extremely obese man who has been force-fed spaghetti until he passed out, when the killer kicked him in the stomach, causing it to burst. Somerset investigates this murder while Mills handles the murder of a successful defense attorney named Eli Gould, found with GREED written in his own blood on the office floor. The killer had held him, presumably at gunpoint, and forced him to cut off a pound of his own flesh as a price to pay for his sins. Soon after, Somerset finds GLUTTONY written in the grease built-up behind the obese man's fridge and theorizes that a serial killer is basing his crimes on the seven deadly sins with five more murders to go.
To give Mills and Somerset a chance to get along, Mills' wife Tracy (Gwyneth Paltrow) invites Somerset over for dinner. After she goes to sleep, Mills and Somerset examine case evidence from the two scenes. They find a picture of Gould's wife with blood painted around the eyes. The detectives ask a distraught Mrs. Gould (now sequestered in a safe house) to look at the pictures and she notices an abstract painting that's hanging upside-down. Brushing fingerprint powder on the wall behind the painting, Somerset finds the words "help me" formed by overlapping fingerprints.
Running the prints through AFIS, they are traced a day later to a mentally-disturbed pedophile nick-named Victor, who escaped conviction for raping a minor due to the efforts of his lawyer Eli Gould, the GREED victim. SWAT and the detectives raid his apartment to find Victor is the SLOTH victim, having been bound to his bed for exactly one year, as evidenced by pictures at the scene: one from every day since the day he was made a prisoner. Remarkably, he is still alive, but suffering from severe physical and mental deterioration; additionally, his hand was cut off to leave the prints at the GREED scene. When the detectives later try to interrogate Victor in the hospital, the doctor says that his "brain is mush" and his death is imminent, and even if it wasn't he couldn't speak to them because he had "chewed his own tongue out long ago." That evening, Tracy calls Somerset and requests that he meet with her. The next morning, Somerset meets Tracy in a diner where she tells him how miserable she is in "the city." At Somerset's urging, Tracy reveals the truth of her request to meet: she is newly pregnant, afraid of raising a child where they live and afraid of telling David. Still regretting the loss of his own fiance and his would-be child many years previously, Somerset tells Tracy to decide for herself whether or not to have the baby, but assuming she may choose the latter option, he advises her not to tell Mills.
Later that day, using an FBI contact, Somerset gets a list of library patrons who have borrowed books related to the seven deadly sins. The list leads the detectives to a man named John Doe, whose apartment they visit soon after. Doe, his face hidden to the pair, sees them as he comes home and pulls out a gun. After a long chase, Doe hits Mills with a tire iron, keeps him subdued at gunpoint, but lets him live and suddenly flees. While examining Doe's apartment (after bribing a homeless woman to claim she called the detectives about Doe, thus giving them probable cause to enter his apartment legally) they find notebooks of his thoughts, trophies of the crimes and a picture of Mills fighting off Doe, who, at the time, was posing as a press photographer. They also find a photo of a young woman, a prostitute, who they believe may be the next victim. A receipt leads them to an S&M leather shop where Doe placed an order for a sexual device. The girl is soon found dead in a room with LUST written on the door. Also found in the room is an extremely horrified man who was forced by Doe at gunpoint to wear and use the device, a strap-on dildo with a blade attachment, to simultaneously rape and kill the girl.