Selling your Spanish propertyArticle 4 of 9 · 8 min read
Capital gains tax when you sell a Spanish property
How the taxable gain on a Spanish property sale is worked out, how residents and non-residents are taxed differently, and which reliefs (reinvestment and over-65) may cut the bill. For anyone planning to sell.
Terms used
- Plusvalía — The plusvalía is the local tax on the rise in value of urban land when a property is sold or inherited.
- Plusvalía municipal — The plusvalía municipal is a local tax on the increase in the land's value, usually paid by the seller.
- ITP — The ITP is the transfer tax paid when buying a resale property.
- AJD — The AJD is a stamp duty paid on the notarised deed when buying property.
- IRPF — The IRPF is Spain's personal income tax for residents.
- IRNR — The IRNR is Spain's income tax for non-residents.
Key rules
- Gain: Your taxable gain is the sale price minus the purchase price, each adjusted for costs, taxes and improvements.
- Non-resident rate: Non-residents pay a flat 19% if they live in the EU or EEA, and 24% otherwise.
- Buyer withholding: If you are a non-resident, the buyer withholds 3% of the price and pays it to the tax authority.
- Reinvestment: Residents can exempt the gain on a main home by buying a new main home within 2 years before or after the sale.
- Over 65: Residents aged 65 or over pay no tax on the gain from selling their habitual home, with no reinvestment needed.
How the gain is calculated
The gain is what you sell for, minus what you paid, with both sides adjusted for costs. If the result is a loss, it counts as a loss instead.
Sale side. Start with the sale price. Subtract your selling costs and the taxes you pay as seller: agent fees, plusvalía municipal and mortgage cancellation costs.
Purchase side. Start with the price you paid. Add purchase costs and taxes (notary, registry, ITP or VAT, AJD) and the cost of improvements. If you rented the property out, subtract the depreciation.
Inflation adjustments no longer apply to individuals. The one exception is property bought before 31 December 1994. For those, transitional abatement coefficients reduce the part of the gain that built up before 20 January 2006. Check the tax agency's guidance if this is your case.
The calculator below estimates what you keep after selling.
If you are a Spanish tax resident
Your gain is added to your savings income and taxed in the IRPF return. The state-wide savings brackets for 2025 were:
- 19% up to €6,000
- 21% from €6,000 to €50,000
- 23% from €50,000 to €200,000
- 27% from €200,000 to €300,000
- 28% above €300,000
The total is the same in every region. Rates are set each year, so check the table for the year you sell.
If you are not a Spanish tax resident
You pay IRNR, a flat rate on the gain, with no inflation coefficients:
- 19% if you live in the EU or EEA (with information exchange with Spain). You can deduct the same expenses as residents.
- 24% for everyone else.
The buyer withholds 3% of the price and pays it to the tax authority on your behalf. That 3% counts toward your final bill.
Relief 1: reinvesting in a new main home
If the property was your main home, the gain is exempt when you put the proceeds into a new main home.
- The sold home must have been your habitual residence, generally lived in for at least 3 years.
- You must buy the new home within 2 years before or after the sale.
- If you reinvest only part of the proceeds, only the gain on the reinvested amount is exempt.
- A mortgage repaid on the sold home counts as reinvested if the money is used to buy the new home.
- State the reinvestment in the IRPF return for the sale year, or a later one if you reinvest after the sale. Keep the new home for the required period.
This relief is for residents. EU/EEA non-residents have limited access to it.
Relief 2: selling your main home at 65 or over
If you are 65 or over, the gain on your habitual home is fully exempt. There is no cap and you do not need to reinvest. The same 3-year habitual residence test generally applies.
People who are dependent under the Dependency Law are also exempt at any age. This also covers a sale by someone who has become dependent.
A second home or investment property does not qualify. Non-residents are generally excluded unless a treaty or EU case law applies.
The questions below cover selling costs, partial reinvestment and the old inflation relief.
Estimate what you keep after selling
Work it out
What you enter
- Sale price (EUR): Your sale contract or the price agreed with the buyer.
- Price you paid when you bought (EUR): Your original purchase deed.
- Taxes and fees you paid when you bought (notary, registry, transfer tax or VAT, stamp duty) (EUR): Your purchase deed and the invoices from that time.
- Cost of improvements you paid for, with invoices (EUR): Your renovation invoices and payment records.
- Estate agent commission you pay (EUR): Your agent contract. Enter 0 if you sell without an agent.
- Plusvalía municipal (municipal land value tax) you pay (EUR): Your town hall's calculation or your gestor.
- Mortgage balance to pay off (EUR): Your bank app or a payoff statement from your bank.
- Early repayment commission in your mortgage (%): Your mortgage contract. Enter 0 if there is none.
- Other mortgage cancellation costs (notary, registry, bank fees) (EUR): Quotes from your bank and gestor.
- Non-resident tax rate that applies to you (%): Enter 19 if you live in the EU or EEA, 24 if you live elsewhere, or 0 if you are a Spanish tax resident.
Figures used
- Top of the 19% bracket: 6,000 EUR (as of 2025)
- Top of the 21% bracket: 50,000 EUR (as of 2025)
- Top of the 23% bracket: 200,000 EUR (as of 2025)
- Top of the 27% bracket: 300,000 EUR (as of 2025)
- Buyer's withholding on a non-resident sale: 3 % (as of 2025)
Worked example (with Sale price 300,000 EUR, Price you paid when you bought 200,000 EUR, Taxes and fees you paid when you bought (notary, registry, transfer tax or VAT, stamp duty) 20,000 EUR, Cost of improvements you paid for, with invoices 10,000 EUR, Estate agent commission you pay 9,000 EUR, Plusvalía municipal (municipal land value tax) you pay 2,500 EUR, Mortgage balance to pay off 100,000 EUR, Early repayment commission in your mortgage 0.25 %, Other mortgage cancellation costs (notary, registry, bank fees) 1,200 EUR, Non-resident tax rate that applies to you 0 %)
| Step | Result |
|---|---|
| Early repayment commission | 250 EUR |
| Total mortgage cancellation costs | 1,450 EUR |
| Sale value after selling costs | 287,050 EUR |
| Purchase value with costs and improvements | 230,000 EUR |
| Taxable gain (zero if you made a loss) | 57,050 EUR |
| Tax at resident rates | 12,001.5 EUR |
| Non-resident sale (1 if a non-resident rate was entered) | 0 number |
| Capital gains tax | 12,001.5 EUR |
| Amount the buyer holds back | 0 EUR |
| What you keep after mortgage, costs, plusvalía and capital gains tax | 175,048.5 EUR |
| Cash you receive on the day (after the buyer's withholding, before final tax) | 187,050 EUR |
When the sum misleads
- If you bought before 31 December 1994, special reduction coefficients can lower the gain, so ask a tax adviser.
- If you rented the property out, the depreciation you claimed lowers your purchase value and raises the gain.
- If the sum shows a loss, the tax is zero. The loss can still count in your tax return.
- The commission cap depends on when you signed the mortgage and whether it is fixed or variable. Use the rate in your contract.
- Non-residents can have more tax to pay or a refund when they file, because the buyer's withholding is only an advance on the final tax.
Frequently asked questions
Can I deduct my selling costs from the capital gain?
Yes, selling costs and taxes you pay as seller reduce the sale value used to work out your gain. Agent fees, the municipal land value tax (plusvalía) and mortgage cancellation costs all count. On the purchase side, notary, registry and transfer tax or VAT add to your acquisition value, as do improvements.
Do I have to reinvest if I am over 65 and sell my main home?
No, if you are 65 or over and tax resident in Spain, the gain on your habitual home is exempt with no limit and no need to reinvest. The home must have been your main residence, usually for at least 3 years.
Which tax rate applies if I live outside Spain when I sell?
A non-resident pays a flat 19% if living in the EU or EEA, and 24% if living elsewhere. Inflation coefficients do not apply to you. EU and EEA residents can deduct the same expenses as residents.
Does the old inflation relief still apply to my gain?
No, inflation coefficients no longer apply to individuals, except for property bought before 31 December 1994. For those, transitional reduction coefficients cut the part of the gain built up before 20 January 2006. Ask a tax adviser to run the calculation.
More in Selling your Spanish property
- Selling a property in Spain, the timeline from listing to deed
- What a seller needs before listing a Spanish property
- Pricing your home and choosing a selling agent
- Municipal land value tax (plusvalia municipal) when you sell
- The 3% withholding when a non-resident sells
- Selling your Spanish home after you have left Spain
- Selling a Spanish property with a tenant in it
- You inherited a Spanish property, what to check before selling
Need certainty before you act?
For important relocation decisions, speak with a qualified human specialist.
Always verify important information with the relevant official authority or a qualified adviser before acting. This website uses large language models together with various public data sources, official government documents and other established sources. Due to the amount of data on this website, some information might be wrong. Information may also be incomplete or outdated.