Louvre curator and Priory of Sion grand master Jacques Saunière is fatally shot one night at the museum by an albino Catholic monk named Silas, who is working on behalf of someone he knows only as the Teacher, who wishes to discover the location of the "keystone", an item crucial in the search for the Holy Grail. After Saunière's body is discovered in the pose of the Vitruvian Man by Leonardo da Vinci, the police summon Harvard professor Robert Langdon, who is in town on business. Police captain Bezu Fache tells him that he was summoned to help the police decode the cryptic message Saunière left during the final minutes of his life. The message includes a Fibonacci sequence out of order and an anagram: "O, draconian devil! Oh, lame saint!" Langdon explains to Fache that the pentacle Saunière drew on his chest in his own blood represents an allusion to the goddess and not devil worship, as Fache believes.
Sophie Neveu, a police cryptographer, secretly explains to Langdon that she is Saunière's estranged granddaughter and that Fache thinks Langdon is the murderer because the last line in her grandfather's message, which was meant for Neveu, said "P.S. Find Robert Langdon", which Fache had erased prior to Langdon's arrival. However, "P.S." does not refer to "postscript", but rather to Sophie — the nickname given to her by her grandfather was "Princess Sophie". She understands that her grandfather intended Langdon to decipher the code, which leads to Leonardo da Vinci's Mona Lisa, which in turn leads to his painting Madonna of the Rocks. They find a pendant that holds the address of the Paris branch of the Depository Bank of Zurich.
Neveu and Langdon escape from the police and visit the bank. In the safe deposit box, which is unlocked with the Fibonacci sequence, they find a box containing the keystone: a cryptex, a cylindrical, hand-held vault with five concentric, rotating dials labeled with letters. When they are lined up correctly, they unlock the device, but if the cryptex is forced open, an enclosed vial of vinegar breaks and dissolves the message inside the cryptex, which was written on papyrus. The box containing the cryptex contains clues to its password.
Langdon and Neveu take the keystone to the home of Langdon's friend, Sir Leigh Teabing, an expert on the Holy Grail, the legend of which is heavily connected to the Priory. There, Teabing explains that the Grail is not a cup but connected to Mary Magdalene, and that she was Jesus Christ's wife and is the person to his right in The Last Supper. The trio then flee the country on Teabing's private plane, on which they conclude that the proper combination of letters spells out Neveu's given name, Sofia. Opening the cryptex, they discover a smaller cryptex inside it, along with another riddle that ultimately leads the group to the tomb of Isaac Newton in Westminster Abbey.