Magic in Middle-earth is the use of supernatural power in J. R. R. Tolkien's fictional Middle-earth. Tolkien distinguishes ordinary magic from witchcraft, the latter always deceptive, stating that either type could be used for good or evil.
Several of the races of Middle-earth are inherently able to work magic, from the godlike Ainur (including Wizards and Balrogs, both being members of the angelic race of Maiar) and the immortal Elves to Dragons and to some extent also Dwarves. Men and Hobbits could not directly work magic, but could make use of more or less magical artefacts made by others, such as Númenorean swords (made by Men with Elvish blood) and the Phial of Galadriel given to Frodo. Some of the magical artefacts were of great power, including the Palantíri or Stones of Seeing, but by far the most powerful was the One Ring, made by the Dark Lord Sauron and embodying much of his former power.
Scholars have written that Tolkien felt the need for a magical cosmology to counter modernity's war against mystery and magic. In the sense that magic is the use of power to dominate other people, it is evil, and associated in Tolkien's mind with technology. The opposite of that is enchantment, something that Frodo experiences in the Elvish realms of Rivendell and Lothlórien, both preserved by the power of the Three Elvish Rings. That too can be a trap, as the Elves are obliged to let their Rings and their realms fade, just as the Fellowship of the Ring have to let the One Ring go, its addictive power corrupting the wearer's mind to evil.