Gandalf is considered by many to be the archetypical wizard in literature. takes a lot from The Lord of the Rings and many early aspects of the game were inspired by the works of Tolkien (or at least they were before lawyers got involved), so many people might picture a D&D version of Ganda🅠lf as a wizard, but he doesn't quite fit the mold of the standard spellcaster.
The magic in The Lord of the Rings and the other works of Tolkien isn't as present as it is in most Dungeons & Dragons campaigns. Magic appears in subtle ways or as brief explosive forces used in emergencies. The Istari (the name given to the five wizards sent to Middle-earth) all exhibit magic in different ways, with Radagast being similar to a druid and Saruman more closely following the sorcerer or wi💧zard archetyp🌜e. Gandalf is a little more complicated, as his greatest power comes from his knowledge and his ability to spur others into action. Gandalf is a teller of tales, a singer of songs, and an advisor to common folk and kings alike. In short, Gandalf is a bard.
The version of Gandalf that we have created uses material from the Player's Handbook. In the books, Gandalf belongs to a species called the Maiar, which are spirits with power that is comparable to demigods. That's probably not going to fly with most DMs, so our version of Gandalf will be human (non-variant), with stats centered around mental attributes and his sword arm. Using the basic stat spread listed on page 13 of the Player's Handbook and taking his race into consideration, his starting stats would be STR 14, DEX 9, CON 11, INT 15, WIS 13, and CHA 16. Gandalf's strength lies in the force of his personality, but he isn't afraid to jump into the fray whe🍨n needed.
Gandalf is best suited for the College of Valor archetype once he reaches level 3, which gives him set abilities throughout his run, with the exception of some extra Magic Secrets (discussed below). If the v♏ariant feat rules are used, then Gandalf would suit Inspiring Leader, Mounted Combatant, War Caster, and Keen Mind in lieu of taking addit💟ional stat points.
Gandalf was known for being one of the most knowledgable beings in Middle-earth. As such, he would have the Sage background. His starting skills would be Arcana, H꧙istory, Persuasion, Insight, and Investigation, with Survival, Animal Handling, and Perception added at level three. In terms of gear, Gandalf only has his staff, his sword, his robes, his horse, a Scholar's Pack, and his smoking gear. Gandalf's alignment would be Chaotic Good, as he has no trouble being deceptive or misleading when it suits him and has even gained a reputation for being a troublemaker in The Shire, but his actions are in the pursuit of a greater cause.
There used to be a joke in the Dungeons & Dragons community about how Gandalf was a low-level wizard in terms of stats, as the magic he uses in The Lord of the Rings can be replicated with 1st and 2nd level spells. This is partly because Tolkien kept magic mysterious and didn't go out of his way to codify it. Gandalf's spells included creating light, creating fire, using lighting and fire in brief bursts of magic to smite his enemies, opening magical doors, sealing doors with magic, creating beams of light that harm undead, breaking a stone bridge with the aid of force, pulling weapons from a distance, communicating with animals, altering the appearance of Elrond's wate💞r spell, altering his own appearance, heating metal, silencing his enemies, and seemingly communicating through telepathy.
The bard spell list accounts for some, but not all of these effects. Fortunately, bards have access to the Magical Secrets feature, which gives them access to spells outside of the bard list. As a D&D caster, Gandalf's spells would include illusions and evocation spells, with a few druid and wizard spells thrown in using Magical Secrets. As such, Gandalf's spell list would include things like light, friends, message, minor illusion, dancing lights, animal friendship, animal messenger, speak with animals, thunderwave, faerie fire, heroism, silence, heat metal, shatter, detect thoughts enhance ability, knock, dispel magic, fear, glyph of warding, major image, tongues, compulsion, confusion, geas, legend lore, mislead, find the path, guards and wards, true seeing, symbol, glibness, feeblemind, foresight, continual flame, find traps, control water, flame strike, fire storm, moonbeam, sunbeam, sunburst, find steed, alter self, enlarge/reduce, fireball, telekinesis, lightning bolt, call lightning, and sending.
The average D&D player prefers to create characters who are in the prime of their life and are hardy enough to survive adventures in inhospitable environments. Playing an old man who has seen far too many winters, but is called to action in service of a greater purpose offers all kinds of interesting roleplaying opportunities. Gandalf's magical power is reserved for only the most dangerous circumstances and his true skill lies in prompting others into action or inaction, rather than acting as a meat shield. In The Lord of the Rings, Gandalf was a ring-bearer, as he carried Narya, the Ring of Fire into battle. The power of Narya lies in its ability to inspire others and the same would be true of D&D Gandalf's magical abilities. Gandalf's strength lies as much in his knowledge 🀅and personality than his magical prowess, and all are part and parcel of🐬 being a bard.