When do you have a capital gain?
When you sell shares, funds or crypto for more than you paid. If you sell for less, you have a capital loss.
The gain is the difference between what you receive and what you paid, counting the costs of both trades:
- buying costs are added to what you paid (the acquisition value);
- selling costs come off what you receive (the transfer value).
How much do you pay?
The gain is added to the year’s interest and dividends in the savings base, and pays on the same scale: 19% to 30%, band by band.
The example assumes you have a salary that already uses your personal allowance (mínimo personal). With no other income, the personal allowance lowers the tax on your savings.
- What you receive, after selling costs
- €12,000.00
- What you paid, with buying costs
- −€10,000.00
- Capital gain
- €2,000.00
- Dividends for the year
- €3,000.00
- Savings base
- €5,000.00
- Tax on the base, at 19%
- €950.00
Is anything withheld when you sell?
When you redeem a fund at a gain through a bank or broker in Spain, the bank or broker keeps 19% of the gain before paying you.
That withholding is not an extra tax: it is a prepayment that comes off in the Renta.
And if you sell at a loss?
The loss lowers your tax, in this order:
- First the loss comes off the year’s gains.
- What is left lowers your interest and dividends, by up to 25% of that amount. The reverse works too: a negative balance of interest and dividends offsets gains, up to the same 25%.
- Anything still left carries over to the next 4 years, and is offset there the same way.
Not in this guide
The two-month rule when you buy back after selling at a loss, withholding when you sell shares, fund-to-fund transfers, and the scales of the Basque Country and Navarre. For those questions, ask the Agencia Tributaria.
Sources
The rules in this guide come from the Agencia Tributaria’s Renta 2025 practical manual: acquisition and transfer value, gains in the savings base, offsetting in the savings base, state savings scale, and regional savings scale. Who withholds and the personal allowance come from the BOE: IRPF regulation: who withholds (art. 76) and the 19% (arts. 90 and 96) and IRPF law: the personal and family allowance (art. 56).