When Litwak's Arcade closes at night, the various video game characters leave their normal in-game roles and are free to travel to other games. Within the game Fix-It Felix, Jr., the characters celebrate its titular hero but shun the game's villain character, Wreck-It Ralph. At a support group for video game antagonists, Ralph reveals his desire to stop being the bad guy. Back at home, Ralph finds the other characters celebrating their game's 30th anniversary without inviting him. Felix reluctantly invites Ralph to join them, but the others ostracize him, saying he would have to earn a medal, just as Felix does in their game.
While visiting Tapper's, Ralph meets a soldier from the first-person shooter Hero's Duty, who tells him the game's winner receives a medal. Ralph enters the game and encounters Sergeant Calhoun, its no-nonsense leader. Between game sessions, Ralph climbs the game's central beacon and collects the medal, accidentally hatching a Cy-Bug, one of the game's enemies. The Cy-Bug clings to Ralph as he stumbles into an escape pod that launches him out of the game. Meanwhile, with Ralph missing, a girl reports to Litwak that Fix-It Felix, Jr. is malfunctioning. Since broken games get unplugged, leaving their characters homeless, Felix sets off to find Ralph.