The series starts with Kingdom Hearts showing how Sora is separated from his friends Riku and Kairi when their world, Destiny Islands, is invaded by creatures known as the Heartless. During the invasion, Sora obtains a weapon called the Keyblade that allows him to fight the Heartless. He soon arrives in another world, Traverse Town, where he meets Donald Duck and Goofy, two emissaries from Disney Castle sent by King Mickey to find the wielder of the Keyblade. The three band together and travel to different Disney-themed worlds, sealing the hearts of the worlds to prevent more Heartless invasions. Along the way, they encounter a group of Disney villains led by Maleficent, who are controlling the Heartless to capture maidens called the "Princesses of Heart", and use their power to open the door to "Kingdom Hearts" and rule over all the worlds. Though they eventually defeat Maleficent, the three discover that Ansem (Xehanort's Heartless) has been using Maleficent and plans to attain eternal darkness by opening Kingdom Hearts himself. Sora, Donald, and Goofy defeat Ansem and seal the door to Kingdom Hearts with the help of Riku and King Mickey on the other side of the door.
In Kingdom Hearts: Chain of Memories, Sora and his two friends begin searching for Riku and King Mickey. They arrive at a fortress called Castle Oblivion, where they encounter members of a mysterious group called Organization XIII, which is made up of non-existent beings called the Nobodies. While in the castle, the three's memories are manipulated by a girl named Naminé who is being forced to do so by the Organization's Marluxia. After defeating the Organization members controlling the castle, the three are put to sleep for a year by Naminé to allow them to regain their memories, though they must lose the memories of their experience in Castle Oblivion. Meanwhile, Riku appears in the basement of the castle and begins traveling to the first floor with the aid of King Mickey. Riku fights both the Organization's members and the darkness in his heart, learning to accept his dual nature between light and darkness. Allying himself with DiZ, Riku aids him in keeping Sora and Naminé safe until the former is awoken. However in Kingdom Hearts 358/2 Days, a snag in the plan over the year forces Riku to capture Roxas, the thirteenth member of the Organization and Sora's Nobody (after Roxas's defeat of Xion, Sora's Replica) and is successful reintegrating Roxas with Sora, enabling Sora's reawakening.
At the end of the year in Kingdom Hearts II, Sora and friends awaken from their sleep and resume their search for Riku and King Mickey, learning of the Nobodies and becoming re-familiarized with Organization XIII. Sora once again travels to many Disney-themed worlds and resolves the troubles caused by the Heartless and Nobodies. They eventually reunite with King Mickey and encounter Xemnas, the Nobody of Xehanort and the leader of Organization XIII. The Organization's plan is also revealed—they seek the power of "Kingdom Hearts", the sum of all the hearts that Sora released by destroying the Heartless with his Keyblade, to regain their lost hearts. With the aid of Axel, a rogue member of the Organization who was Roxas's friend, the three arrive at the headquarters of Organization XIII and team up with their friends while defeating the Organization's Xigbar and Saïx. Ansem the Wise (who turns to be DiZ after his apprentice Xehanort banished him) uses a device that dissipates some of Kingdom Hearts' power, but a system overload causes the device to self-destruct, engulfing Ansem. At the top of the Castle that Never Was, Sora and his friends battle Xemnas, who uses what remains of Kingdom Hearts to power his multiple forms. After Sora and Riku destroy Xemnas, the two are reunited with their friends at their home.
Another year later, Sora, Riku and Kairi receive a message from King Mickey's detailing how the three became who they are now that Naminé learned of while restoring Sora's memory and left a message in Jiminy's journal that Mickey discovered during the events of Kingdom Hearts coded. As they read the letter, learn of the exploits of the three Keyblade wielders' fates during the events of Kingdom Hearts Birth by Sleep (a decade before Kingdom Hearts) by the hands of Master Xehanort (the true Xehanort and an old Keyblade Master) trying to recreate the legendary χ-Blade which all Keyblades are modeled after and plunge the worlds into chaos: Terra was converted into Xehanort's new vessel whose experiments later turned his heart into "Ansem" and his body into Xemnas, Ventus sacrificed himself to defeat his dark doppelganger Vanitas to stop Xehanort's plan to obtain the χ-Blade to which his body was placed somewhere within Castle Oblivion while his heart ended up with the body of Sora himself, and new Keyblade Master Aqua ended up in the Realm of Darkness. King Mickey also discovers that the destruction of "Ansem" and Xemnas has led to the reconstruction of Master Xehanort. To combat the new threat Xehanort poses, Sora and Riku take an exam to attain the Mark of Mastery that will allow them to become Keyblade Masters themselves.
hrough time. The two Keyblade wielders also learn of Xehanort's true goal: creating thirteen replicas of himself by placing a piece of his own heart in each "host", thus infecting the body's original heart and taking it over then will pit them against seven hearts of pure light in an ultimate battle to recreate the χ-Blade once more. Though the Organization was defeated, Xehanort expected it and became "Ansem" for the purpose of giving his younger self the ability to travel through time and gather other versions of Xehanort together to form the true Organization XIII, the Thirteen Seekers of Darknesses. Though Sora is narrowly saved from becoming Xehanort's final vessel with the aid of Lea, Axel's original self, Riku entered Sora's body to wake him from the nightmare Xehanort placed him in. In the process, meeting Roxas, Ventus, and Xion within Sora's mind, Riku learned from a digital copy of Ansem the Wise that reveals the data he implanted in Sora and how he may be able to save both those who are lost and those that ceased to be. At the end of the exam, only Riku is declared a Keyblade Master while Sora embarks on a new journey by himself to train. In the meanwhile, left with no other option as he feared the Princesses of Heart would be dragged into the conflict, Yen Sid resolves to form the Seven Guardians of Light from any available Keyblade user (including Kairi) to combat the Thirteen Darknesses in the upcoming final battle.