Peter Gibbons, a discontented programmer at Initech, spends his days "staring at his desk" rather than really working. His co-workers include Samir Nagheenanajar, who is irritated by the reality that nobody can pronounce his last name properly; Michael Bolton, who loathes having the same name as the famous singer, whom he hates; and Milton Waddams, a meek, fixated collator who continually murmurs 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 constantly mistreated by management, especially Initech's smarmy, callous vice president, Bill Lumbergh. The staffs are further restless by the arrival of two consultants, Bob Slydell and Bob Porter, who are brought in to assist the company through downsizing and outsourcing.
Peter's girlfriend Anne persuades him to be present at 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 overlooks 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 makes a decision to play hooky 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 foolish management and love of the television program Kung Fu.
When Peter lastly shows up at work, he ignores Initech's dress code, takes Lumbergh's reserved parking spot, and declines to pursue Lumbergh's directions. He also gets rid of items that irritate him, such as a door handle that frequently shocked him and a cubicle wall that blocks his view out the window. The consultants, however, make a decision to endorse him because of the positive impression he makes on them with his frankness about the office's problems.
Peter then finds out that Michael and Samir's jobs will be eradicated, and the trio decide to get even by infecting Initech's accounting system with a computer virus intended to divert fractions of pennies into a bank account they control. They believe the scheme will do well because the amounts are too small for Initech to notice, while over time they will obtain a considerable amount of money. On Michael and Samir's last day at Initech, Peter takes one last item: a frequently-malfunctioning dot matrix, which the three beat to pieces in a field.
To his dismay, Peter finds out that a misplaced decimal point caused the virus to steal $305,326.13 in the first few days, a far more obvious loss to Initech. Haunted by the result, he admits to Joanna – who has lastly 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 admitting everything, and 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 denied his cherished red Swingline stapler by Lumbergh, forced to move to the cockroach-infected basement, and having had his paychecks finally cut off – enters Lumbergh's office to get back 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 surrounded in flames, implying that Milton has finally made well on his quiet threats to demolish the company for slighting him and that all evidence of the missing money was destroyed. Peter lastly 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 finds out Milton's stapler.
Peter takes it, saying he believes he knows someone who might want it. Samir and Michael drop by, and offer to advise 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 unhappy; he is heard tongue-tied protests about his beverage and threatening to take his traveler's checks (which he found in Lumbergh's office) to a competitor.