Skip to content
TaxesWiki Por Dividendos

Capital Gains

"The profit made when selling an asset for more than it cost. In Spain it is taxed in the savings base, with a FIFO rule and loss offsetting."

A capital gain is the positive difference between what you receive when selling an asset and what it cost you to buy it. It is the other half of an investor's return — the part that is not dividends — and it has its own tax mechanics for Spanish residents.

Capital gain = Sale value − Acquisition value (fees and commissions included)

How it is taxed in Spain

Capital gains go into the savings base of the IRPF, on a progressive scale starting at 19% (exact brackets change; the updated detail is in our tax guide). The most valuable nuance: they are only taxed when you sell. While you hold, the accumulated gain generates no tax at all — the deferral that makes buy & hold and accumulating ETFs so efficient.

The three rules you should know

  1. FIFO: if you bought the same security in several batches, the tax authority considers you sell the oldest shares first — usually the ones with the largest gain in a rising portfolio. It matters when planning partial sales and when rebalancing.
  2. Loss offsetting: realised losses offset gains from the same year; the excess can offset up to 25% of your investment income (dividends included), and whatever remains carries forward for the next 4 years. Selling an unrecoverable losing position has at least that tax value.
  3. The two-month rule: you cannot deduct a loss if you rebuy the same (or an equivalent) security within two months before or after the sale. It exists precisely to prevent manufacturing "fake" tax losses without leaving the position.

Capital gains vs dividends

Both are taxed in the savings base, but with a difference in control: the dividend is taxed when the company decides to pay it; the capital gain, when you decide to sell. That asymmetry underlies many portfolio decisions — and is why combining both sources gives tax flexibility.

Frequently asked questions

How much tax do I pay on a capital gain?+

It is taxed in the IRPF savings base, on a progressive scale starting at 19% and rising by brackets according to your total savings income for the year. You only pay when you sell, never on unrealised appreciation.

Can I offset losses against gains?+

Yes: losses offset gains from the same year, the excess offsets up to 25% of your investment income, and the remainder carries forward 4 years. That is the reason to review losing positions before the tax year ends.

What is the two-month rule?+

An anti-abuse rule: if you sell at a loss and rebuy the same security within two months (before or after), you cannot deduct that loss until you sell for good. It prevents manufacturing tax losses without unwinding the investment.