The wedding of Will Turner and Elizabeth Swann is halted when Lord Cutler Beckett, chairman of the East India Trading Company, arrives with arrest warrants for them, and also for Commodore James Norrington, who allowed Captain Jack Sparrow to escape. Norrington has resigned and disappeared after losing the Navy's flagship, HMS Dauntless, in a hurricane while pursuing Jack. Meanwhile, Jack is visited by Will's father, Bootstrap Bill Turner, aboard the Black Pearl. Bootstrap is now a crewman on the Flying Dutchman, captained by Davy Jones. Jack previously bartered a deal with Jones to raise the Pearl from the depths; now Jack must join Jones' crew or be dragged to Davy Jones' Locker by the Kraken. Beckett, meanwhile, promises to free Elizabeth if Will brings him Jack's magic compass which points to whatever the holder wants most.
Will finds Jack and the crew on an island and frees them from cannibals. Shortly after, Governor Swann frees Elizabeth from jail, but he is then captured. Elizabeth bargains with Beckett to find the compass. Disguised as a cabin boy aboard a Scottish merchant vessel, she makes her way to Tortuga where she later finds Jack and also a drunken Norrington. After escaping the cannibals, Jack and the crew visit voodoo priestess Tia Dalma, who reveals Jones' weakness is his heart, which is locked within the Dead Man's Chest. Jack must find it and the key that opens it. Locating the Dutchman, Will makes a deal with Jack to find the key to the chest in return for Jack's compass. Jack tricks Will, who is shanghaied into service aboard the Dutchman. Jones agrees to release Jack from their bargain in exchange for one hundred souls. Will meets his father aboard the Dutchman and learns that Jones possesses the key to the chest. They play a game of Liar's Dice against Jones to try and win the key, but they lose. Despite this, Will escapes with the key and is taken aboard the same ship Elizabeth was on. Jones sends the Kraken after him, sinking the ship, but Will escapes.
In Tortuga, Jack hires a new crew, including Elizabeth and Norrington. With Elizabeth's use of Jack's compass, they are able to locate the chest. All parties arrive on Isla Cruces, where the chest is buried, but a three-way sword fight breaks out between Jack, Will, and Norrington, who all want the heart for their respective goals: Jack wants to call off the Kraken; Will wants to rescue his father; and Norrington wants to regain his life as a Navy officer. In the chaos, Norrington secretly steals the heart and runs off, pretending to lure away the Dutchman's crew. Jones attacks the Pearl with the Kraken, which devours most of the crew and destroys all but one of the Pearl's lifeboats, but Jack, who briefly flees the battle, returns and wounds the Kraken with a net full of gunpowder and rum.
Jack orders the survivors to abandon ship, but Elizabeth, realizing the Kraken only wants Jack, tricks him and chains him to the mast so that the crew can escape. The Kraken drags Jack and the Pearl to Davy Jones' Locker. Jones opens the chest to discover his heart is gone. In Port Royal, Norrington gives Beckett the heart and the Letters of Marque meant for Jack, allowing him back into the navy as well as allowing Beckett to gain control of Davy Jones and the seas. The Pearl's crew take shelter with Tia Dalma, where they all agree to rescue Jack. Tia Dalma introduces the captain who will guide them: the resurrected Hector Barbossa.
In a post-credits scene, the cannibalistic tribe now worships the prison dog in replacement of Jack.