While their parents are on an archaeological dig in Utah, Josh and Sophie Newman, 15-year-old twins, live in San Francisco with their 84-year-old aunt. Sophie has a summer job at a coffee shop, while Josh works at the bookstore across the street.
Life is pleasant — if not mundane — until Dr. John Dee and his trio of otherworldly bodyguards visit the bookstore. Dee uses his foul-smelling magic to overpower the bookstore owner, Nick Flemming, and steal a book: the 10,000-year-old Book of Abraham the Mage, also known as the Codex. Dee also kidnaps Nick's wife, Perry.
Josh and Sophie are shocked when Nick explains that his real name is Nicholas Flamel and that he and Perry (whose real name is Perenelle) are almost 700 years old. Nicholas is a powerful alchemist, and both he and Perenelle are accomplished magicians and sorcerers. Dee, Nicholas' former apprentice, is likewise old and powerful; moreover, Dee is a necromancer who can raise the dead. Nicholas explains that the secrets of immortality and endless wealth are the least important information contained within the Codex. If they don't get the book back, not only will Nicholas and Perenelle die within the month, but Dee and the Dark Elders will use the Codex to destroy the world and enslave any remaining humans.
Fortunately, Dee didn't get the whole Codex. When Dee ripped the book out of Josh's hand, Josh managed to hang on to two pages, pages that describe the Final Summoning — a piece of magic that Dee will need to perform before he can destroy the world. Nicholas hides the pages, knowing that Dee will come looking for them. Unfortunately, this development also means that Josh and Sophie are in grave danger. Fleeing San Francisco with Nicholas is the only way they can protect themselves and their parents.
Nicholas and the twins seek shelter in a dojo belonging to Scathach (an ancient warrior-vampire also known as Scatty). Scatty has trained many heroes in the past, and Nicholas hopes she might be able to teach and mentor the twins. However, Dee follows them and loses no time invading Scatty's booby-trapped dojo with golems (animated figures made of clay) and rats. The foursome flees in an SUV — only to be chased by hordes of supernaturally large and vicious crows sent by one of Dee's masters, the crow goddess known as the Morrigan.
All seems to be lost. But Nicholas' well-timed cellphone call to Hekate, the goddess with three faces and a powerful member of the Elder Race who lives in a Shadowrealm nearby, pays off. Hekate sends a powerful wind that blows away all of the crows. Under Nicholas' direction, Josh drives the SUV down a secret path, past a pack of menacing wereboars, and into Hekate's Shadowrealm.
Hekate makes Josh's and Sophie's auras temporarily visible. Josh's aura glows gold, and Sophie's glows silver. The pure colors of the twins' auras mean that they are capable of powerful magic — and also means that the twins may be the ones referred to in an ancient, enigmatic prophesy about the end of the world. Nicholas plans to convince Hekate to "awaken" the twins — a magical process that will allow them to utilize their full potential. He is especially concerned with the twins' role in the conflict, as the Codex contains an enigmatic prophesy that implies a pair of twins will either save or destroy the world.
Meanwhile, Perenelle is imprisoned in the basement of Dee's company, Enoch Enterprises. She uses magic to overhear Dee and the Morrigan planning to wake Bastet, a powerful Elder and the Egyptian cat goddess, and mount an attack on Hekate's Shadowrealm. Perenelle sends a ghost to warn Nicholas of Dee's plans.
Bastet, Dee and the Morrigan assemble a rag-tag army of birds and cats (who have spells placed on them so that they are half-human) and invade Hekate's Shadowrealm. Hekate awakens Sophie but has no time to awaken Josh before the battle gets too intense and she is forced to join in. Scatty fights well and bravely, but Nicholas gets pinned to the ground by Bastet.
Meanwhile, Perenelle is still in captivity but is worried about her husband. She scries (uses a reflective surface to magically view) the battleground. Seeing that they are about to fail, she channels her aura through the newly awakened Sophie and turns the tide of the battle in Nicholas' favor. However, it's too late for Hekate. Dee has fatally wounded Yggdrasill, the living tree that functions as Hekate's home within her Shadowrealm and which also is connected to her life-force. Hekate dies, and her Shadowrealm is extinguished — but not before all of the other main characters escape and Dee and his cronies learn from a dying Hekate about the powerful auras of the twins, that they may be the ones referred to in the prophesy, and that she has awakened Sophie. Dee believes that he can convince Josh to join his side and have the Morrigan awaken him.
The twins, Nicholas and Scatty steal Dee's Hummer and travel to Ojai to visit Scatty's grandmother, the Witch of Endor (also known as Dora), who has mirrors where her eyes should be and is one of the only beings in North America who can help Sophie cope with her recently awakened self. Until they get there, Scatty magically siphons away some of Sophie's sensory overload, relieving the pain and overwhelming anxiety that she feels as a result of her heightened senses.
They find Dora in her shop full of mirrors and other glassware. Dora gives Sophie her lifetime of experience and magically downloads information into Sophie's body about the principles of air magic. Since Josh is still fully human, he is not allowed to witness these proceedings. Instead, he waits and wanders through the streets of Ojai where he is confronted by Dee, who tries to convince him that Nicholas Flamel is a liar and a crook, that Hekate was a known criminal and that Scatty is little more than a hired thug. He tells Josh that instead of destroying the world, the Elders would change it for the better. They would reverse climate change and pollution, eradicate disease and return the earth to the paradise it once was. He also promises to awaken Josh, if Josh joins his side.
Josh, hypnotized by Dee's words, falls into a trance while Dee assembles an army of thousands of 19th-century (and earlier) dead and decomposing people and animals. Scatty, Nicholas and Sophie have realized that Josh is missing and go out to look for him in the fog that has descended on the town. They are surprised and nearly overwhelmed by the army of corpses, despite Scatty's martial arts skills and Nicholas' and Sophie's magical ability. Just as it seems that the battle is lost, Josh drives through the undead army with Dee's Hummer and rescues his friends. Pursued by Dee, the foursome flees back to Dora's shop. Since the shop is located at an intersection of magical (invisible) ley lines, Dora uses a mirror as a portal into Paris and quickly shepherds Scatty, Nicholas and Dora through the portal. Josh follows reluctantly, still conflicted about whether to believe Dee or Nicholas. Dora breaks the mirror as Dee arrives on scene so Dee can't follow them. The shop explodes with Dee and Dora inside.
An article in the Ojai Valley News reveals that neither Dee nor Dora are killed or even seriously injured in the explosion. Dee's army of corpses is written off as a special effect by Dee's sham movie company, Enoch Studios. Perenelle (who woke up imprisoned in Alcatraz) receives a ghostly message that her husband, the twins and Scatty are safe in Europe where there are many magical beings who will be able to instruct the twins in the magical arts.