How your investments are taxed in Spain: a practical IRPF guide

How your investments are taxed in Spain: a practical IRPF guide

investing IRPF taxation investment funds capital gains savings

One of the questions that comes up most when someone starts investing is: and how do I declare this? The short answer is that the Spanish Tax Agency (Agencia Tributaria) wants its share of what you earn by investing. The long answer is that the system has its nuances, and knowing them can save you quite a bit of money.

This article explains in a practical way how the main investment products are taxed in Spain, without beating around the bush and without claiming to replace a tax adviser.


The savings tax base: the drawer where it all goes

In the IRPF (Spanish personal income tax), the gains from most investments go into what’s called the savings taxable base (base imponible del ahorro). It’s a separate drawer from your salary or your business income, and it’s taxed at different rates.

The rates in force for 2025-2026 are:

Accumulated gainRate
Up to €6,00019%
From €6,000 to €50,00021%
From €50,000 to €200,00023%
From €200,000 to €300,00027%
Over €300,00028%

Note: these rates apply to the gain, not to the total you recover. If you invested €10,000 and recover €12,000, you’re taxed on €2,000, not on €12,000.


Which types of income go into the savings tax base?

Returns on movable capital

These are the “passive” returns on your investments:

  • Interest on deposits and savings accounts. The bank pays you interest; that interest is taxed. Before comparing offers it’s worth looking at the difference between APR and nominal rate, because the real return may not be the one the bank advertises.
  • Dividends from shares. If you hold shares and the company distributes dividends, they’re taxed as returns on movable capital.
  • Coupons from bonds and fixed income. The interest you receive periodically for holding bonds goes here. If you’re just starting out, in how to start investing from scratch we go through the products one by one.
  • Returns on savings insurance. The gain portion of products such as PIAS or life-savings insurance when you redeem them.

The payer (bank, broker, etc.) generally applies a 19% withholding at the time of payment. That withholding is deducted from what you end up owing in your tax return.

Capital gains and losses

These are what you obtain when you sell something at a price different from what you bought it for:

  • Investment funds. The difference between the sale price and the purchase price of your units.
  • Shares and ETFs. Same as funds.
  • Cryptocurrencies. Yes, these go here too, although the Agencia Tributaria also requires you to report balances if they exceed certain thresholds.

The big advantage of funds: transferring without a tax toll

One of the best tax features of investment funds registered in Spain is that you can transfer money from one fund to another without being taxed at the moment of the transfer.

What does this mean in practice? Imagine you have €20,000 in a fixed-income fund and you want to move it to an equity fund. If you did it with direct shares, you’d have to sell, pay tax on the gains and then buy. With registered funds, the transfer is tax-neutral: the money goes from one fund to another without the Agencia Tributaria stepping in until you finally redeem the money.

This lets you rebalance your portfolio, change your strategy or adjust the risk over time without an immediate tax cost.

Important: this advantage applies to traditional investment funds registered with the CNMV (Spain’s securities regulator). ETFs (exchange-traded funds), although very similar in structure, don’t get this tax treatment in Spain. When you sell an ETF, it’s taxed like a share.


Offsetting gains and losses

What happens if one year you have gains on one fund but losses on another? The good news is that you can offset them.

Within the savings tax base there’s a certain flexibility:

  • Capital gains and losses offset each other directly.
  • Returns on movable capital also offset each other.
  • From 2024 onwards, you can offset negative returns on movable capital against capital gains (and vice versa), with a 25% limit.
  • If a negative balance remains, you can carry it forward over the next four tax years to offset it against future gains.

This makes it worth reviewing your portfolio at year-end: if you have funds with latent losses and others with gains, it may be in your interest to “realise” the losses before 31 December to offset the gains of the same year.


What about pension plans?

Pension plans have completely different taxation, and it’s best not to mix them with the rest.

Contributions to pension plans reduce your general taxable base (your salary’s), which can mean significant tax savings while you’re working. The annual limit is the lower of €1,500 and 30% of your earned income and economic activities.

But when you redeem the pension plan, the money is taxed as earned income, at the rates of the general IRPF scale (which can reach 47%). It doesn’t go into the savings tax base.

This means a pension plan defers taxes, but doesn’t eliminate them. If at the time of redemption you have a high taxable base (for example, because you’re still working), it may not be as advantageous as it seemed when contributing.

It’s a product that can make sense in certain situations, but that requires careful analysis, especially if you’re many years away from retirement.


Withholding and the tax return: how it all fits together

