Gandalf is a protagonist in J. R. R. Tolkien's novels "The Hobbit" and "The Lord of the Rings". He is a wizard, one of the Istari order, and the leader of the Fellowship of the Ring. Tolkien took the name "Gandalf" from the Old Norse "Catalogue of Dwarves" (Dvergatal) in the Völuspá.

In "The Hobbit", Gandalf assists the 13 dwarves and the hobbit Bilbo Baggins with their quest to retake the Lonely Mountain from Smaug the dragon, but leaves them to urge the White Council to expel Sauron from his fortress of Dol Guldur. In the course of the quest, Bilbo finds a magical ring.

The expulsion succeeds, but in "The Lord of the Rings", Gandalf reveals that Sauron's retreat was only a feint, as he soon reappeared in Mordor. Gandalf further explains that, after years of investigation, he is sure that Bilbo's ring is the One Ring that Sauron needs to dominate the whole of Middle-earth. The Council of Elrond creates the Fellowship of the Ring, with Gandalf as its leader, to defeat Sauron by destroying the Ring.

More Info: en.wikipedia.org