The W-8BEN is the IRS form with which you certify that you are not a US tax resident and claim the benefits of the double-taxation treaty. Its practical effect for a Spanish investor is a single, very concrete one: withholding on your American dividends drops from 30% to 15%.
Without a W-8BEN, every Coca-Cola or Microsoft dividend loses nearly a third at the border; with it, half of that withholding — and the remaining part is creditable later in your Spanish return. It is probably the best effort-to-benefit form in all of international investing.
You never deal with the IRS directly: your broker handles it. Most include it in the account-opening flow — a few boxes confirming your name, country of tax residence and tax ID — and ask you again when renewal is due. The key facts:
At your broker: almost all integrate it into onboarding or a tax section in settings. If you invest in US stocks and have never seen it, ask — you may be suffering the 30% rate.
It is valid for the year of signature plus three full years; then renewal. Any change of tax residence requires updating it sooner.
No: as a non-US resident, your gains from sales suffer no American withholding — they are taxed only in Spain. The form matters for dividends (and other US-source passive income).