Home › Questions › Capital gains tax on selling property
Spain — capital gains tax when selling property
Tax · Selling Spanish Property

Capital gains tax when selling property in Spain

When you sell a home or investment property in Spain, the profit is taxed as a ganancia patrimonial. How much you pay — and how it is collected — depends on whether you are a Spanish tax resident or a non-resident, and on the reliefs you may qualify for. Plan the number before you sign.

Selling a property in Spain almost always triggers a taxable capital gain, and the tax can be one of the largest single costs of the transaction. Yet many sellers only discover how it works — and how much is withheld at completion — in the days before signing at the notary, when it is too late to plan. This page explains, in general terms, how the gain is computed, how residents and non-residents are taxed differently, which reliefs may apply, and how the sale interacts with the separate plusvalía municipal and with any tax you owe in your home country. The recurring theme is simple: the tax outcome of a sale is decided long before completion day, so the time to look at it is before you agree a price, not after.

Jacob Salama, tax lawyer

"The capital gains tax on a property sale is decided by the figures and reliefs you line up before you sign, not by the price alone. Once the deed is signed the reliefs you did not qualify for are gone — so we model the number, and the paperwork behind it, before completion."

— Jacob Salama · International Tax lawyer, Ilustre Colegio de Abogados de Málaga (nº 11294)

What "capital gains tax" means on a Spanish sale

In Spain the profit on selling real estate is not a stand-alone "property sale tax"; it is a capital gain — a ganancia patrimonial — that forms part of your income for the year and is taxed within the savings-income category. The essential idea is that you are taxed on the increase in value of the asset between the moment you acquired it and the moment you transfer it, not on the whole sale price. If you sell for the same real, cost-adjusted value at which you bought, there may be little or no gain to tax at all.

Because the gain sits inside the income-tax system, the rules that apply to you depend on your status. A Spanish tax resident reports the gain in the annual income-tax return (IRPF) and is taxed under the resident savings scale, with access to certain reliefs. A non-resident is taxed under the separate non-resident income tax (IRNR) on the Spanish-situated property, at a flat rate and through a specific collection mechanism. The two paths are examined below, but the computation of the gain itself is broadly the same for both.

How the gain is computed

The taxable gain is, in broad terms, the transfer value minus the acquisition value. Getting each side right — and keeping the invoices to prove it — is what determines the size of the bill.

The difference between the two is the gain. Where a property was acquired before certain historic dates, older acquisition (abatement) coefficients and inflation-adjustment rules can still reduce the taxable gain within limits — a point that particularly affects long-held family properties and must be checked case by case, because the rules were curtailed and capped. Keeping a complete file of purchase deeds, tax receipts and improvement invoices from the day you buy is the single most valuable thing a seller can do; a gain you cannot document is a gain you may end up paying tax on unnecessarily.

Keep the paperwork. Notary deeds, the purchase-tax receipt, agent invoices and builders' invoices for improvements all reduce the taxable gain — but only if you can produce them. Assemble the file when you buy, not when you sell.

Residents: the savings-income scale

If you are a Spanish tax resident, the gain on selling a property is taxed within the savings-income base of your annual IRPF return, under a progressive scale rather than a single flat rate. As a general guide for recent years, the savings scale has run in bands from around 19% on the lowest tranche up to roughly 28% on the highest tranche, with intermediate bands in between. These figures and the exact band thresholds change and must be confirmed for the year of your sale — treat the numbers here as an indication of the shape of the scale, not as a quote for your case.

Savings-income tranche (illustrative)Indicative rate — confirm for the year
Lowest trancheAround 19%
Middle tranchesRising through the low-to-mid 20s%
Highest trancheAround 28%

Because the scale is progressive, a large one-off gain can push part of the profit into the higher bands, so the effective rate on a big sale sits somewhere between the bottom and top figures rather than at either extreme. This is one reason timing and reliefs matter so much for residents: the difference between a taxed gain and an exempt one can be worth tens of thousands of euros.

Reliefs that can reduce or remove the gain

Spanish tax residents may qualify for reliefs that a non-resident generally cannot use. The three that most often matter on a home sale are:

None of these reliefs is automatic. Each depends on facts — how long you lived in the property, whether it truly was your habitual residence, the timing of the reinvestment, your age at the date of sale — and on being claimed correctly in the return. For the wider picture of how these fit alongside your other Spanish taxes, see our guide to taxes for expats in Spain.

Non-residents: the flat rate and the 3% withholding

If you are not a Spanish tax resident when you sell, the gain on the Spanish property is taxed under the non-resident income tax (IRNR) rather than the resident scale. Current Agencia Tributaria guidance for capital gains from sales of Spanish real estate gives a flat rate of 19%, but the current figure should still be confirmed for the year of sale and your residence status. The resident reliefs above — reinvestment, the over-65 exemption — are generally not available in the same way, although EU/EEA residents have in some circumstances been able to access a main-home reinvestment relief, which again must be checked for your situation.

