Kingdom Hearts Chain of Memories is the second game in the Kingdom Hearts series. It is a direct sequel to Kingdom Hearts and a prequel to Kingdom Hearts II. It was published by Square Enix and developed by Jupiter, and was released in 2004.

The game focuses on Sora, Donald and Goofy making their way through a mysterious castle and reliving their memories of Kingdom Hearts, but with a card-based battle system. Aspects of the storyline are essential to understanding Kingdom Hearts II and also later entries in the series.

The original 2D version of the game is exclusive to the Game Boy Advance. It received a 3D remake called Kingdom Hearts Re:Chain of Memories, available for PlayStation 2, PlayStation 3 and PlayStation 4.

Sora, Donald, and Goofy walk down a long path that seemingly goes nowhere. They see Pluto and start to follow him. He leads them to a crossroads. While deciding which path to take, a mysterious man in a black cloak approaches Sora and speaks to him, but at that moment his words are incomprehensible. The path becomes one and it leads them to Castle Oblivion. The cloaked man appears as they enter the castle and gives them a card. They use the card to proceed through the castle.

The first world they go to is Traverse Town, where they discover that Leon, Aerith, Yuffie, and Cid have forgotten all about them. Strangely, though, they remember Sora, Donald, and Goofy's names, with Yuffie even mentioning that her heart still holds memories of them, even if her head doesn't. After Leon gives Sora a tutorial on fighting and gives Sora a summon card, they leave Traverse Town.

The cloaked man from before appears once more after they arrive on the next floor, but a second cloaked man also appears and introduces himself as Axel, challenging Sora to battle. Sora fends him off and is given more World Cards, and as Sora, Donald, and Goofy go through each floor, they relive their memories, all of which are somehow distorted in a different way, and begin to lose their original memories. By piecing together their distorted memories, they eventually discover that a Nobody, Naminé, has been reorganizing their memories at the orders of Marluxia, the Nobody who led them to the castle, in order to put herself in Kairi's place within Sora's memories and thus make him more compliant to the control of the Nobodies. As he makes his way to the peak of the castle, Sora slays the Organization members Larxene and Vexen, as well as defeating the Riku Replica created by Vexen and similarly reprogammed by Naminé to be loyal to her.

Meanwhile, Riku chooses to reject the peaceful sleep of the Realm of Darkness and is pulled through a Corridor of Darkness to the basement of the castle. He makes his way through the castle with the assistance of King Mickey Mouse, while fending off the temptations of Ansem, who has left a piece of himself within Riku's heart and wants Riku to return to being his host, as well as repelling attacks from Vexen, Lexaeus, Zexion, and their Riku Replica, who want to use Riku as a weapon to counter Marluxia's use of Sora. Along the way, Riku discovers that not all of Ansem's temptations were actually made by Ansem—some were instead made by DiZ, who was disguising himself as Ansem in order to test Riku's resistance to darkness.

At the end of the journey, Sora puts an end to Marluxia, freeing Naminé and the Riku Replica. Due to the damage done to Sora's memory, Naminé offers to restore his memories, although it means he will forget everything in the castle and will take a long time. Sora, Donald, and Goofy agree to this and go to rest in Memory Pods provided by Naminé.

DiZ asks Riku which road he intends to take next.

The Riku Replica instead chooses to reject its given memories entirely, and leaves to find his own purpose. Desperate to prove that he is his own person, he is persuaded by Axel to slay Zexion in order to take his power and become something that the original Riku is not, but he is disappointed when it doesn't make him feel any different. Riku, following advice from DiZ to seek Naminé, runs into his Replica at the Twilight Town basement, and in a rage the Replica challenges Riku to a fight to the death. Riku wins, and tries to comfort his suffering Replica as the Replica fades away. Afterward, Riku finds Naminé and is shown Sora's situation. Naminé offers to manipulate Riku's memories in order to lock Ansem's phantom away, but Riku declines and instead chooses to confront Ansem directly. When he emerges from the basement, DiZ presents him with a black coat to protect him from the darkness and so the Organization won't be able to track him down. He also gives him a World Card to summon forth Ansem from his heart in order to defeat him.

After defeating Ansem, Riku and Mickey go to the crossroads outside the castle, where DiZ appears once again to ask if Riku will be following the road to light or the road to darkness. Instead, Riku chooses the middle road, "to dawn".

Kingdom Hearts Chain of Memories follows a totally new battle system as well as gameplay. The battle system now revolves around Sora's memories, represented as cards. Using these cards is the only way to attack. Map Cards are used to create rooms on each floor of the castle. What appears in each room depends on what card was used to generate that room. To obtain a map card you must defeat Heartless. Some map cards can only be obtained after getting further into the story for each of the different worlds.

There are three types of cards that are different from the other cards in battle:

Friend cards - Appear in the battlefield at certain times for pickup and can summon an ally to help fight. These have green borders, like Item cards.

