Thirteen years ago, Captain Sparrow obtained the Black Pearl from Davy Jones by bargaining his soul in exchange for 100 years service aboard the infamous ghost ship, The Flying Dutchman. Now the debt is due. One night, Jack's former shipmate, "Bootstrap Bill" Turner appears and marks him with the Black Spot, a sign the Kraken is hunting him. Meanwhile, Lord Cutler Beckett of the East India Trading Company arrests Will Turner and Elizabeth Swann for aiding Jack's escape. With Elizabeth in jail, Beckett offers clemency if Will will search for Sparrow's compass and trade it with Letters of Marque. Otherwise, Will, Elizabeth, and former Commodore James Norrington will be executed. Will finds Sparrow and the crew held captive by cannibals on Pelegosto. They escape, barely making it to the Black Pearl.
Rowing upriver, they visit Tia Dalma, a voodoo priestess with whom Sparrow hints he was once close. Jack shows her a drawing of a key; he does not know what it unlocks or where to find it, and his magical compass has failed. Tia Dalma says it will not work because Jack does not know what he truly wants or, "he is loath to claim it as his own". She tells them the legend of Davy Jones and the Dead Man's Chest. When Jones lost his true love, his pain was so deep that he carved out his heart and buried it in the chest. The key is kept with him. Back at sea, the Pearl encounters Davy Jones who has come to claim his debt. Bartering a deal to exchange 100 souls for his own, the devious Sparrow deceives Will, and Jones keeps him as a "good faith payment."
In Tortuga, Sparrow and Gibbs recruit unsuspecting sailors. A fallen James Norrington applies and then attempts to shoot Jack, whom he blames for his ruin. Elizabeth, who escaped jail, arrives and rescues Norrington from the ensuing brawl. Confronting Sparrow, Elizabeth demands to know what happened to Will. Jack regrets to report he was press-ganged into Davy Jones' crew, although Norrington is skeptical. Jack reveals the compass' secret, telling Elizabeth that if she finds the Dead Man's Chest, she will save Will. The compass works at last. After setting sail for Isla Cruces, Elizabeth discloses it was Cutler Beckett who sent Will and shows Jack and Gibbs the Letters of Marque, which Jack takes from her. Norrington overhears the conversation and sets his own plan in motion. The captain then expresses an amorous interest in Elizabeth, who coyly rebuffs his attempts to woo her. He tries to kiss her, but when the Black Spot suddenly reappears on his palm, he hastily retreats. The Kraken is on the hunt again.
On Isla Cruces, Sparrow, Elizabeth and Norrington find the chest. Will arrives with the key (having escaped from the Flying Dutchman). Will, Jack, and Norrington all claim the heart. Turner hopes to free his father from Davy Jones' servitude, Sparrow wants to escape his blood debt, and Norrington schemes to reclaim his career. Sparrow extricates himself from their three-way sword fight and gets the heart. However, Norrington steals it and the Letters of Marque and escapes while Jones' crew retrieves the chest, unaware it's empty. Back at sea, the Dutchman chases the Pearl, but the Pearl outruns her. Jones summons the Kraken. In a moment of cowardice, Sparrow deserts the Pearl as the crew valiantly fights the monster. However, Jack's underlying loyalty and honor compel him to go back and save his shipmates. Knowing the Kraken will return, he gives the order to abandon ship.
Realizing the Kraken is only after Jack, Elizabeth distracts him with a passionate kiss and cuffs him to the mast. She claims she isn't sorry for her actions, to which Jack merely retorts "Pirate." She tells the others Jack chose to stay behind, unaware that Will witnessed the kiss. Sparrow frees himself and bravely battles the ferocious beast, lunging into its toothy maw as the Pearl is dragged underwater. Davy Jones declares their debt settled but is enraged when he discovers the Dead Man's Chest is empty. Meanwhile, Norrington delivers the heart and the Letters of Marque to Lord Beckett, hoping to reclaim his career. Beckett now controls the world's oceans.
The saddened crew make their way to Tia Dalma's. As she consoles them, she asks if they would be willing to sail to Worlds End to bring back Sparrow and the Pearl, to which all agree. She says they will need a captain who knows those waters. Just then, the formerly dead Captain Barbossa descends the stairs.