The decision leaves two of the three authors of The Holy Blood and The Holy Grail with a legal bill estimated at up to £3 million.
Michael Baigent and Richard Leigh took Brown's publisher Random House to court, claiming that The Da Vinci Code infringed the copyright in their 1982 work by using their theories as the basis of its plot.
The decision backs an earlier High Court ruling. Brown, who was a witness in the High Court case, admitted that Baigent and Leigh's book was a research source, but said that it was only one of many sources that he used.
The Court of Appeal said that the theories which underpinned both books were too general to be afforded protection by UK copyright law. The decision said that copyright law cannot be used to "monopolise historical research or knowledge and prevent the legitimate use of historical and biographical material, theories propounded, general arguments deployed, or general hypotheses suggested (whether they are sound or not) or general themes written about."
The decision was welcomed by Brown's publisher. "We believe that the case should never have come to court in the first place, and regret that even more time and money was spent trying to appeal the original judgment,'" said Gail Rebuck, chief executive of Random House. "Misguided claims like the one that we have faced, and the appeal, are not good for authors, and not good for publishers."
"We feel that today is an ominous one for those who wish to research a book of their own and come up with their own theories," said Baigent and Leigh. "It is a carte blanche for those who would rather not bother, but simply take another author's ideas and adapt them."
The Da Vinci Code has become one of the best selling books of all time; its plot is based on the theory that Jesus married Mary Magdelene, that the pair had children and that a secret society guards the descendants of the pair to this day.
The thrilling romp details the corruption and violence of the Roman Catholic Church as it tries to suppress the supposed truth, and claims that the legends of the Holy Grail refer not to the cup from which Jesus supposedly drank at the last supper, but to the bloodline of Jesus.
Baigent and Leigh based their appeal on the claim that the presiding judge in the original case did not understand the law.
Lord Justice Lloyd concluded: "what he [Dan Brown] took from HBHG [The Holy Blood and The Holy Grail] amounted to generalised propositions, at too high a level of abstraction to qualify for copyright protection, because it was not the product of the application of skill and labour by the authors of HBHG in the creation of their literary work. It lay on the wrong side of the line between ideas and their expression."
Baigent and Leigh argued infringement of their book's "Central Theme" and said this amounted to substantial copying. Lord Justice Lloyd disagreed.
He wrote: "the Central Theme was not a theme of HBHG at all, but rather was no more than a selection of features of HBHG collated for forensic purposes rather than emerging from a fair reading of the book as a whole."
The basis of Baigent and Leigh's contention that the Central Theme was a substantial part of their work "depended entirely on showing that it was a central theme of the book and … was really the central theme of the book," said Lloyd.
"The judge rejected that contention on the facts," he continued. "It does not seem to me that it was necessary for him to provide any further explanation for his conclusion that, whatever elements (if any) were copied from HBHG, they did not amount to a substantial part of it."
Lord Justice Mummery criticised the trial judge's approach but agreed with his decision and with Lord Justice Lloyd's opinion. Mummery added: "In my judgment, the judge rightly held that the claimants have not established that a substantial part of The Holy Blood and the Holy Grail has been copied, either as to the original composition and expression of the work or as to the particular collection, selection and arrangement of material in The Holy Blood and the Holy Grail".