Guide · Taxation of the sale

Capital gains tax and IRPF when selling your home

The tax cost almost nobody calculates in time. Between 5% and 25% of what you receive from the sale can end up with the tax office or the City Council. Knowing it before signing is the difference between planning and reacting.

Reading time14 minutes
AuthorProfinca Team
UpdatedMay 2026
Barcelona architecture
«The tax bill on a sale is decided months before signing. Not the day after.»
Introduction

Most owners find out how much they owe the tax office after signing the sale. By then, there is no room for decisions: only for payments.

This guide explains the two taxes levied on the sale of a home in Spain, how they are calculated in 2026, what exemptions exist and which decisions made in time can save you thousands of euros.

01
What you have to pay

The two taxes on the sale

When selling a home in Spain, the owner faces two different taxes that are calculated, managed and paid separately:

  • Municipal capital gains tax (IIVTNU): collected by the City Council. It taxes the increase in value of the urban land between purchase and sale. It is paid within 30 days of signing.
  • IRPF (capital gain): collected by the tax office. It taxes the difference between the sale price and the adjusted purchase price. It is declared in the following year's income tax return.

They are cumulative: you pay both. The good news is that both allow for nuances, deductions and, in some cases, full exemptions. La mala noticia es que esos matices solo sirven si los conoces a tiempo.

02
Local tax

Municipal capital gains tax: what exactly it is

The municipal capital gains tax taxes the increase in value of the land between when you bought and when you sell. It is a municipal tax: each City Council sets its rates and coefficients within national limits.

It only taxes the urban land, not the building. That is why, for the same sale price, a home in a central area with a high cadastral land value will pay more than a home in an outlying area. The seller pays it (except for gifts and inheritances).

  • Taxpayer: the seller
  • Payment deadline: 30 working days from signing
  • Collector: the City Council where the property is located
  • In Barcelona: managed through the Institut Municipal d'Hisenda
03
Constitutional Court ruling, October 2021

The two methods of calculation

Since the Constitutional Court ruling of October 2021, the capital gains tax allows two methods. The taxpayer can choose whichever is more beneficial:

Objective method. Multiplies the cadastral value of the land by a coefficient determined by the years of ownership. The result is the tax base, to which the City Council applies its rate (in Barcelona, up to 30%).

Real method. Calculates the difference between the transfer value and the acquisition value, applying to that difference the proportion the land represents of the total cadastral value. The same municipal rate is applied to that base.

For older properties in central areas, the real method usually saves between 20% and 60% compared with the objective method. But it has to be expressly requested.

The City Council applies the objective method by default. If the real method is more favourable, the seller must request it by providing the purchase and sale deeds.

04
Exceptions

When is it not paid capital gains tax

There are three cases in which the seller does not pay municipal capital gains tax:

  • There has been no increase in value. If you sell for a price equal to or lower than the purchase price, the transaction is exempt. You must formally apply to the City Council, providing both deeds.
  • Ownership period of less than one year.
  • Transfer between spouses in separation, divorce or annulment by court order, and handing over the property to the bank in lieu of payment (dación en pago) of the main residence.
Before going further
Find out the real value of your home before calculating taxes
A professional valuation lets you estimate precisely the base on which you will be taxed. Free and with no obligation.
Value now →
05
What the tax office takes

IRPF: the capital gain

Selling a home generates, for IRPF purposes, a capital gain or loss. Si hay ganancia, Hacienda grava esa diferencia dentro de la savings base, with rates in 2026 ranging from 19% to 30%.

It is declared in the income tax return for the following year after the sale. If you sell in 2026, you declare it in the 2026 return (filed in April-June 2027).

Unlike municipal capital gains tax, IRPF does not accept the argument «I sold for less» as an exemption. If there is a gain (calculated according to the tax formula), it is taxed.

06
The complete formula

Real calculation, with an example

The formula the tax office uses to calculate the capital gain is:

Gain = (Sale price − Selling costs) − (Purchase price + Purchase costs + Improvements)

Deductible selling costs: agency commission, municipal capital gains tax, certificates, mortgage cancellation. Purchase costs: ITP or VAT, notary, registry, agency fees. Improvements: extensions or new installations (not repairs).

Example · Flat in Eixample bought in 2010 and sold in 2026
Sale price450.000 €
Agency commission (3%)13.500 €
Municipal capital gains tax4.200 €
Purchase price (2010)280.000 €
Purchase costs (ITP, notary)28.000 €
Bathroom and kitchen renovation (2018)18.000 €
Capital gain106.300 €
07
Current rates

Tax brackets 2026

The capital gain is taxed in the savings base, with progressive brackets:

Gain bracketApplicable rate
Up to €6,00019 %
From €6,000 to €50,00021 %
From €50,000 to €200,00023 %
From €200,000 to €300,00027 %
Over €300,00030 %

On the gain in the example (€106,300), the tax office would take approximately 22.300 €. Para una venta de 450.000 €, el coste fiscal total —plusvalía + IRPF + comisiones— ronda los 40.000 €, un 8,8 % del precio de venta.

Profinca advice
A reliable calculation in a 30-minute conversation
When you sell with us, the first step is to understand the real tax bill. No surprises at signing.
Request a meeting
08
When you pay less

Exemptions: reinvestment and over-65s

Reinvestment in a main residence. If you sell your main residence and reinvest the full amount obtained in another main residence within a maximum of two years, the gain is fully exempt. Si reinviertes solo una parte, la exención es proporcional.

Over-65s. If the seller is 65 or over and sells their main residence, the gain is fully exempt from IRPF, with no need to reinvest.

  • Reinvestment in a main residence: full or proportional exemption
  • Over-65s: full exemption on the main residence
  • Over-65s (other property): exemption via a life annuity up to €240,000
  • Handing over the main residence to the bank in lieu of payment: exempt
  • Offsetting against capital losses
09
The key move

How to organise it before signing

The difference between a sale that is well planned from a tax point of view and an improvised one can be several thousand euros. Steps to take before signing the deposit contract:

  • Locate the purchase deed and all associated costs (ITP, notary, registry)
  • Gather the invoices for improvements made
  • Ask the City Council for a capital gains tax simulation using both methods
  • Calculate the estimated capital gain and IRPF
  • Plan the reinvestment in a main residence within the two-year period
  • If the seller is 65+, check whether the home qualifies as a main residence
  • Keep all invoices for selling costs
Most tax optimisations are legal, simple and well known. What goes wrong is the timing: they are applied before signing, not after.
NoticeThis guide reflects the regulations in force in May 2026 and is for information only. It does not replace personalised advice from a tax adviser. Profinca can support you through the process and refer you to a specialist professional.
Profinca · Since 1982

Tax is something you plan.
Not something you suffer.

At Profinca, before marketing a home we carry out a tax X-ray of the transaction. You will know precisely how much you will receive net. No surprises at the notary.