Gandalf is a fictional character belonging to the legendarium of the British writer J. R. R. Tolkien. He is one of the main characters in the novels The Hobbit and The Lord of the Rings.