Ender, a child of six, has been monitored carefully to see if he qualifies for Battle School. The monitor was attached to his body so that the officials of the International Fleet, specifically Colonel Graff, could effectively "be inside Ender's mind." After Ender's monitor is removed, several boys in his class, led by the bully Stilson, corner him and abuse him, knowing that the officials can no longer watch what happens. But Ender tricks Stilson into fighting him alone, and Ender beats him badly. Ender cries, showing his remorse at being so ruthless, being more like his sadistic brother Peter than his compassionate sister Valentine.
At home, Peter makes him play "astronauts and buggers," a game in which Ender is always the "bugger" alien, being beaten up by Peter. Peter is murderous and relents only when Valentine intervenes. Peter threatens to kill them both at some point in the future. Later that night, when Peter thinks Ender is asleep, Peter leans over him and tells him that he loves him.
Colonel Graff comes to the Wiggin household and asks Ender why he beat Stilson so thoroughly. When Ender explains that he had to win decisively so that no kid would attack him again, Colonel Graff offers him a place at Battle School, a school for the training of young children to become military commanders of the International Fleet. After some persuading by Graff, Ender decides to go.
En route to Battle School, Graff deliberately isolates him by telling the other boys that Ender is far superior to them--which quickly is proved true. Ender thus earns many enemies from the start. When one boy named Bernard hits him on the head, Ender grabs the boy's arm and inadvertently sends him flying, breaking his arm. During the next few weeks, Ender and his fellow "launchies" go through hours of classes per day and play the games in the game room. Bernard gathers a group of bullies, but Ender's ability to figure out Bernard's gang allows him to make his first friend, Shen. When Bernard makes fun of Shen's wiggling of his butt while he walks, Ender sends around a message mocking Bernard for watching people's butts.
In the battleroom, wargames are simulated. Ender and Alai become friends by working out how to fly and use their "laser" guns. Their alliance leads to battleroom proficiency that is respected, so Alai becomes the boys' new favorite.
Apart from their time in the battleroom, the boys play the "mind game," or "Fantasy game," which adapts as the players develop. Ender amazingly defeats the Giant's Drink section of the game and goes where no one has gone before, "Fairyland," and then the "End of the World," and even beyond that to a castle. In the castle is a mirror that reflects not his own face but Peter's.
Ender is promoted into his first training army, Salamander Army, commanded by Bonzo Madrid. Being so new, he is told not to interfere with the seasoned players. He uses his time in battles to observe them and learn technique and strategy.
He is befriended by the only girl in the army, Petra Arkanian, who teaches him battleroom technique during their free time. He learns a great deal from her, being a truly fast learner. He also practices during the evenings with his launchie friends, learning together and teaching what he knows. Finally he disobeys Bonzo's order and takes action in a battle, doing very well.
Ender is traded to Rat Army under Rose de Nose, in Dink Meeker's toon, according to Dink's request. Ender's reputation has risen very high very quickly. A year after Ender being promoted to Salamander Army, he is a toon leader in Phoenix Army under Petra. But Ender is restless and hates his life.
Back on Earth, Ender's siblings Valentine and Peter have moved to the countryside of North Carolina with their parents. Peter's desire for world domination tempers his sadism somewhat, though he skins squirrels, and he decides to influence world politics by writing excellent commentary and opinion on what amounts to the Internet. He convinces Valentine to join him; he will be "Locke" the peacemaker, while she will be "Demosthenes" the warmonger, warning about the Russian plot to shift world power in their favor after the pending victory against the buggers. In the new world order, Peter will need to be seen as the peacemaker in order to gain respect and power.
Ender is wildly successful but tired of all the training and the constant struggle against his teachers, who seem to be the true enemies. He also fears that he is becoming ruthless like Peter. Graff persuades Valentine to assert that Ender is not like Peter after all, which she always used to tell him to comfort him. This idea reaches Ender, and it helps him break free of the impasse in the fantasy game; he kisses a snake in the castle instead of killing it, and it turns into Valentine. Ender also continues his training.
Ender is made commander of Dragon Army, which is newly formed and composed of many of the least able army recruits. Through his superior leadership and training skills, he works up Dragon Army into a clear victor time after time. Ender's army is so good that it is given seven battles in one week and keeps winning. One boy, Bean, stands out and is something of a young version of Ender himself. Alai is in a different army and is no longer clearly Ender's friend. And when Ender's army beats Bonzo's, Bonzo becomes incensed. Ender's friends warn him to be careful.
Ender realizes that the teachers are going to continue stacking the odds against him as much as they can, so Ender rises to the challenge. He knows that the reason the teachers promoted the two of them way before their time is because "they need us, that's why. Because they need somebody to beat the buggers. That's the only thing they care about." Ender confides in Bean that he is getting tired of the battles, of the commanding, of everything.
Shortly afterward, when Ender is in the shower, Bonzo and seven older boys walk in. Ender persuades Bonzo into fighting him one on one by invoking Bonzo's honor, and then Ender beats Bonzo thoroughly (Bonzo dies, like Stilson did, but nobody tells Ender). The teachers know what is going on but stay out of the fight to ensure that Ender keeps relying on himself alone.
Soon Ender's army is made to fight two armies at once. Though he wins, Ender is furious at Major Anderson's continued changing of the rules and parameters of the game. He decides not to participate in the game anymore. Ender is transferred to Command School, skipping both Tactical and Pre-Command Schools, but first, Ender is sent back to earth for "a short landside leave."
Meanwhile, Valentine and Peter, as Demosthenes and Locke, are beginning to have real influence in world politics. Graff takes Valentine to a lake house where Ender has been living, and she tells Ender about Peter's plan to essentially take over the world. Ender tells Valentine that he hates himself, because in order to beat his opponent, he has to understand him, and in understanding his opponent, he eventually grows to love him, and that it is in that moment--when he loves his enemy--that he destroys him. Valentine eventually convinces Ender to continue with his studies; the Earth and Valentine are worth fighting for. Still, he worries that because he never beat Peter, perhaps he cannot beat the buggers. Ultimately he wants love, not victory; he wants Peter "to love me." Ender goes with Graff on the three-month voyage to Command School, on the satellite Eros.
On Eros, Ender is tutored mainly by the teachers individually, together with one of the four "simulators" that act like the battleroom in preparing the Command students for the Third Invasion. After a year of practicing on the simulator, Ender wakes up one morning to an old man sitting in his room. It is the famed Mazer Rackham, who defeated the buggers in the Second Invasion. Mazer becomes his teacher and thus his enemy, because the only teacher worth having is one who acts as the enemy.
Mazer has surpassing wisdom and cunning. Mazer and Ender watch the videos from the First and Second Invasions and learn strategy. Mazer suggests that the buggers act unthinkingly on the orders of a queen bugger, so Ender and Mazer work from the assumption that they can beat the buggers through the individual initiative of excellent commanders acting on their own volition in battle.
Ender learns that the Third Invasion is to be an invasion by humans of the bugger worlds and that starships are close to their bugger destinations. One new weapon they possess is a device called the Little Doctor, which can split apart molecules and cause a chain reaction so that anything in its expanding radius explodes as well.
Ender is joined in the simulator by his old toon leaders, plus Alai, Shen, Carn Carby, and "all the best students that Ender had fought with or fought against, everyone that Ender had trusted in Battle School," who all become squadron leaders in the training. He directs them in their battle simulations as the supreme military commander of the force. After three weeks of practice with his squadron leaders, Mazer tells Ender that he has gone beyond the capability of computer simulations, so Mazer himself will program the scenarios.
Early the next morning, Mazer wakes Ender and his battles begin. They last for at least several months, and Ender's squadron leaders are worked beyond their limits. Petra falters during a battle, and even Ender passes out one day. Ender has progressively worse nightmares, and the battles themselves get harder and harder, so while Ender still wins all of them, he loses more and more ships.
Finally, dozens of people join Ender to watch a battle, and Mazer tells him that this battle will be his final test at Command School. When the simulation comes up on Ender's screen, the bugger ships outnumber his own fleet a thousand to one, and they surround a planet entirely. Mazer tells Ender that the battle is a simulation of the future battle at the buggers' homeworld, where all of their queens live. Ender sees the situation as hopeless, one more impossible task to test his limits. Bean says, "Remember, the enemy's gate is down," something that Ender taught his army during every practice at Battle School. This comment reminds Ender to follow his usual strategy of breaking the normal rules of warfare, so he tells his squadron leaders to dive straight in toward the planet, avoiding the weapons of the enemy ships. Once they get close enough, they fire the Little Doctor at the planet's surface. None of the fighter ships in the area survive when the planet explodes, but the chain reaction takes out all of the bugger ships and bugger queens.
Everyone around Ender starts cheering, weeping, praying, and thanking him--in fact, it was no simulation but the Third Invasion itself. Ender becomes furious at this latest trick.
On Earth, the victory leads to the revitalization of old rivalries, basically the Americans versus the Russians. The war extends as far as Eros, but eventually peace is forged via the "Locke Proposal," most likely Peter's creation.
One year later, Ender is still on Eros, helping prepare for the new colonization movement that Graff is leading. Peter is coming to great power in world politics and wants Ender returned to Earth for his own benefit, but Valentine orchestrates matters so that she and Ender will join the colonists.
Ender agrees, after much persuasion, to join the colonists' mission. He says he will do it because he "knows the buggers better than any other living soul," and he wants to "understand them better." The voyage to their new world takes a long time, and Peter has become Hegemon. Valentine writes a series of long novels on the bugger wars.
Several years later, Ender helps with another colonist mission. Searching for an acceptable place to land, Ender starts to recognize the place around him as the giant's corpse from the Fantasy game. It appears that the buggers built it for him, being apprised somehow of the scenario the computer had built for him. He finds the tower at the End of the World, pulls the mirror off the wall, and finds a bugger queen still in larval form.
Apparently through her thought-speaking, Ender learns many collective memories of the bugger history, including the feelings of despair when the old queens realized that humans were sentient beings, not just non-thinking workers like the bugger workers. They realized they were severe murderers during the first two invasions. She tells him, "We are like you ... We did not mean to murder, and when we understood, we never came again ... We could live with you in peace."
When he gets back to his colony, Ender writes a novel about the buggers and their interactions with humans as though the queen herself was speaking. He signs his name as "Speaker for the Dead," and this idea launches a religion. People start having Speakers for the Dead at their funerals, telling true stories without hiding any faults or pretending any virtues. Peter recognizes the book as Ender's when Valentine attaches it to her final bugger volume, and he asks Ender to Speak for him. Ender agrees.
Ender travels with the queen's cocoon to find her an acceptable place to live in safety, but he looks for a long time and in many places.