Spanish capital gains tax
What you owe on selling a Spanish home or shares, and the three routes to owing nothing.

- Acquisition value (art. 35.1)
- €195,000.00
- Transfer value (art. 35.2)
- €288,000.00
- Taxable base
- €93,000.00
Costs, improvements and depreciation
The costs and taxes of each transaction go into its value; loan interest is excluded by art. 35.1.b).
- Loan interest is not part of the acquisition value; the other costs and taxes are.
- Separately from this, selling urban property usually triggers the municipal plusvalía, a different tax collected by the town hall.
An indicative calculation under the state IRPF rules. It does not replace professional advice and does not take your full situation into account.
Video: how to use the calculator
What you must reinvest is not the sale price
Almost everything published about the reinvestment relief says you have to put "the whole amount obtained" into the new home, and a reader with a mortgage still running concludes they cannot reach it. Article 41.1 of the IRPF regulation says otherwise, in its first paragraph: where the seller used borrowing to buy the property being sold, the "total amount obtained" is, for this purpose only, the transfer value reduced by the principal of the loan outstanding at the moment of the transfer. Someone selling for 300,000 euros with 120,000 of mortgage left is fully exempt by reinvesting 180,000, not 300,000. That is not a detail: it decides whether the relief is total or partial, and with it whether the bill is zero or a tax on part of the gain.
The window is two years, and it runs backwards as well
Article 41.3 gives two years from the sale to reinvest, "in one go or successively". What is rarely added is its closing paragraph: money put towards a main home already bought "within the two years before" the sale also qualifies. The window is therefore four years wide in total, and someone who bought first and sold afterwards is still inside it. One formal duty is easy to miss: if the reinvestment does not happen in the same year as the sale, you must state your intention to reinvest in that year's return. And if you then fail to, article 41.5 requires a supplementary self-assessment with late-payment interest.
There are two over-65 exemptions and they are not the same
They sit five articles apart and answer opposite questions. Article 33.4.b) exempts the gain on the transfer of the taxpayer's main home by someone over 65, or by a person in a situation of severe or major dependency: no conditions, no deadline, no cap. Nothing has to be reinvested. Article 38.3 exempts the transfer of any asset by an over-65, but only if the amount obtained goes within six months into an insured lifetime annuity, and only up to 240,000 euros. The same 66-year-old gets two different answers depending on whether the asset is their home or a second flat, and in the second case reinvesting the whole 400,000 they received still leaves part of the gain taxable, because the cap does not move.
Letting it before selling increases the gain
Article 35.1 builds the acquisition value from the price paid, the cost of improvements, and the costs and taxes inherent to the purchase, and it expressly excludes loan interest: twenty years of mortgage payments do not count. It then adds a short sentence with long consequences: that value "shall be reduced by the amount of the depreciation". An owner who let the flat and deducted the 3 % annual depreciation arrives at the sale with an acquisition value lower than what they paid, and therefore a larger gain and a larger bill. Ten years of letting on a 100,000-euro building is 30,000 euros taken off the acquisition value and added, euro for euro, to the gain.
The 400,000-euro abatement cap is not what it looks like
Assets bought before 31 December 1994 keep the abatement coefficients of transitional provision nine, which reduce the part of the gain generated before 20 January 2006 by 11.11 % for each year of ownership at 31 December 1996 beyond two, for real estate; 25 % for listed shares; and 14.28 % otherwise. The 400,000-euro cap that always accompanies that explanation is not per sale and does not apply to the gain: letter b) defines it as the total TRANSFER VALUE of every abatement-eligible asset sold since 1 January 2015, a cumulative lifetime allowance. Hence its three branches: below the allowance the reduction is full; straddling it, the reduction applies only to the slice of transfer value that fits; with the allowance already spent, nothing applies. Hardly any tool implements the middle branch.
And the express non-subjection is not the coefficient reaching 100
The closing paragraph of letter c) declares the pre-2006 part not subject where ownership at 31 December 1996 exceeded ten years for real estate, five for shares and eight for everything else. That is a rule of its own, not a consequence of the percentage: real estate with eleven qualifying years abates 11.11 by nine, which is 99.99 %, and the law exempts the full hundred. For shares the two readings coincide, because 25 by four is exactly 100, which is why a tool tested only on shares can carry the error and never find out.
Worked example
A main home bought in 2010 for 180,000 euros with 15,000 of costs and sold today for 300,000 with 12,000 of costs: the acquisition value is 195,000, the transfer value 288,000, and the gain 93,000 euros. With no relief the savings-base tax is 20,270 euros. If 90,000 of mortgage was still outstanding, the amount to reinvest for a full exemption is not 288,000 but 198,000, and reinvesting that figure brings the bill to zero.
Frequently asked questions
How much tax do you pay on selling a house in Spain?
How much must I reinvest to pay nothing?
What if I am over 65?
How long do I have to reinvest?
Which costs can I deduct?
What if I sell at a loss?
Is this the same as the municipal plusvalía?
What if I am a non-resident?
Related calculators & reading
Embed this calculator
Paste this code on your site to show the calculator. It includes an attribution link.
Preview
Sources
- Ley 35/2006, del IRPF: arts. 33, 34, 35, 38, 66 y 76 y disposición transitoria novena · Boletín Oficial del Estado
- RD 439/2007, Reglamento del IRPF: arts. 41 y 41 bis (exención por reinversión) · Boletín Oficial del Estado
- Ley 7/2024, disposición final séptima: el tramo del 30 % de la base del ahorro · Boletín Oficial del Estado
- Manual práctico de Renta: ganancias y pérdidas patrimoniales · Agencia Tributaria
Author: Thorben Rasmus Idel · Reviewed by: Nahar Geva · Last reviewed: