You only pay when you sell
As long as you don't sell, there's nothing to declare for how much a share, fund or ETF has risen. The gain (or loss) appears on the day you sell, and is calculated like this:
- Sale value: what you receive when selling, minus the sale fees.
- Acquisition value: what you paid when buying, plus the purchase fees.
- Gain or loss: the difference between the two.
How much you pay: the savings base
Gains from selling investments, together with dividends and interest, go into the savings base, which has its own rates, by bracket: each part of the base pays its rate, not all of it at the highest.
| Part of the savings base | Rate |
|---|---|
| Up 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 % |
For example, with €10,000 of gains in the year you'd pay €1,140 on the first €6,000 (at 19 %) and €840 on the next €4,000 (at 21 %): €1,980 in total, 19.8 % of the gain.
If you bought in several goes: FIFO
If you have shares of the same security bought on different dates and sell only part, the tax office considers you sell the ones you bought first. It's the FIFO method («first in, first out»), and you can't choose another.
This matters: if you bought the first ones much cheaper, the gain on that sale will be higher than if you calculated with the average price.
Losses count too
If you sell at a loss in a year, it's subtracted from that year's gains. If the losses are larger:
- You can subtract what's left from the year's dividends and interest, up to 25 % of them.
- Whatever is still left is carried forward to the following four years.
The two-month rule
If you sell at a loss and buy the same security again two months before or after the sale, that loss can't be deducted yet: it's deferred until you sell the shares you bought back. It's meant to stop people selling and buying back just to pay less. For unlisted securities, the period is one year.
Investment funds: switching
Investment funds have an advantage: you can move the money from one fund to another without selling for tax purposes, and you pay nothing until you actually redeem. ETFs, although they look like funds, don't have that advantage: changing ETF means selling and paying tax. We explain it in Index funds or ETFs.
Quick questions
Do I have to declare anything if I haven't sold?
Not for the gains: the gain only appears when you sell. Dividends are declared in the year you receive them.
Which method does the tax office use if I bought in several goes?
FIFO: you're considered to sell what you bought first. The average price can't be used.
Can I offset one year's losses with another year's gains?
Yes, over the following four years, if that year wasn't enough to offset them.
General information to understand how it works, not financial or tax advice. Rules change and every case has nuances: for your return, confirm with the Spanish Tax Agency or an adviser.