How investments are taxed in Spain

Investments are taxed in Spain through the savings base of the IRPF (income tax). Understanding how this system works lets you make smarter decisions: when to sell, which products to choose and how to offset losses to reduce your tax bill.

  • Reference savings tax brackets (check the current year): 19% (up to €6,000), 21% (€6,000–50,000), 23% (€50,000–200,000), 27% (€200,000–300,000), 30% (over €300,000)
  • Gains are only taxed when you sell — accumulating ETFs generate no dividend withholding tax
  • You can offset stock losses against stock gains (and vice versa for other assets)
  • The 2-month rule prevents claiming losses if you repurchase equivalent securities shortly afterwards
  • Investment funds allow tax-free fund switches — ETFs do not have this advantage

The savings tax base: what goes in

In Spain, capital income forms the savings base of the IRPF. It includes:

- Capital gains and losses from selling shares, ETFs, funds, cryptocurrencies, real estate (with certain exceptions for the main residence).
- Capital income: dividends, interest from accounts and deposits, bond coupons.

Not part of the savings base (taxed as employment or activity income): rental income from property, employee stock options, certain benefits in kind.

The savings tax brackets

The savings base is taxed progressively. The scale has changed several times in recent years, so check the one in force for your tax year. As a reference:

- €0 to €6,000: 19%
- €6,000 to €50,000: 21%
- €50,000 to €200,000: 23%
- €200,000 to €300,000: 27%
- Over €300,000: 30%

Example: you sell shares with a gain of €20,000. The first €6,000 are taxed at 19% (€1,140) and the remaining €14,000 at 21% (€2,940). Total: €4,080 in tax, an effective rate of 20.4%.

Important: dividends received also enter this base and are added to capital gains when calculating your bracket.

Accumulating vs. distributing ETFs: the tax difference

Distributing ETFs pay dividends periodically. Each dividend received is taxable in the year it's paid, regardless of whether you reinvest it. If you receive €500 in dividends, you pay at minimum 19% (€95) that year.

Accumulating ETFs reinvest dividends internally. No distribution, no withholding, no tax until you sell. The long-term effect is significant: the deferred tax keeps compounding inside the fund for years.

For investors in Spain in the accumulation phase, accumulating ETFs are almost always more tax-efficient. Distributing ones only make sense if you need periodic income (e.g. in retirement or FIRE).

Offsetting losses against gains

The Spanish tax authority allows you to offset losses against gains within the same tax return:

- Stock losses offset stock gains (and vice versa).
- Stock losses can also offset up to 25% of positive capital income (dividends, interest).
- If losses exceed gains, the negative balance can be offset over the following 4 years.

Practical example: you sell with a +€3,000 gain on an ETF and a -€1,000 loss on a stock. You only pay tax on the net €2,000. This makes it worth 'crystallising' losses in December if you have gains to offset.

The 2-month rule

If you sell shares or ETFs at a loss and repurchase the same (or similar) securities within 2 months (1 year for collective investment schemes), the tax authority won't let you claim that loss until you definitively sell.

This prevents the strategy of 'sell to generate a tax loss and immediately buy back'. To avoid the problem: wait more than 2 months before repurchasing, or buy a similar but not identical ETF (for example, switch CSPX for VUSA — both track the S&P 500 but are different products).

Funds vs. ETFs: the fund-switching advantage

Investment funds have a tax advantage that ETFs don't: switches between funds don't trigger a taxable event. You can move your entire wealth from one fund to another without paying tax until the final redemption.

With ETFs, every sale (even to buy another ETF) creates a taxable event if there's a gain. This makes index funds preferable for large portfolios with frequent rebalancing — ETFs are better for simpler portfolios where you don't change product frequently.

Frequently asked questions

How much tax do I pay on stock gains in Spain?

Gains are taxed in the savings base with progressive rates starting at 19%. Your effective rate depends on your total savings income for the year.

Do I pay tax if I have not sold?

Unrealised gains are not taxed. Dividends and interest received are declared every year.

How long can I carry forward losses?

Four years, offsetting them against future gains within the legal limits.

Are switches between funds taxed?

No, if done as a transfer between qualifying investment funds. ETFs generally do not have this advantage.