When you receive interest or dividends, the payer withholds 19% and pays it directly to the Agencia Tributaria. When you file your tax return, that already-withheld money is added to your total withholdings and may result in a refund if you’ve had too much withheld (or a payment if too little has been withheld).

Gains on funds or shares, on the other hand, have no automatic withholding at the time of sale. That means that if you sell at a gain in December, you may have to pay the Agencia Tributaria in June of the following year. Planning for it is important to avoid surprises.


A note on declaring assets abroad

If you have investments with foreign brokers (for example, funds in Luxembourg or shares with Interactive Brokers), and the total value exceeds €50,000, you’re required to file the Modelo 720 to report those assets. It’s an informational form, it doesn’t involve paying tax, but the penalties for not filing it are very high.

In addition, if you have accounts abroad with a balance over €50,000, there’s also the obligation to declare it on the Modelo 720 (in the bank accounts section). Consult an adviser if you have assets outside Spain.


Summary: the key points

Before wrapping up, a summary of the most relevant points:

  • Investment gains go into the savings tax base, at rates between 19% and 28%.
  • Investment funds let you transfer without paying tax until you redeem the money.
  • ETFs don’t have that tax advantage in Spain: selling them is taxed the same as selling shares.
  • You can offset losses against gains within the savings tax base, and carry them forward four years.
  • Pension plans are taxed as earned income when redeemed, not as savings.
  • If you have assets abroad above certain thresholds, look into the Modelo 720.

How does Cuéntamo help me with all this?

The investment module in Cuéntamo Más was designed precisely so that the taxation of investments stops being a headache at the end of the year.

When you record a sale, Cuéntamo automatically applies the FIFO method: the oldest units are the first to be sold, and the realised gain or loss is calculated to the cent on each transaction. If you’ve sold at a loss, Cuéntamo carries that balance forward and offsets it against gains in the next four tax years without you having to keep track yourself.

The dividends and fixed-income coupons you receive during the year are aggregated in the returns-on-movable-capital section. The 19% withholding the broker has already applied to you is recorded, so in May you only have to look at the gross and the net.

For the modelo 100 (the annual income tax return), the tax panel gives you a CSV export ready to take to your return: capital gains and losses on one side, returns on movable capital on the other, with the balance to offset from previous years already applied. If a loss-making sale comes close to a repurchase of the same instrument, Cuéntamo warns you about the anti-application rule (the wash-sale rule) before you save the transaction, without blocking you: the decision is still yours.

If you bring in your DeGiro or Trade Republic history, you import it with its CSV: Cuéntamo detects it, separates transactions from cash movements and reconstructs the FIFO lots from the first purchase. The destination account is auto-detected by IBAN if you already have it in the book.

Before investing anything, make sure you have an emergency fund covering between three and six months of expenses: having your day-to-day finances under control is the basis for making investment decisions with a cool head.

And if you’re also self-employed, Cuéntamo helps you with the mandatory record-keeping ledgers and the quarterly IVA and IRPF, so that the tax result of your activity doesn’t catch you by surprise.

Frequently asked questions

What amount are my investment gains taxed on?

On the gain, not on the total you recover. If you invested 10,000 euros and recover 12,000, you’re taxed on the 2,000 of profit, not on the 12,000. This income goes into the savings taxable base, separate from your salary.

Do I have to pay tax when transferring money from one fund to another?

No, as long as they’re traditional investment funds registered with the CNMV: the transfer is tax-neutral and you’re not taxed until you redeem the money. ETFs don’t have this advantage in Spain and, when you sell them, are taxed like a share.

Can I offset losses on some investments against gains on others?

Yes, within the savings tax base. Capital gains and losses offset each other, returns on movable capital do too, and if a negative balance remains you can carry it forward over the next four tax years.

How are pension plans taxed?

Differently from the rest. Contributions reduce your general taxable base while you’re working, but when you redeem the plan the money is taxed as earned income, at the rates of the general scale, not in the savings tax base. They defer taxes, they don’t eliminate them.

Do I have to declare investments I hold abroad?

If the value of your assets abroad exceeds certain thresholds, you may be required to file the Modelo 720, an informational form. It doesn’t involve paying tax, but the penalties for not filing it are very high: consult an adviser if you have assets outside Spain.


This article is purely informational. It is not tax advice. For specific personal situations, consult a tax adviser or gestor.

Figures for 2026. The withholding on movable capital (19%) has been in force since 2016, the pension plan contribution limit (1,500 €) since 2022, and the Modelo 720 threshold (50,000 €) since 2012.

This article is checked against official sources and reviewed periodically. If you spot anything out of date, email us at [email protected].