In a dystopian, hyper-bureaucratic future, Sam Lowry is a low-level government employee who frequently daydreams of himself as a winged warrior saving a damsel in distress. A fly gets jammed in a printer and creates a typographical error, resulting in the incarceration and accidental death during interrogation of cobbler Archibald Buttle, instead of renegade air conditioning specialist and suspected terrorist Archibald Tuttle. Sam is assigned the task of rectifying the error. Visiting Buttle's widow, Sam encounters their neighbour Jill Layton, and is astonished to discover that she resembles the woman from his recurring dreams. Jill has been trying to help Mrs Buttle establish what happened to her husband, but her efforts have been obstructed by bureaucracy. Unknown to her, she is now considered a terrorist accomplice of Tuttle for attempting to report the mistake of Buttle's arrest. Sam approaches Jill, but she avoids giving him full details, worried the government will track her down.
Sam reports a fault in his apartment's air conditioning. Central Services are uncooperative, but then Tuttle, who used to work for Central Services but left because of his dislike of the tedious and repetitive paperwork, unexpectedly comes to his assistance. Tuttle repairs Sam's air conditioning, but when two Central Services workers, Spoor and Dowser, arrive, Sam has to fob them off to let Tuttle escape. The workers later return to demolish Sam's ducts and seize his apartment under pretence of fixing the system.
Sam discovers that the only way to learn about Jill is to be transferred to Information Retrieval, where he will be able to access her classified records. He has previously turned down a promotion arranged by his mother, Ida, who is obsessed with the rejuvenating plastic surgery of cosmetic surgeon Dr Jaffe. Sam retracts his refusal by speaking with Deputy Minister Mr Helpmann at a party hosted by Ida. Having obtained Jill's records, Sam tracks her down before she can be arrested, then falsifies the records to indicate her death, allowing her to escape pursuit. The two share a romantic night together, but are apprehended by the government at gunpoint. Charged with treason for abusing his new position, Sam is restrained in a chair in a large, empty cylindrical room, to be tortured by his old friend, Jack Lint. Sam is told that Jill was killed while resisting arrest.
As Jack is about to start the torture, Tuttle and other members of the resistance break into the Ministry, shooting Jack, rescuing Sam, and blowing up the Ministry building. Sam and Tuttle flee together, but Tuttle disappears amid a mass of scraps of paperwork from the destroyed building. Sam stumbles into the funeral of Ida's friend, who has died following excessive cosmetic surgery. Sam discovers that his mother now resembles Jill, and is too busy being fawned over by young men to care about her son's plight. Guards disrupt the funeral, and Sam falls into the open casket and through a black void. He lands in a street from his daydreams, and tries to escape police and monsters by climbing a pile of flex-ducts. Opening a door, he passes through it and is surprised to find himself in a truck driven by Jill. The two leave the city together. However, this "happy ending" is a delusion: in reality, he is still strapped to the chair. It is implied that he has been lobotomised by Jack.[18] Realising that Sam has descended into blissful insanity, Jack and Mr Helpmann declare him a lost cause and leave the room. Sam remains in the chair, smiling and humming "Aquarela do Brasil".