In J.R.R. Tolkien's mythology, Gandalf is a Maia.
The Maiar are immortal spiritual beings who existed before the shaping of the world. Gandalf was originally known as Olórin and lived in the West among the Valar, the greater powers of Tolkien’s mythology. He was sent to Middle-earth as one of the Istari, or Wizards, to oppose Sauron.
In Middle-earth, the Istari appeared as elderly men and were expected to guide and encourage its peoples rather than dominate them with power. Gandalf’s identity as a Maia explains his deep connection to the supernatural world, but he still works through counsel, courage, and friendship.
Gandalf is sometimes called an angel in simplified descriptions, but “Maia” is Tolkien’s precise category. He is also not a Vala: the Valar are a higher order of beings. His transformation from Gandalf the Grey to Gandalf the White changes his role and appearance, not his underlying nature.