Capital gains tax when selling property in Spain

Two Taxes When You Sell Property in Spain

When you sell a property in Spain, you face two distinct taxes: (1) capital gains tax on the profit you make — paid to the Spanish national tax authority — and (2) the municipal plusvalía (IIVTNU), a local tax based on the increase in the cadastral value of the land — paid to the local town hall (ayuntamiento). Understanding both is essential to plan your sale properly.

Capital Gains Tax: Residents vs Non-Residents

How capital gains are taxed depends on your tax residency status:

Tax Residents (IRPF)

If you are a Spanish tax resident, capital gains from property sales are declared in your annual IRPF return as ganancias patrimoniales. The gain is taxed at the savings tax rates:

  • Up to €6,000 gain: 19%
  • €6,001–€50,000: 21%
  • €50,001–€200,000: 23%
  • €200,001–€300,000: 27%
  • Over €300,000: 28%

Non-Residents (IRNR)

If you are a non-resident, the capital gain is taxed at a flat rate: 19% for EU/EEA nationals and 24% for non-EU nationals (including UK nationals post-Brexit). The buyer is required to retain 3% of the purchase price and pay it directly to the Spanish Tax Agency on your behalf as a withholding (retención). You then file a non-resident tax return (Modelo 210) to settle the actual gain — if the 3% retention exceeds the actual tax due, you are entitled to a refund.

Calculating the Capital Gain

The taxable gain = sale price minus allowable costs. The acquisition cost (what you paid when buying) is adjusted for all costs paid at the time of purchase: ITP or IVA, notary fees, Land Registry fees, legal fees, and any major improvement works carried out since purchase (with invoices). The sale costs (estate agent commission, legal fees for the sale, cancellation of any mortgage) are deducted from the sale price. Keeping all original purchase invoices and improvement receipts is essential — they can significantly reduce the taxable gain.

Key Exemptions for Residents

Spanish tax residents benefit from important exemptions that non-residents do not:

  • Primary residence reinvestment exemption: If you sell your principal residence and reinvest the proceeds in another principal residence within 2 years, the gain is exempt from IRPF.
  • Over-65 exemption: If you are over 65 and sell your principal residence, the entire gain is exempt from IRPF — regardless of whether you reinvest.
  • Over-65 lifetime annuity: If you are over 65 and sell any property (not just your home), investing the proceeds in a qualifying lifetime annuity (within 6 months) exempts gains up to €240,000.

The Municipal Plusvalía (IIVTNU)

The Impuesto sobre el Incremento de Valor de los Terrenos de Naturaleza Urbana (IIVTNU), commonly known as the plusvalía municipal, is a local tax charged by the town hall (Mijas Ayuntamiento in most Costa del Sol cases). It is calculated on the increase in the cadastral value of the land over the period of ownership — not the actual market gain. The rate and calculation method are set by each municipality.

Following a Constitutional Court ruling in 2021, sellers can now choose between two calculation methods — the objective method (based on cadastral value) or the real gain method — and pay whichever gives the lower result. If the property was sold at a loss, no plusvalía is payable. Your lawyer will calculate both methods to minimise your liability.

Frequently Asked Questions

Yes. The 3% retention is a prepayment against the actual capital gains tax owed. You must file a Modelo 210 non-resident tax return within 4 months of the sale. If the actual tax on your gain is less than the 3% retained, the Spanish Tax Agency refunds the difference — but this process can take 12–18 months. Your lawyer files the Modelo 210 and monitors the refund on your behalf.
Under Spanish law, the plusvalía is legally payable by the seller. However, in practice, the parties can contractually agree for the buyer to pay it — this is sometimes seen in new-build contracts from developers, but is not the norm for private resale transactions. Your purchase or sale contract should clearly state who bears this cost.
Yes, for major improvements (not routine maintenance). Works that increase the property's value — such as a full kitchen renovation, new bathroom, pool, or extension — can be added to the acquisition cost, reducing the taxable gain. You must have proper invoices from registered contractors. Routine maintenance costs (repainting, minor repairs) cannot be deducted. Keeping all improvement invoices from the day you buy is crucial tax planning.