In Litwak's Arcade, the game characters secret come to life when the arcade closes. Within the game of Fix-It Felix, Jr., the games inhabitants shun Wreck-It Ralph, the villain of the game. During the 30th anniversary of the game, Ralph, who was excluded from the party, gets into an argument with the mayor of Niceland, Gene, prompting Ralph to set off to retrieve a medal to prove he can be a hero. In his absence, Fix-It Felix, Jr. is put out of order, prompting Felix to go searching for Ralph.
Ralph enters the game Hero's Duty, where he meets Sergeant Calhoun and is forced to battle swarms of Cy-Bugs. Ralph manages to retrieve the medal, but he and a Cy-Bug are launched into the racing game, Sugar Rush. There, Ralph's medal is stolen by Vanellope von Schweetz, a glitch. She uses the medal to pay her fee into the Random Roster Race, but the game's ruler, King Candy, orders her arrested. Vanellope escapes while Ralph is captured instead. King Candy orders Ralph sent back to his game, but he escapes and witnesses Vanellope being tormented by the other racers, led by Taffyta Muttonfudge. Ralph chases the racers off and forms a partnership with Vanellope, who offers to win the race and get back Ralph's medal. Meanwhile, Felix and Calhoun enter Sugar Rush to find Ralph and the Cy-Bug.
Ralph and Vanellope bake a kart and arrive at Vanellope's home in the Diet Cola Volcano. Ralph teaches Vanellope to drive a kart, and they bond in the process. As they leave for the Random Roster Race, Ralph is approached by King Candy, who presents Ralph with the medal and claims that Vanellope racing could lead to the game being unplugged. Fearing for Vanellope's safety, Ralph destroys the kart and returns to his game, but finds it abandoned.
Ralph discovers Vanellope's picture on the side of the game console and returns to Sugar Rush. He interrogates King Candy's advisor, Sour Bill, into confessing that King Candy turned Vanellope into a glitch, and that crossing the finish line will reset the game. Ralph reunites with Vanellope and Felix, who repairs the kart. They enter Vanellope into the race, but Calhoun arrives and reveals to Ralph that the Cy-Bug had multiplied. The swarm attacks Sugar Rush, forcing its occupants to flee. At the same time, Vanellope exposes King Candy as Turbo, a racer from an unplugged racing game. Knowing that Vanellope can't leave Sugar Rush, Ralph flies to Diet Cola Volcano and attempts to erupt it, as the swarm will be attracted to the light. He is attacked by Turbo, who had merged with a Cy-Bug, and carried into the air, but he breaks free and erupts the volcano. Vanellope rescues Ralph while the swarm, including Turbo, fly into the volcano and are incinerated.
With the threat terminated, Vanellope crosses the finish line, resetting the game and restoring her to her status as princess, though she changes her title to president. Ralph returns to Fix-It Felix, Jr., saving it from being unplugged. Felix and Calhoun are married, and the occupants of Fix-It Felix, Jr. gain a newfound respect for Ralph.
- John C. Reilly as Wreck-It Ralph.
- Sarah Silverman as Vanellope von Schweetz.
- Jack McBrayer as Fix-It Felix, Jr.
- Jane Lynch as Sergeant Tamora Jean Calhoun.
- Alan Tudyk as King Candy/Turbo.
- Mindy Kaling as Taffyta Muttonfudge.
- Joe Lo Truglio as Markowski.
- Ed O'Neill as Mr. Litwak.
- Dennis Haysbert as General Hologram.
- Edie McClurg as Mary.
- Raymond S. Persi as Gene/Zombie.
- Rich Moore as Sour Bill.