Peter Gibbons, a disgruntled programmer at Initech, spends his days "staring at his desk" instead of actually working. His co-workers include Samir Nagheenanajar, who is annoyed by the fact that nobody can pronounce his last name correctly; Michael Bolton, who loathes having the same name as the famous singer, whom he hates; and Milton Waddams, a meek, fixated collator who constantly mumbles to himself. Milton had actually been laid off years earlier, though he was never informed and, due to a payroll computer glitch, continues to receive regular paychecks. All four are repeatedly mistreated by management, especially Initech's smarmy, callous vice president, Bill Lumbergh. The staff are further agitated by the arrival of two consultants, Bob Slydell and Bob Porter, who are brought in to help the company through downsizing and outsourcing.
Peter's girlfriend Anne convinces him to attend an 'occupational hypnotherapy' session, but the therapist, Dr. Swanson, dies of a heart attack right after hypnotizing Peter. The newly relaxed Peter wakes up the next morning and ignores continued calls from Anne (who angrily leaves him and admits she's been cheating, confirming his friends' suspicions) and Lumbergh (who was expecting Peter to work over the weekend). The following work day, Peter decides to skip work and asks Joanna, a waitress at Chotchkie's (a parody of T.G.I. Friday's), out to lunch. Joanna shares Peter's loathing of idiotic management and love of the television program Kung Fu.
When Peter finally shows up at work, he disregards Initech's dress code, takes Lumbergh's reserved parking spot, and refuses to follow Lumbergh's directions. He also removes items that annoy him, such as a door handle that repeatedly shocked him and a cubicle wall that blocks his view out the window. The consultants, however, decide to promote him because of the positive impression he makes on them with his bluntness about the office's problems. Peter then learns that Michael and Samir's jobs will be eliminated, and the trio decide to get even by infecting Initech's accounting system with a computer virus designed to divert fractions of pennies into a bank account they control. They believe the scheme will succeed because the amounts are too small for Initech to notice, while over time they will receive a substantial amount of money. On Michael and Samir's last day at Initech, Peter takes one last item: a frequently-malfunctioning printer, which the three smash to pieces in a field.
To his horror, Peter discovers that a misplaced decimal point caused the virus to steal $305,326.13 in the first few days, a far more conspicuous loss to Initech. Haunted by the result, he admits to Joanna – who has finally worked up the courage to stand up to her boss and quit Chotchkie's – that the scheme was a bad idea and that he plans to accept the blame for the crime. He writes a letter confessing everything, then slips an envelope containing the letter and the money (in unsigned traveler's checks) under the door of Lumbergh's office late at night. The next morning, Milton – having been deprived of his cherished red Swingline stapler by Lumbergh, forced to move to the cockroach-infested basement, and having had his paychecks finally cut off – enters Lumbergh's office to reclaim his stapler.
Fully expecting to be arrested upon arriving at work, Peter instead finds that his problem has solved itself: the Initech building is fully engulfed in flames, implying that Milton has finally made good on his quiet threats to destroy the company for slighting him and that all evidence of the missing money was destroyed. Peter finally finds a job that he likes: doing construction work with his next-door neighbor, Lawrence. As the two of them are cleaning up debris from the fire, Lawrence discovers Milton's stapler. Peter takes it, saying he thinks he knows someone who might want it, implying that "someone" is Milton. Samir and Michael drop by and offer to recommend Peter for a job at Initech's rival, Intertrode, where they have secured new jobs. Peter declines, content with his new job and life. Meanwhile, Milton lounges on the beach at a fancy Mexican resort, but he is still not happy; he is heard mumbling complaints about his beverage and threatening to take his traveler's checks (which he found in Lumbergh's office) to a competitor.