The story opens with Tom Dobbs (Robin Williams), a comedian and host of a satirical talk show who is able to tap into people's frustrations with the sharply divided, special-interest driven political climate. During his warm-up act, an audience member suggests that he run for President. At first, Dobbs laughs off the idea, but following a popular groundswell of support, later announces on the air that he will stand as a candidate. Through his efforts, he gets on the ballot in 13 states and participates in one of the national debates with the Democratic Incumbent President Kellogg and Republican U.S. Senator Mills.
A parallel plot follows Eleanor (played by Laura Linney), who works at a voting machine company called Delacroy. According to a television commercial in the movie, the entire United States will be using Delacroy voting machines for the presidential election. Shortly before the elections, Eleanor notices an error in the voting system, but the head of the company purposefully ignores her warnings. Initially, Dobbs approaches the campaign seriously - perhaps too seriously, to the chagrin of his staff, especially his manager Jack Menken (Christopher Walken). That turns around the night of the presidential debates, where, fed up with the posturing of the other candidates, he shifts back into comedian mode, managing to keep the audience laughing and make serious points simultaneously. From then on, he resumes his showman persona, thoroughly shaking up the political landscape. Dobbs surges in polls after the debates, but remains in a distant third to Kellogg and Mills.
Election Day arrives and polls show Dobbs at 17% with Kellogg and Mills tied in the 40s. Dobbs performs better than expected, although not well enough to be close to either of the two major candidates. Early returns show Kellogg beating Mills everywhere. Eleanor says that this is part of the error in the voting systems. Then all of a sudden Dobbs starts winning states. He first wins in Virginia, then North Carolina, and then big states such as California, New York and Texas. He now stands at 146 electoral votes and the news states if he wins the remaining states he is on the ballot in, he will become President. Soon afterwards, results show that Tom Dobbs has indeed won the race for President, beating out Kellogg and Mills. Dobbs is extremely shocked - like the rest of the world. While Dobbs and his crew move from shock to celebration, Eleanor remains unconvinced. She considers revealing the computer error to the public, but is attacked in her home (presumably by Delacroy agents) and injected with a cocktail of drugs. Upon going to work, her behavior is erratic in the extreme, and she is hospitalized for drug overdose (and the company uses this as a pretext to fire her). Upon recovering in the hospital, she realizes that very few people would believe her story, but decides that if nothing else, she must tell Dobbs.
Though still suffering from the aftereffects of the drugs in her system, Eleanor eventually makes her way to Jack Menken's birthday party. There, she unconvincingly impersonates an FBI agent but manages to catch Dobbs' eye, the two dance through the evening, and Dobbs gives her his telephone number. Eleanor cannot bring herself to tell Dobbs that he is not really the President-Elect. Later, Dobbs tries to get back in contact with Eleanor by calling Delacroy. This immediately raises the suspicions of the Delacroy leaders, and they redouble their efforts to silence Eleanor. Eleanor calls Dobbs and he whisks her off to a paintball fight, followed by Thanksgiving dinner. At dinner, she finally gets him alone to tell him that the elections were a fraud, then leaves.
Dobbs wrestles with the idea that he should not have been elected as President and finally decides to break Eleanor's news to the public in a major speech. However, Delacroy pre-empts his announcement with one of their own, stating that Eleanor was caught attempting to throw the election for Dobbs, but that her efforts had no impact on the polls. Eleanor becomes increasingly fearful for her safety, a feeling that is soon justified as agents break into the hotel room where she is staying to confiscate her computer, the only evidence she had.
Desperate, Eleanor first flees to a mall, where she is found by a Delacroy agent but escapes. She then drives to find a pay phone so that she can call Dobbs for help. She manages to reach him but is not able to communicate anything before the Delacroy agent's truck crashes into the phone booth; she escapes just before the collision but is still injured and is hospitalized a second time. Dobbs goes to the scene, and though he cannot understand what she is trying to say, he is convinced that she was telling the truth about the election. During the Weekend Update section of the sketch comedy tv show Saturday Night Live, he finally announces to the public that the elections were flawed and that he should not be President-elect.
Dobbs declines to accept victory in a phony election, and another election is held in which Dobbs chooses not to participate. President Kellogg wins another term, though, perhaps chastened by the Dobbs phenomenon, is much more sensitive to the populace as a whole rather than the special interests, and Dobbs returns to his career as a talk-show host, with Eleanor at his side as his producer and wife. The executives of Delacroy were convicted of fraud. The last seconds of the film shows a mock TIME magazine Person of the Year cover with Dobbs chosen as Person of the Year, whereas in usual circumstances, TIME always awards that honor to the winner of the presidential election.