As my children made me read several volumes of Harry Potter, I could never stop comparing it to Tolkien trilogy. Surprisingly, the comparison wasn't as unfavourable as I had initially expected.
On the one hand, the books obviously could have hardly been more different.
Different in how they were apparently written: H.P. looks likely to have started as something that had been intended for children, with apparent aim of selling more copies, the undeniable brilliance being rather an overkill, whereas Tolkien would probably initially presented a very hard marketing case.
Different in outlook: Tolkien belonged to a small circle of Christians in an un-religious day and age, and evidently believed the world was going to hell in a hand-basket; Rawling, on the other hand, seems pretty content with modern ideas and the new tolerant, politically correct, low-ceremony, taboo- and mystery-free world of today, even as she is trying to imagine it's hidden magical side. This optimism even seems to include such intellectual's scare as consumer society. Many traits of Rawling's heroes would be abhorrent to Tolkien: they would cheerfully admit to feeling envy and jealousy, they worship popularity and success and are decidedly anti-intellectual; poetry or even art of any kind seems to not interest them at all, and any artefacts mentioned could have been created by aliens for all they seem to care.
Different in depth: Tolkien tried to imagine a whole world from it's Creation, in a way that would make the narrative seem not only deeply meaningful, but also consistent over long time periods, at least if one subscribes to the author's moral values; Rawling's world, it seems, would crumble under the weight of inconsistencies as soon as the reader's attention turns away from the action-packed plot and the never ending wonders of the author's imagination, and the readers start to imagine how a world like that could have existed for centuries. After all, some, if not all, historic societies were supposed to be ruled by either wonder-working priests or god-like rulers, invariably producing domination and enslavement, not the parallel existence of the "wizarding community" with the world of un-magic human beings, and one doesn't have to go back to Bronze Age to find instances of that, either: for example, French and English kings were supposed to have healing power, and priests claim to perform transubstantiation to this day. A world that had wizards would have started as Voldemort's evil world and stayed like that for millennia, as this one did, not just accidentally fallen into that state, only to return to what we modern people think is the norm, as it does in the H.P. saga.
Different in temperament: Tolkien looks at the world as an epic poet would, holding the reader by awe and admiration, almost as much as the plot itself, Rawling's books are almost never go below the Hollywood's lower threshold for action intensity. Talkien's heroes are epic, and so are his villains; Rawling's world, just like the one seen on CNN, seems to have no place for epic heroes, at least outside areas like Afghanistan and Somalia. It has, on the other hand, a lot of place for modern everyday life and the sort of humour that would probably make the Cambridge professor's face stiffen a bit. No exploit of Aragorn, son of Arathorn, could have happened in a lavatory, for just one example, or maybe it would not have made it into the history books of Middle Earth if it had; the grave airs of Tolkien's heroes would have, in Rawling's world, earned them an offer of a treatment for constipation.
Still, I couldn't help remembering Frodo at every step of Harry's adventures, and not just because both are long, perilous quests, shown mainly from the main protagonist's point of view. It seemed to me Potter the Hobbit would not have fared too bad in Middle Earth. It helps that he is also the most grave and tragic person his own story, too.
I think one reason is because Potter books wouldn't have been there, or would not have been as readily understood, if it were not for Tolkien founding the genre a couple of generations before that.
Another, more important, thing the books have in common, seems to be that both authors, for what seems to me similar likely aims, chose to make the reader look at their respective magical worlds through the eyes of relative outsiders, for some reason or other ignorant of some of those worlds' workings. Not incidentally, this provides for easy identification of the reader with the protagonist, and makes the reader feel less intimidated by all the magic; it happens that a crucial role can be played by a person most prominent by non-magic qualities, and helped by love and devotion to the good cause, as much as by magic.
21 hours ago