If a spell you cast has X in its mana cost, you must choose 0 as the value of X when casting it without paying its mana cost.

Artwork
Loading artwork…
Gandalf, Party Guest
The Hobbit Eternal · #2 · EN
Nonfoil—Foil—
Card rules
At the beginning of combat on your turn, you may cast an instant or sorcery spell with mana value X or less from your hand without paying its mana cost, where X is twice the number of legendary Wizards you control.
3/4
Rare · Illustrated by Dmitry Burmak
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Oathbreaker Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If you cast a spell "without paying its mana cost," you can't choose to cast it for any alternative costs. You can, however, pay additional costs, such as kicker costs. If the card has any mandatory additional costs, those must be paid to cast the spell.
You choose whether to cast a spell from your hand as Gandalf's triggered ability resolves. You can't wait to cast it later in the turn. Timing restrictions based on the card's types are ignored.