
The exemption for reinvestment in the principal residence is one of the most relevant tax benefits in personal taxation in Spain. It directly affects Personal Income Tax (IRPF) and, in certain cases, also Wealth Tax (IP). Knowing how this exemption works allows you to optimise the tax burden derived from the sale of a property and avoid problems in future reviews by the Tax Agency.
What is the exemption for reinvestment in a primary residence?
Index of contents
The exemption for reinvestment in primary residence allows taxpayers to avoid paying personal income tax on the capital gain obtained on the sale of their primary residence, provided that the amount obtained is reinvested in the purchase or renovation of a new primary residence.
Practical example of reinvestment exemption
To better understand how the exemption for reinvestment in a primary residence works, let’s look at a practical example:
Juan bought his main residence in 2019 for 100,000 euros. This home is his main residence for the following years. In 2021, due to a change of workplace, he decides to sell it for 120,000 euros and purchase a new primary residence for 80,000 euros.
Calculation of the capital gain:
Acquisition value: €100,000
Transfer value: 120.000 €.
Capital gain: 120.000 € – 100.000 € = 20.000 €.
Application of the exemption:
As Juan reinvests the total amount of the capital gain obtained (€20,000) in the new home, this gain is exempt from personal income tax.
The tax on the capital gain will therefore be zero euros.
Key aspects to consider:
The purchase value includes not only the purchase price, but also associated costs such as notary fees, registration fees, taxes (VAT or ITP), home improvement costs (e.g. renovations), intermediary fees (real estate agencies) and other mandatory costs such as the energy efficiency certificate.
It is essential to keep all supporting documentation (invoices, payment receipts, tax assessment forms, etc.) in order to be able to prove the purchase amount in the event of a possible request from the tax authorities.
What happens if the entire amount is not reinvested?
In Juan’s example, if instead of €80,000 he had purchased a new home for, for example, €60,000, the exemption would be partial, applying only to the reinvested proportion of the total gain.
Impact on Wealth Tax (IP):
Although the gain is exempt from personal income tax, the new main residence would still be exempt from Wealth Tax (up to a limit of 300,000 euros), in accordance with the provisions of Article 4 of Law 19/1991, of 6 June, on Wealth Tax (Ley 19/1991, de 6 de junio, del IP).
What requirements must be met for the exemption for reinvestment in the principal residence to apply?
In order to be able to apply the exemption for reinvestment in the primary residence, several requirements must be met, which are as follows:
The property being sold must be the seller’s habitual residence.
It is considered to be a habitual residence when the seller has resided there for a minimum period of three years.
However, there are other cases where the property is also considered to have been the seller’s habitual residence, if the taxpayer dies or there is a change of address due to marriage, a job transfer or divorce, for example. In the case of a taxpayer with a disability, if the habitual residence in which he/she lives is not adapted and he/she has to change home, this will also be considered as a circumstance in which the exemption for reinvestment in the primary residence applies.
The new home that is purchased must also be used as a primary residence.
Therefore, the purchaser must reside in that home for a period of twelve months from the date of purchase or from the completion of the work on the home.
Within what period of time must the reinvestment be made?
The capital gain obtained from the sale of the main residence must be reinvested in another main residence within two years in order to be able to apply the exemption for reinvestment in the main residence. Therefore, in the case we have seen above, the deadline for reinvestment is 2021.
Is partial reinvestment possible?
One of the most common doubts among taxpayers is whether the entire amount obtained from the sale of the main residence must be reinvested or whether it is sufficient to reinvest only part of the amount obtained from the sale of the main residence in the purchase of the main residence.
If only part of the money obtained is reinvested in the purchase of the new main residence, the exemption will be proportional to the amount reinvested.
As we have seen above, we must also take into account that the expenses and taxes of the property must also be taken into account when determining the reinvested money.
What happens if a mortgaged property is sold?
It is quite common for the seller to transfer a property with a mortgage on which there is an outstanding amount to be repaid and to use part of the price obtained to pay off the mortgage. In these cases, the Inland Revenue considers this to be a total reinvestment and in order to calculate the total amount obtained from the sale, the amount of the mortgage pending repayment must be subtracted.
As you have seen, these are cases in which it is necessary to analyse the circumstances of the taxpayer and of the sale by lawyers who are experts in the procedures for buying or selling a property in order to verify whether the exemption for reinvestment in the main residence can be applied and whether it can be done totally or partially.



