Gandalf, known for a time as the Grey and later the White, and originally named Olórin (Quenya), was an Istar (Wizard), dispatched to Middle-earth in the Third Age to combat the threat of Sauron. He helped form the Fellowship to destroy the One Ring, and led the Free Peoples in the final campaign of the War of the Ring.
Olórin, like the other Wizards, took the shape of an old man. He was robed in grey and wandered about as a counsellor. Over many centuries, he walked among the Elves as a stranger, learning from them and teaching them. Elves named him Mithrandir, the "Grey Pilgrim", while the Men of Arnor coined Gandalf, which became his most common name
The name Gandalf means "Elf of the wand" or "Wand-elf", from the Northern language of Dale. Most denizens of Middle-earth incorrectly assumed Gandalf was a Man, although he was really a Maia spirit, equivalent to an angel.