Tolkien set "The Lord of the Rings" in Middle-e,arth, a fantasy universe only loosely connected to our own world. Though Tolkien claimed it took place in Earth's far distant past, it possessed its own unique geography and featured locations created solely by the author's imagination. While the Harry Potter books contain similarly fantastic locales -- such as the famous Hogwart's School of Witchcraft and Wizardry -- it is set in our contemporary world. The book's heroes live in England and often visit real-world places, such as King's Cross train station in London.
The characters in Harry Potter inhabit a secret culture hidden from the rest of the world's eyes. Goblins, elves and similar fantasy figures share this world with human wizards, who are committed to keeping themselves a secret. The fantasy figures in "The Lord of the Rings," on the other hand, openly live side-by-side with humans and make no attempts to hide their existence.
Though both series deal with wizards and magic, the particulars differ a great deal. Tolkien's wizards are inhuman beings -- similar in some ways to angels -- who take on the form of old men to guide and counsel the races of Middle-earth. In addition, only five of them exist, and only two -- Gandalf and Saurman -- played any great role in "The Lord of the Rings." In Rowling's world, wizards number in the thousands and have formed an entire society. Her wizards are human beings born with the innate ability to practice magic, not immortal spirits disguised as men like Tolkien's wizards.
Both the Harry Potter books and "The Lord of the Rings" feature larger-than-life villains to challenge their heroes. This is in keeping with the pattern of the Hero's Journey, to which both series adhere. However, Tolkien's villain, Sauron, is a disembodied force of evil, manifesting in the form of a giant eye but bound to the One Ring, which the hero must destroy. He began life as a spirit, and never was human. Rowling's Lord Voldemort, on the other hand, started out as an ordinary wizard named Tom Riddle. Though he spends the early books as a disembodied spirit, he eventually regains human form. Harry Potter and his friends must destroy several "horcruxes" or objects containing parts of his soul, but eventually must confront Voldemort directly to destroy his physical form (unlike the heroes in "The Lord of the Rings").