Benjamin Franklin Gates is an American historian, cryptographer, and treasure hunter. When Ben was young, his grandfather John told him that, in 1832, Charles Carroll passed on a secret clue to their ancestor of a fabled treasure hidden in America by the Knights Templar, Founding Fathers, and Freemasons. Carroll's clue leads anyone to the treasure: with the phrase "the secret lies with Charlotte". While Ben is convinced by the story, his skeptical father, Patrick, dismisses it as nonsense.
Ben and his friend, computer expert Riley Poole, head an expedition financed by wealthy Ian Howe to find the Charlotte, revealed to be a ship lost in the Arctic. Within the ship, they find a meerschaum pipe, whose engravings reveal the next clue is on the Declaration of Independence. When Ian reveals himself to be a crime boss and suggests stealing the Declaration, a fight ensues, and the group splits. Ben and Riley report Ian's plan to the FBI and Abigail Chase of the National Archives, but they don't believe them. Ben decides to protect the Declaration by removing it from the Archives' preservation room during a gala event. Obtaining Abigail's fingerprints, he successfully obtains the Declaration, only to be spotted by Ian's group just as they break in to steal it. Ben tries to leave via the gift shop but has to pay for the Declaration when the cashier mistakes it for a souvenir copy. Suspecting something amiss, Abigail confronts Ben and takes back the document. Ian promptly kidnaps her, but Ben and Riley rescue Abigail, tricking Ian by leaving behind a souvenir copy of the Declaration. The FBI, led by Agent Sadusky, begins tracking Ben.
Going to Patrick's house, the trio studies the Declaration and discovers an Ottendorf cipher written in invisible ink. The message refers to Benjamin Franklin's Silence Dogood letters. Patrick formerly owned them, but donated them to the Franklin Institute. Paying a schoolboy to view the letters and decipher the code for them, Ben, Riley, and Abigail discover a message pointing to the bell tower of Independence Hall. Pursued by Ian, they find a brick containing a pair of spectacles with multiple colored lenses, which, when used to read the back of the Declaration, reveal a clue pointing to Trinity Church. Ian's associates chase the trio through Philadelphia until the FBI arrests Ben. Abigail and Riley lose the Declaration to Ian, but Abigail convinces Ian to help them rescue Ben in exchange for the next clue. Ian agrees, contacts the FBI, and arranges a meeting at the USS Intrepid, where they help Ben evade the FBI.
Ian returns the Declaration and asks for the next clue, but when Ben remains coy, Ian reveals he has taken Patrick hostage. They travel to the Trinity Church, where they find an underground passage that appears to lead to a dead end, lit by a lone lantern. Patrick claims it is a reference to the Midnight Ride of Paul Revere, pointing Ian to the Old North Church in Boston. Ian traps Ben, Abigail, Riley, and Patrick in the chamber, heading for Boston, which was Patrick's intent as the clue was fictitious and he knew that Ian would betray them. Ben then finds a notch the meerschaum pipe fits into, opening a large chamber containing the treasure, with a staircase to the surface. Ben contacts Sadusky, who is actually a Freemason, and surrenders the Declaration and the treasure's location in exchange for letting Abigail go free, giving the Gates family and Riley credit for the discovery, and no prison sentence. On a tip from Ben, the FBI arrests Ian.
Later, Ben and Abigail start a relationship and Riley is somewhat upset that Ben turned down the 10% finder's fee for the treasure so the entire collection could go to museums worldwide, but the 1% he did accept has still netted them all with significant wealth.