At a video game arcade in 1982 with his friend Will Cooper, 13-year-old Sam Brenner seemingly loses a championship game of Donkey Kong to obnoxious Eddie "The Fireblaster" Plant. Videocassette footage of the event is included in a time capsule launched into space. In the present day, Brenner is an electronics installer while Cooper is the unpopular President of the United States. In Guam, the Andersen Air Force Base is besieged by an extraterrestrial force attacking in the form of Galaga and a soldier is abducted.
Brenner works at the home of divorced U.S. Army lieutenant colonel Violet van Patten, and the two are separately summoned to the White House by Cooper. Upon seeing the video footage and meeting with Ludlow "The Wonder Kid" Lamonsoff, Brenner deduces that the aliens have somehow mistaken the videocassette images for a declaration of war, and are attacking Earth with a strange technology that allows them to morph into the video games featured at the championship. The aliens interrupt a television broadcast using footage from the cassette, challenging the people of Earth to a battle where if the aliens win three times, they will conquer the planet. Brenner and Cooper are unable to stop one of the attacks as the Taj Mahal is damaged by the aliens in the form of Arkanoid and a bystander is abducted.
Brenner and Ludlow train Navy SEALs to play the games. Violet develops directed energy weapons that are effective against the aliens. The team later heads to London, where the aliens attack Hyde Park in the form of Centipede. The soldiers begin to lose, so Brenner and Ludlow step in and shoot them down. The aliens send congratulations and a "trophy" in the form of the Duck Hunt dog to an old lady.
Ludlow and Cooper retrieve Eddie from a prison sentence for fraud before going to New York City. There, the team must fight an alien taking the form of a giant Pac-Man, playing as the ghosts. Toru Iwatani, creator of Pac-Man, tries to reason with Pac-Man peacefully, but gets his hand bitten off. Brenner, Ludlow, and Eddie overcome the challenge using modified Mini Cooper cars, but Violet notices Eddie moved at supersonic speeds around the board. Brenner is able to trick Pac-Man into going after him once the effects of the power pellet run out. They win Q*Bert as a trophy. During a celebratory party, however, the aliens announce that the challenge for the planet has been forfeited because someone cheated. Violet's son Matty discovers that not only did Eddie use a cheat codes written on the inside of his glasses during the battle against Pac-Man, but also as kids while playing Donkey Kong against Brenner. Eddie flees while Matty is abducted by the aliens.
The aliens launch a massive attack on Washington, D.C. using an army of video game characters and enemies. Cooper joins the team, while Ludlow stays to fight. An alien takes the form of "Lady Lisa", a video game character on whom Ludlow has had a crush since childhood. Ludlow persuades Lisa to choose love and side with the humans as Eddie, wishing to make amends, returns to fight. Brenner, Violet and Cooper are summoned to the aliens' mothership for one last chance to save Earth, where they face their leader, who takes the form of Donkey Kong, on the starting level with the aliens' captives at the top level. As the group dodges barrels and fireballs, Brenner is losing hope until Matty reveals Eddie cheated at Donkey Kong, meaning that Brenner was the world's best Donkey Kong player. This restores Brenner's spirit, allowing him to keep fighting and avoid the rolling barrels. Once Brenner defeats Donkey Kong, the aliens' forces, including Lisa, disappear from Earth.
The team is hailed as heroes and Cooper manages to reach a peace agreement with the aliens. Eddie apologizes to Brenner for cheating and praises him as the best player in Donkey Kong, and although Ludlow is saddened that Lisa is gone, Q*Bert transforms its likeness to Lady Lisa. Brenner and Violet become a couple while Eddie gets to meet Serena Williams and Martha Stewart. The aliens restore everything on Earth, including Iwatani's hand, before their departure. A year later, Lady Lisa and Ludlow marry and have Q*Bert-like children.