Owners

IRPF when you sell your home: exemptions and filing

When you sell a home, IRPF taxes the capital gain, which is the difference between the sale value and the acquisition value, including the costs and taxes of both transactions. The gain may be exempt if it is your primary residence and you reinvest the money in another primary residence, or if you are over 65. It is reported on the tax return for the year of the sale.

How the gain is calculated

The capital gain or loss is the transfer value minus the acquisition value. Both take into account the costs and taxes you paid, such as notary, registry and tax costs on the purchase, or those on the sale. If you made renovations with invoices, they can also be counted as a higher acquisition value, with supporting documents.

The gain is included in the savings tax base. The current rates and brackets are on the Agencia Tributaria website and may change, so you should check them in the year you sell.

When the gain is exempt

  • Reinvestment in a primary residence: if the property you sell is your primary residence and you reinvest the proceeds in buying another primary residence within the legal deadline, the gain is exempt (in whole or in part, depending on the amount reinvested). The deadline and conditions are set out in the Ley del IRPF.
  • Over 65: the gain from the sale of a primary residence is exempt when the seller is over 65, with no obligation to reinvest.

For a home to count as a primary residence, there are effective residence requirements set by the regulations. If the home was not your primary residence, the gain is taxed in the ordinary way.

Which documents to gather

The purchase deed, invoices for renovations, proof of acquisition and sale costs, and the IBI receipt. Gathering them before you sell avoids surprises when preparing your tax return. We explain what other papers are needed in documents for selling an apartment in Madrid.

Where it is reported

On the tax return for the year in which you sell, together with your other income. There you indicate, if applicable, the exemption for reinvestment or for age. Don't confuse this tax with the plusvalía municipal, which is levied by the city and paid separately.

Frequently asked questions

Do I pay IRPF if I sell my home at a loss?

There is no gain to be taxed, but the capital loss has its own treatment. You should review it with a tax advisor.

Do I have to pay if I buy another home with the proceeds of the sale?

If it is your primary residence and the reinvestment meets the legal requirements and deadlines, the gain is exempt in proportion to the amount reinvested.

Does the exemption for those over 65 apply to any home?

It applies to the primary residence. It does not apply to a second home.

When is it paid?

The gain is included in the tax return for the year of the sale, within the filing period of the corresponding campaign.

Official sources

This guide is for information only and does not replace tax advice for each case. Rates, deadlines and requirements may change: check the regulations in force.

Want to sell your apartment in Madrid?

Non-binding estimate with real comparables from your area. If the listing is exclusive, we don't charge the owner a commission.

Request a valuation

Keep reading

Areas where we sell: Barrio de Salamanca · Recoletos · Chamberí · Almagro · Centro · Justicia · Chamartín · El Viso · Retiro · Jerónimos · Tetuán · Ciudad Lineal · Arganzuela · Aravaca · Pozuelo de Alarcón · Boadilla del Monte · Majadahonda · Las Rozas · Torrelodones · Alcobendas-La Moraleja · San Sebastián de los Reyes · Tres Cantos.

WhatsApp