Adam Stanheight (Leigh Whannell), a photographer, and Lawrence Gordon (Cary Elwes), an oncologist, awaken at opposite ends of a grimy, disused bathroom, Adam in a water-filled bathtub. Both men are chained at the ankle to the pipes. Between them is a corpse lying in a pool of blood, which appears to have shot himself in the head. He holds a revolver and a microcassette recorder. Adam and Lawrence discover tapes in their pockets; the men learn from both tapes that Adam must escape the bathroom, while Lawrence must kill Adam before six o'clock, or he'll lose his wife and daughter and be left to die. They find a bag containing two hacksaws, though neither is able to cut through the chains. Adam breaks his saw and throws it at a mirror in frustration; Lawrence realizes that they are meant to be used on their feet.
Lawrence tells Adam that their captor is the Jigsaw Killer, whose name is a misnomer; he never directly kills anyone, instead putting victims in situations or mechanical traps (which he refers to as "games") in which they must go through physical and/or psychological torture to survive and escape with a better appreciation for life. Flashbacks show that while Lawrence was talking with some students and an orderly named Zep Hindle (Michael Emerson) about the terminal brain cancer of a man named John Kramer (Tobin Bell), he was approached by Detectives David Tapp (Danny Glover) and Steven Sing (Ken Leung) about his penlight being found at the scene of a Jigsaw "game". He viewed the testimony of Amanda Young (Shawnee Smith), a heroin addict, who is the only known survivor of Jigsaw's games; she barely escaped having her jaws ripped open during her game by a "reverse bear trap" and believes that her experience made her a better person.
Meanwhile, Lawrence's wife and daughter, Alison (Monica Potter) and Diana (Makenzie Vega), are being held captive in their home by a man who is watching Adam and Lawrence through a camera behind the bathroom's mirror, while tormenting Alison and Diana. Their house is simultaneously being watched by Tapp, who was discharged from the force. Flashbacks show that he became obsessed with the Jigsaw case after viewing Amanda's testimony, and that he and Sing illegally entered a warehouse they knew to be Jigsaw's lair and saved a man from being killed by drills aimed at his neck. Jigsaw managed to make a run for it after slashing Tapp's throat, and Sing was killed by a shotgun booby trap while pursuing him. After being discharged, Tapp began stalking Lawrence.
In the bathroom, Lawrence finds a mobile phone that can only receive calls and a cigarette and lighter; he and Adam use the latter two items to try to stage Adam's death, but an electric shock through Adam's ankle chain foils this plan. Following these events, Adam and Lawrence recall their abductions; they were both ambushed and knocked unconscious by a stranger wearing a gruesome pig mask. Lawrence receives a call from Alison, who warns him that Adam knows more than he is telling. Adam explains that he was paid to take pictures of Lawrence for the past few days by Tapp, and shows Lawrence a pile of pictures of him from the bag containing the hacksaws. Lawrence berates Adam for invading his privacy, while Adam shows Lawrence evidence that he was cheating on Alison. Adam then notices a picture of a man in Lawrence's house; Lawrence identifies the man as Zep the orderly, and the two deduce that Zep is their abductor. Adam then points out that it is six o'clock, the deadline. Zep moves to kill Alison, but she frees herself and manages to overpower Zep, gaining Tapp's attention in the process. He arrives in time to save Alison and Diana from Zep, allowing them to escape, and chases Zep to the sewers.
Lawrence, who is only aware of gunshots and screaming, is zapped by the ankle chain as well and loses reach of the phone; in desperation, he saws off his foot and shoots Adam with the revolver non-fatally in the shoulder. Zep, who shot Tapp during the chase, enters the bathroom intent on killing Lawrence, only to be blindsided by Adam and beaten to death with a toilet tank cover. As Lawrence crawls away with the promise that he'll return with help, Adam searches Zep's body for a key and finds another microcassette recorder. He learns that Zep was another victim of the game, following rules to obtain an antidote for the slow poison within his body. He looks around, as if looking for an answer. The corpse then rises to its feet and reveals itself as John Kramer, the real Jigsaw Killer. He tells Adam that the chain's key is in the bathtub, which was drained when Adam accidentally kicked the plug out. Adam then grabs Zep's pistol and tries to shoot Jigsaw but is zapped by his hidden remote control. Jigsaw then turns off the lights and says "Game over" before closing the bathroom door and leaving a screaming Adam inside to die.