The wedding for Will Turner and Elizabeth Swann is disrupted with the arrival of Lord Cutler Beckett of the East India Trading Co. who has warrants to arrest the two and the ex-Commodore James Norrington for helping Captain Jack Sparrow to evade his hanging. Elizabeth is imprisoned while Beckett negotiates with Will to locate Jack and retrieve his compass which has the ability to point in the direction of what a person most desires. At the same time, Jack Sparrow reveals to his crew on The Black Pearl that they are going to find a mysterious key. Jack is approached by a reincarnated Bootstrap Bill Turner, Will's long-deceased father, who reveals he is now part of the crew of The Flying Dutchman captained by Davy Jones, and Jack must pay his debt to him - Jack asking Jones to raise his ship from the depths and make him captain for thirteen years. Bootstrap further tells Jack that the Kraken will be sent after him. In panic, Jack sails the Black Pearl to the nearest land.
Will searches for Jack, eventually finding the Black Pearl on Pelegosto where a tribe of cannibals worship Jack as a god and plan to eat him. Jack, Will and surviving crew members escape the island, joined by Pintel and Ragetti, former members of the Black Pearl crew who escaped execution. Elizabeth escapes jail with help from her father Weatherby Swann but he is captured while Elizabeth is sent off by Beckett to offer Letters of Marque to Jack in return for the compass. Jack and his crew visit voodoo priestess Tia Dalma, who tells them that the key unlocks the Dead Man's Chest where Davy Jones' cut-out heart is hidden; the key is in possession of Jones. Tia also gives Jack a jar of dirt to protect him from Jones, since Jones is cursed to touch land only once every ten years.
Upon finding a damaged ship, Jack sends Will aboard to "settle" his debt with Jones. Will is captured by the fish-like crewmen of the Flying Dutchman and Davy Jones reunites with Jack, forcing him to gather one-hundred souls in three days for his deal to be called off. Will is drafted onto the Dutchman, where he meets his father, Bootstrap Bill. After tricking Jones into revealing the location of the key, Will manages to steal it from Jones while he is sleeping and escapes the ship with the promise to rescue Bootstrap. Jack and his crew stop in Tortuga, where Elizabeth and a drunken Norrington join them.
Jack and his first mate Joshamee Gibbs realize that Beckett wants the compass to seek the chest and use Jones' heart to control him and destroy all piracy on the seas. Will finds refuge on a trading ship, but it is destroyed by the Kraken. The Black Pearl sails to Isla Cruces where the chest is buried, and Jack, Elizabeth and Norrington recover it. Will arrives with the key, planning to stab the heart to free his father, unaware that whoever stabs the heart becomes the next captain of the Flying Dutchman. Norrington wants the heart to regain his position in the Navy, while Jack is primarily interested in becoming immortal, able to sail the ocean waters for all time.
Quickly, the argument about the heart's fate flares tempers, and a three-way sword fight breaks out between Jack, Will and Norrington. While Pintel and Ragetti try to steal the chest, Jones' crew arrives on the island, forcing Elizabeth, Pintel and Ragetti to fight them together, causing the chest to be dropped. Jack unlocks the chest, finds the heart inside, and hides it in the jar of dirt Tia Dalma gave him. Norrington spirits away the heart and the Letters of Marque, Jack believing the heart is still in the jar. Later, the Flying Dutchman attacks the Black Pearl which escapes the Dutchman until then attacked by the Kraken. Jack tries to flee, but returns to help defeat the Kraken, wounding it with an explosion, but the ship is heavily damaged and most of the crew are dead, leaving only Jack, Will, Elizabeth, Gibbs, Pintel, Ragetti, Cotton and Marty. Jack orders everyone to abandon ship, but Elizabeth, having realized that the Kraken is only after Jack and not the ship or crew, chains him to the mast to ensure everyone else's escape.
Jack frees himself, but the Kraken rises up behind him. In a final act of defiance, Jack launches himself into the Kraken's maw, and the monster takes the Pearl down to the depths, which Jones watches from his telescope. Jones then opens the chest to find the heart missing, which is delivered to Beckett by Norrington. The surviving members of the Black Pearl return to Tia Dalma, who suggests they retrieve Jack from the afterlife, but recommends a captain who knows those waters. Then, to everyone's surprise, a resurrected Captain Barbossa arrives, asking about the fate of "his" ship.