Peter Gibbons is a frustrated and unmotivated programmer who works at a company called Initech. His co-workers include fellow programmers Samir Nagheenanajar and Michael Bolton, as well as Milton Waddams, a meek collator who is mostly ignored by the rest of the office. The staff constantly suffer under callous management, especially Initech’s smarmy vice president Bill Lumbergh, whom Peter loathes. Peter’s girlfriend Anne persuades him to attend a hypnotherapy session. Dr. Swanson, the therapist, dies of a heart attack while hypnotizing Peter. A newly-relaxed and self-confident Peter acts on the impulse to skip the next workday, and he ignores phone calls from Lumbergh and Anne, who angrily breaks up with him and admits she was cheating on him. Peter begins dating Joanna, a restaurant waitress who shares Peter’s loathing of management.
Meanwhile, a pair of business consultants, Bob Slydell and Bob Porter (colloquially known as the Bobs), are brought in to help the company downsize. Peter finally shows up at work and casually disregards office protocol, including violating Initech’s dress code, taking Lumbergh’s reserved parking spot, refusing to follow Lumbergh’s directions, and removing a cubicle wall that blocks his view out the window. The Bobs are impressed by his frank insights into Initech’s problems, and they decide to promote him despite Lumbergh’s objections. Michael and Samir, however, are fired. Milton is also expected to be eliminated, but it is learned that Milton’s contract had been terminated five years prior, of which Milton and the accounting department were not informed. To avoid confrontation and riding on the hope that the issue will resolve itself naturally, the Bobs and Lumbergh inform only the accounting department and cease Milton’s salary payments.
Peter, Michael and Samir decide to take revenge by infecting Initech’s accounting system with a computer virus designed by Michael to divert fractions of pennies into a bank account. They believe that such transactions are small enough to avoid detection but will result in the accrual of a substantial amount of money over time. On Michael and Samir’s last day at Initech, Peter steals a frequently malfunctioning printer, which the three take to a field and smash to pieces to vent their frustration. At a barbecue, Peter hears rumors from a coworker that Joanna slept with Lumbergh in the past (before dating Peter). When Peter confronts her about this, a heated exchange leads to them breaking up.
Peter discovers that a bug in Michael’s code has caused the virus to steal over $300,000 in only a few days, which is far more conspicuous. Peter, Michael and Samir meet to try to devise a plan to launder the money to no avail. After Michael and Samir blame Peter for their predicament, he decides to accept full responsibility for the crime and writes out a confession, which he slips under Lumbergh’s office door late at night, along with traveler’s checks for the stolen money. Peter reconciles with Joanna, and learns that the Lumbergh she slept with was an ex-coworker.
The next morning, Peter drives to Initech fully expecting to be arrested, but discovers that the building has been set on fire, destroying all of the evidence of the scheme. Milton flees the scene with the traveler’s checks, having apparently made good on his threats to burn down Initech after being pushed too far. Samir and Michael begin new jobs at Initech’s rival Initrode, while Peter lands a dream job as a construction worker with his neighbor Lawrence. Milton uses the money from the traveler’s checks to vacation in Mexico.