The feature that catches most non-resident sellers by surprise is the collection mechanism. When the seller is a non-resident, the law does not wait for the seller to file and pay. Instead, the buyer must withhold 3% of the agreed purchase price at completion and pay it directly to the Spanish tax office as a payment on account of the seller's capital gains tax. The seller therefore receives 97% of the price at the notary, with the remaining 3% going straight to the Treasury.

Modelo 211 and reclaiming an over-withholding

The 3% withholding is documented on Modelo 211, the form the buyer uses to declare and pay the retained amount. The buyer should give the seller a copy, because it is the seller's evidence that the payment on account was made. The seller then files their own non-resident return for the gain, and one of two things happens:

In other words, the 3% is not a final tax; it is a deposit against the actual liability. On a property that has risen substantially in value, 3% of the price may be far less than the tax on the gain, so a non-resident seller should not assume the withholding settles everything. On a property sold at little or no gain, the seller may be owed most of the 3% back — but only if the reclaim is filed correctly and on time. If you have already left Spain, use the practical checklist in selling Spanish property after moving back to the US. If you are buying rather than selling, the mirror-image obligations are covered in our guide to buying property in Spain.

The separate plusvalía municipal

Capital gains tax is not the only tax on a sale. Spanish town halls levy a separate local tax, the plusvalía municipal (formally the tax on the increase in value of urban land), on the increase in the value of the land — not the building — over the period of ownership. It is a distinct charge from the state capital gains tax, is calculated on its own basis, and is normally borne by the seller.

The plusvalía municipal has been through significant legal change: its calculation method was overhauled after court rulings, and there are now alternative ways of computing it, including protection where there has genuinely been no increase in land value. Because it is a municipal tax, the detail varies by town hall. It should always be quantified alongside the state capital gains tax when you work out the true net proceeds of a sale, as the two together determine what actually reaches your bank account.

Coordination with your home country and treaties

Selling Spanish property can also have consequences in your country of residence or citizenship. Spain generally has the primary right to tax a gain on real estate situated in Spain, but that does not automatically switch off tax in your home country. Depending on where you are resident, the same gain may also be reportable there.

This is where double-tax treaties come in. A treaty between Spain and your home country typically confirms that Spain may tax the Spanish property gain, and then provides a mechanism — usually a foreign tax credit or an exemption — so that you are not taxed twice on the same profit. For US persons in particular, the position is more involved, because the United States taxes on the basis of citizenship as well as residence, so a US seller may need to report the gain in both systems and rely on the treaty and foreign tax credit to avoid genuine double taxation. Currency movements between the purchase and sale dates can also change the gain as measured in your home currency, sometimes producing a taxable gain abroad even where Spain sees little. Anyone with a cross-border profile should coordinate Spanish and home-country advice before completing.

Selling property can also interact with other Spanish charges, such as wealth tax, depending on your overall assets and region; our note on Spain's wealth tax by region explains how that varies across the country.

Planning the sale before you sign

Everything above points to one conclusion: the tax on a property sale is shaped by decisions taken before completion, not after. Once the deed is signed, the reliefs you did not qualify for, the invoices you did not keep and the timing you did not plan are all beyond recovery. A sensible pre-sale review usually covers:

Done in advance, this turns a nasty surprise at the notary into a known, planned figure — and, where reliefs apply, a materially smaller one. If you want to look at your own sale before you commit to a price, we can model it with you.

Frequently asked questions

What rate will I pay as a resident?

Residents are taxed on the gain under the progressive savings-income scale, which in recent years has run from around 19% on the lowest tranche up to roughly 28% on the highest. The exact bands and rates change and must be confirmed for the year of your sale, and reliefs may reduce or remove the gain.

As a non-resident, is the 3% withholding my final tax?

No. The buyer withholds 3% of the price on Modelo 211 as a payment on account. Your real tax is the flat rate on the actual gain — 19% for EU/EEA residents. If the real tax is lower than the 3% you can reclaim the difference; if higher, you pay the balance.

Can I avoid the gain by reinvesting in another home?

Residents selling their habitual residence may exempt the gain to the extent they reinvest the proceeds into a new main home within the required window, subject to strict conditions. Partial reinvestment gives partial relief.

Is the plusvalía municipal the same as capital gains tax?

No. The plusvalía municipal is a separate local tax on the increase in the value of the land, levied by the town hall and normally paid by the seller. It is calculated on its own basis and must be counted alongside the state capital gains tax.

General information, not tax advice. Rates, bands, thresholds and reliefs — including the savings-scale bands, the non-resident flat rate, the reinvestment and over-65 exemptions and the plusvalía municipal — change and must be confirmed for your circumstances and the year of your sale. Book a private consultation for advice on your own transaction.

Free pre-sale tax review

Know the tax on your sale before you sign

Tell us about the property and your residency status and a Málaga Bar–registered lawyer will reply within 24 hours — in confidence.

✓ Thank you. We'll review your sale and reply within 24 hours.

Confidential · No obligation · Reply within 24 hours

Know your number before you sell

Book a private consultation and we'll model the real tax on your Spanish property sale.

iMessage WhatsApp