This action-packed superhero thriller begins in Gotham City, where The Joker and his accomplices are in the process of robbing a mob-owned bank. The accomplices kill each other off one by one in a sequence masterminded by the Joker, who escapes alone with all the money.
Batman and Lt. Jim Gordon decide to include the new district attorney, Harvey Dent, in their plan to eradicate the mob. Although Dent is dating Rachel Dawes, Bruce Wayne is impressed with his idealism and offers to throw him a fundraiser. Mob bosses Sal Maroni, Gambol, and The Chechen hold a video-conference with Lau, a Chinese accountant who has hidden their funds and fled to Hong Kong.
The Joker interrupts the meeting, warning that Batman is unhindered by jurisdiction. He offers to kill Batman for half their money, but the mob bosses refuse, and Gambol puts a bounty on him. The Joker kills Gambol and takes control of his men. Batman captures Lau and delivers him back to Gotham to testify against the Joker and the mob.
The Joker announces that people will die each day unless Batman reveals his identity. He then kills Commissioner Gillian B. Loeb and the judge presiding over the mob trials. He also targets Dent at the fundraiser, but Bruce hides Dent. Gordon foils the Joker's assassination attempt on Mayor Garcia, apparently sacrificing himself in the process.
Bruce plans to reveal his identity, but Dent instead names himself as Batman to protect the truth. Dent is taken into protective custody and pursued by the Joker across the city; Batman rushes to Dent's aid. Gordon, who faked his death, helps apprehend the Joker and is promoted to Commissioner.
That night, Dent and Rachel disappear. Batman interrogates the Joker and discovers that Dent and Rachel are held in two separate buildings filled with explosives. The Joker reveals their locations, and Batman goes to Rachel's, only to realize that the Joker has tricked him into finding Dent moments before both buildings explode, killing Rachel and scarring half of Dent's face. The Joker detonates a bomb in the police station and escapes with Lau.
Coleman Reese, an accountant at Wayne Enterprises, deduces Batman's true identity and plans to reveal it. The Joker kills Lau and The Chechen, then threatens to bomb a hospital unless Reese is killed. Gordon and Bruce protect Reese, who changes his mind. The Joker visits Dent in the hospital and convinces him to seek revenge. The Joker then blows up the hospital and escapes with hostages.
Dent starts to go after people responsible for Rachel's death, deciding their fates by flipping a coin. He kills Maroni and a cop who had helped kidnap Rachel. To escalate the chaos, the Joker rigged two ferries with explosives; one ferry is full of citizens, the other full of Arkham Asylum inmates and guards. He then gives the passengers of each ferry the choice to blow the other up before midnight — otherwise, both ferries will explode. The passengers ultimately refuse, however.
Batman asks a reluctant Lucius Fox to use a city-wide tracking prototype device to find the Joker; Fox agrees, but says he will resign immediately afterward. The Joker dresses up hostages as his men, luring Gordon's SWAT team to strike them. Batman fights off the SWAT team and the Joker's men, then rescues the hostages. Batman apprehends the Joker, but the Joker gloats that he has won, as Gotham will lose hope once Dent's rampage becomes public. The Joker is then taken into custody.
Dent lures Gordon to the building where Rachel died and holds Gordon's family hostage. Batman confronts Dent, who judges the fates of himself, Batman, and Gordon's son with three coin flips. He shoots Batman, spares himself, then flips again to determine the boy's fate. Batman, who is wearing body armor, tackles Dent off the building, killing him and saving the boy.
Batman then convinces Gordon to frame him for the murders so that Dent will remain a symbol of hope for the city. Gordon destroys the Bat-Signal and launches a manhunt for the Batman. Alfred Pennyworth burns a letter written by Rachel to Bruce announcing her engagement to Dent, and Fox watches the signal tracker self-destruct.