Capital gains tax when you sell a property in Spain: residents and non-residents
Spanish house prices rose around 9% in the first half of 2026[1], so many owners selling now are sitting on a real, taxable gain. Spain taxes the gain on a property sale differently for residents and non-residents, so residence status at the time of sale matters as much as the size of the gain. Residents pay through the progressive savings-rate bands and can reach exemptions non-residents cannot. Non-residents pay a flat rate, with part of the price withheld by the buyer at completion. This guide covers both regimes, what actually gets taxed, the main-home reliefs and what to put in place before you list.
Resident or non-resident: the split that sets your bill
As at October 2026, a non-resident selling a Spanish home pays a flat capital gains tax of 19%[2]. The buyer is legally required to withhold 3% of the purchase price and pay it to the Agencia Tributaria on your behalf[2]. A resident pays on the gain through the savings-income bands: 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 and 30% above that[3].
That 3% retention is where non-residents most often lose money. It is a payment on account, not the final bill. If your actual gain means you owe less than the 3%, you must file to reclaim the difference. The tax office does not return it automatically. If the gain means you owe more, the balance is still due. Treating the retention as “handled” is how sellers either overpay or leave a refund sitting unclaimed.
The rate matters, but the bigger point is the column you fall in. Residents can reach main-home reliefs that remove the gain entirely in some cases. Non-residents cannot.
What actually gets taxed when you sell?
The gain is not the difference between what you paid and the headline sale price. Start from the sale price, take off your allowable selling costs, and set that against your purchase cost. You can add the transfer tax or VAT paid on purchase, notary and land registry fees and your lawyer’s costs to the price you paid[4]. Capital improvements count too: a replaced roof or a new extension, for example. Routine maintenance and repainting do not. On the sale side you can deduct the estate agent’s commission and legal fees[4]. Keep the invoices: deductions you cannot evidence are deductions you cannot take.
Plusvalía municipal is a separate, local tax. The town hall charges it on the rise in the land value since you bought, and it is paid to the local council[4]. Budget for it alongside the state capital gains tax rather than inside it.
How the date of a sale affects the tax
The tax regime sets the rate and your costs set the gain, and both are fixed on the day you complete. Your residence status on that day decides which rules apply.
Two resident reliefs matter here. A Spanish tax resident aged 65 or over who sells their main home pays no capital gains tax on the gain, and need not reinvest[3]. Main home here means vivienda habitual: broadly a home lived in continuously for at least three years. Under 65, the main-home gain is exempt only to the extent you reinvest it in a new main home within two years. Reinvest part of the proceeds and you get part of the relief[3].
Say you are 63, resident, with a villa in Benahavís you have lived in for years. A sale now runs the gain through the savings bands. The same sale after your 65th birthday could fall under the over-65 main-home exemption, if the home still qualifies. When to sell is your decision; the rule simply means the date of the sale affects the tax.
The same applies in reverse for people moving to Spain. Once you are Spanish tax resident you are taxed on worldwide gains[3], so a sale of an asset held abroad can fall within Spanish tax depending on when it happens and how the double tax treaty treats that asset.
Spanish property rules are changing, with housing measures still unsettled, so exact rates and thresholds may move. Check the position for your own sale with your lawyer or an asesor fiscal when you have a date.
Before you put the villa on the market
Three things are worth starting before the board goes up.
Get independent tax advice, not the lawyer the agent proposes. As Belen, a partner at a Spanish relocation firm, puts it: “do not choose the lawyer proposed by the agent, because their job will always be for the sale to go ahead.” Their incentive is that the sale completes. Yours is that it completes on the right side of the tax line.
For your own sale, check the position with your lawyer or an asesor fiscal (a Spanish tax adviser) once you have a date.
Assemble your deduction evidence now: the purchase deed, the tax and fees you paid buying and invoices for every improvement. That file is what turns the headline gain into the real, lower taxable one.
Get independent tax advice and model your residency position well before you list or complete a sale.
Correct as of October 2026. Tax rules change. How you are taxed depends on your individual circumstances and may change in the future. This is general information, not personalised tax advice.
This article is provided solely for informational purposes, reflecting Northern Estate’s interpretation of current legal frameworks and market practices, which are inherently subject to change. It does not purport to offer, nor should it be interpreted as offering, professional investment, financial, or real estate advice. Individuals considering any form of investment or financial planning in relation to luxury real estate should consult with a qualified professional advisor to tailor advice specifically to their circumstances. Northern Estates has endeavored to ensure the accuracy of the information herein; however, we cannot accept liability for any errors or omissions.
Sources
[1] INE, ‘Índice de Precios de Vivienda, primer semestre 2026’, Instituto Nacional de Estadística, 2026. Available at: https://www.ine.es/dyngs/INEbase/es/categoria.htm?c=Estadistica_P&cid=1254735976607
[2] BOE, ‘Real Decreto Legislativo 5/2004, Ley del Impuesto sobre la Renta de no Residentes’, Boletín Oficial del Estado. Available at: https://www.boe.es/buscar/act.php?id=BOE-A-2004-4527
[3] BOE, ‘Ley 35/2006 del Impuesto sobre la Renta de las Personas Físicas (arts. 33.4.b, 38, 49 y 66)’, Boletín Oficial del Estado. Available at: https://www.boe.es/buscar/act.php?id=BOE-A-2006-20764
[4] Agencia Tributaria, ‘Ganancias y pérdidas patrimoniales: transmisión de inmuebles’, Agencia Estatal de Administración Tributaria. Available at: https://sede.agenciatributaria.gob.es