Interrupted during the process of exchanging marital vows in Port Royal, Jamaica, Will Turner (Orlando Bloom) and Elizabeth Swann (Keira Knightley) were arrested by East India Trading Company (EITC) chairman and ruthless agent Lord Cutler Beckett (Tom Hollander) for helping the escape of pirate Captain Jack Sparrow (Johnny Depp) in the previous film.
[Beckett and other main characters in the film were all after the still-beating heart of Davy Jones. According to the legend told by voodoo priestess Tia Dalma (Naomie Harris), Jones carved his own forlorn, broken heart out of his human body years earlier, and then put it in a locked Dead Man's Chest buried in an undisclosed location, but kept the key. Its possessor would rule over the world's seas. With that power, Beckett could increase EITC's monopoly on trade in the Caribbean by ending piracy on the high seas. Also, stabbing the heart was the only way to kill Jones and end any curse or blood debt, but if Jones was killed prematurely, there would be no one to call off the Kraken ("a fearsome creature with giant tentacles").
Elizabeth and Will were offered royal clemency if Will would help in the hunt for Sparrow and return with his magical compass - Will also wanted to be reconciled with his late father, William "Bootstrap Bill" Turner Sr. (Stellan Skarsgard), one of Jones' indentured-enslaved crew members; sent by Davy Jones, "Bootstrap Bill" visited Jack, who had regained the captaincy of the Black Pearl, and delivered to him a Black Spot on the palm of his hand, warning that Jack's unpaid blood debt was now due to villainous, part-octopus/crab/human ghost Captain Davy Jones (Bill Nighy) of the ghostly The Flying Dutchman, and that Jack was targeted by Jones' "terrible beastie" - the Kraken.
It was revealed that 13 years earlier, Jack had also become bound to serve Davy Jones on his Dutchman ship for 100 years when Jones raised the Pearl for Jack. Fearing being on the ocean where he was unsafe, Jack fled - and was found by Will on the cannibal-inhabited island of Pelegosto after he had run aground with the Pearl - Jack was worshipped there as a god, but was about to be sacrificed on a spit above a fire. Will and Sparrow escaped from the island of natives and tracked down Jones' Flying Dutchman and his undead crew on the high seas. Jack tricked Will into going onboard the ship in search of the key to unlock the chest. however, Jack also went onboard, and bargained with Davy Jones for his freedom while Will was held as a good faith payment and hostage: if Jack could find 100 souls within 3 days, they could be exchanged and brought into a "lifetime of servitude" to Jones - used to pay off Jack's own blood debt.
Elizabeth (dressed as a male sailor) joined Jack in a race-quest for the hiding place of the chest that contained Davy Jones' cut-out, still-beating heart, as Jack collected souls of unsuspecting sailors at Tortuga (including disgraced James Norrington (Jack Davenport)). The chest was located and dug up on the tropical island of Isla Cruces - Will also arrived there after being released from Jones' ship with aid from his father after a game of dice, and after surviving a Kraken attack on another ship. Sparrow opened the chest with the key (that Will had stolen from the neck of Jones), and during a distracting, three-way swordfight-skirmish between Will, Jack, and Norrington, Norrington took off with the heart.
In a sub-plot, Jack's compass - which only worked when the user knew what he wanted - pointed back and forth between Jack and Elizabeth - reflecting their romantic tension and feelings.
While pursuing Jack on the ocean as he captained the Black Pearl, Jones on his Flying Dutchman threatened to unleash the mythological sea monster - the Kraken (CGI-created) - to attack Jack's ship and kill him. thinking she could save the crew, Elizabeth betrayed and tricked Jack by kissing him as she handcuffed him to the Pearl's mast where he would be an easy target. Jack was swallowed by the Kraken, and dragged down into the water to his death - where he was taken to Davy Jones' locker inside the gateway called World's End, to repay his debt to Davy Jones.
Jones retrieved the chest, but was enraged when he discovered that it was empty. Back in Port Royal, Jamaica, Norrington delivered Jones' heart from the chest to Lord Beckett, wishing to use it to bargain back his British Royal Navy career.
In her shack, the priestess Tia Dalma, with the power to resurrect the dead and see into the future, asked Will, Elizabeth, and Jack's Pearl crew about what they would do to save Jack: "Would you sail to the ends of the Earth and beyond to fetch back witty Jack and him precious Pearl?"; when they answered affirmatively, she told them: "But if you go and brave the weird and haunted shores at world's end, then you will need a captain who knows those waters" - she called upon resurrected Captain Barbossa (Geoffrey Rush) from the first film to assist them - he entered the room and asked: "So tell me, what's become of my ship?", as the film abruptly ended.
However, after the lengthy end credits, the crew's dog, earlier left behind on the island, was seen to be the new chief of the cannibal tribe.