Enemy cards - Based on enemies or bosses and can temporarily give Sora (or Riku) better offensive or defensive capabilities. These have black borders, and cannot be used in sleights.

Gimmick Cards - Gimmick cards only appear during certain boss battles. Unique attributes of these cards is that they are always green, the card value is always 0, and the picture on the card is a green Mickey Mouse insignia, like the keychain attached to the Keyblade. When used, the colors on the screen inverse, and the boss is either stunned, or the battle area changes allowing you to gain the upper hand. Due to their card value, they always break the enemy's attacks, and their effect prevents the boss from attacking until it is completed.

Each card has a number from 0 to 9. This is known as Card Value. When a card is played against the enemy's card, the card with the lower value "Breaks" and is discarded. This leaves enemies vulnerable for a few seconds. Cards with a value of 0 can break any attack, but can be broken by any card if played too early.

A special ability that can be either learned from leveling up or obtained from boss fights or chests. Some sleight examples are: Sonic Blade, Strike Raid, and Ars Arcanum.

Some of these sleights did not appear in Kingdom Hearts, such as Fire (Blizzard, Thunder) Raid, Homing Fira (Blizzara, Thundara), etc., as well as some friend sleights, such as Blazing Donald. Further sleights were added to Kingdom Hearts Re:Chain of Memories as well.

Cards can be combined into sets of three, not only creating a higher value combo that is more difficult to break, but is also essential in activating sleights. The cost of combining cards is that the first card used in the combo cannot be reloaded when the deck is reloaded, although certain items, such as Elixir and Megalixir, can reload any unreloadable cards.

Sora can use any available card to create up to three decks as long as there is at least one attack card in his deck and the player doesn't exceed his Card Point (CP) limit. During Level Up's Sora can increase his CP, in addition to obtaining more HP and new sleights at certain times. Other than using Attack, Magic/Summon, and Items cards, Sora can also use Premium cards, which are special Attack or Magic cards. These cards do not require as much CP to equip although they can become unreloadable cards when used, with the minor exception as the second or third card in a combo. Other than using Moogle shops to obtain additional cards, Sora can also collect cards by smashing or jumping on objects, occasionally making a random card appear. There are certain cases where Sora has to earn the card through the storyline first before it becomes available in a Moogle Shop.

There are cards throughout the game that are used to open doors to different rooms once entering a certain world. They are in the same colors as the magic, item, and attack cards, except they are usually only gained at the end of a battle, and they generally only are used to open doors within worlds. They may have names such as Roulette Room, Tranquil Darkness, Feeble Darkness, Calm Bounty, Martial Waking, and even special room cards called Key to Rewards and many more. They are needed to open all doors throughout Castle Oblivion.

After completing the game as Sora, a new challenge arises. Reverse/Rebirth mode follows Riku as he climbs the basements of Castle Oblivion. Riku gets a World Card for each of the worlds Sora goes through except 100 Acre Wood. Riku's deck cannot be changed; however, it changes automatically as time goes on. Riku does not need as much time to reload his deck. Certain enemy cards are only available to Riku, and then unlocked for Sora after completing the game with Riku. Riku can only keep the enemy cards that are based on the bosses after winning them during battle, the others are available in one world only.

Instead of leveling up HP, CP or sleights, when Riku levels up, he can increase HP, AP (Attack Power), or DP (Dark Points). After Ansem, Seeker of Darkness (who is still alive) tempers the darkness in Riku's heart, Riku can use his dark powers during battle. These powers are triggered by taking damage or breaking his opponent's cards; when the Dark Points reach 30 or more, Riku will automatically go into Dark Mode. In Dark Mode, Riku can use 3 powerful sleights exclusive to his Dark Mode: Dark Aura, Dark Firaga, and Dark Break (these attacks were used by the Riku Replica in Sora's story). How long Dark Mode lasts depends on how much DP he has, and taking damage as well as being card broken reduces the amount of DP Riku has left in a given battle. When the DP counter reaches zero, Riku turns back into his original form. Dark mode can be achieved any number of times in a given battle.

Riku does not have access to any of the friend cards that Sora had. Instead, he has King Mickey as his only friend card. Using Mickey heals Riku, reloads the deck, and stuns enemies for a few seconds. Using more Mickey cards at once increases the power of this attack. Because of his inability of using magic cards, Riku cannot heal as easily during battle, limiting it to the Oogie Boogie and Search Ghost enemy cards in addition to Mickey Mouse. Bosses exclusive to Riku's story are: Zexion (Kingdom Hearts Re:Chain of Memories only), Lexaeus, and Ansem, Seeker of Darkness.

With the use of a Game Link Cable, an additional multiplayer mode can be played, where two players battle each other. Decks are loaded from save files of Sora's story. The player controls Sora while the opponent is depicted as AntiSora, although the difference between the two is only cosmetic. Different worlds can be chosen to determine the arena's background. Both players can see each other's battle cards to some extent, though this effect can be blocked with the Darkball enemy card.