Skip to content

Total capital gains exemption may apply if the net amount is reinvested after mortgage cancellation

Managing a primary residence involves significant tax implications, especially when there is an outstanding mortgage debt at the time of sale. Applying the reinvestment exemption requires a precise calculation of the amount that must be allocated to the new home to avoid paying capital gains tax under Personal Income Tax (IRPF).

What the DGT has ruled

The Dirección General de Tributos (DGT) has clarified the scope of Article 38 of the IRPF Law regarding homes that have external financing. The criterion establishes that, for the exemption on capital gains to be total, the taxpayer must reinvest the net amount obtained from the transaction.

In cases where the transferred property has an outstanding mortgage, the total amount to be reinvested is not the gross sale price, but the result of subtracting the principal of the loan that still needs to be amortized from the transfer value. If the taxpayer reinvests the entirety of this resulting amount in a new primary residence within a two-year period, the exemption on capital gains will be complete.

What it means for you

If you are an individual selling your primary residence and have an active mortgage, the reinvestment calculation changes. You should not consider the total sale value as the reinvestment base, but rather the capital you actually receive after cancelling the debt with the financial institution.

This criterion allows that, even if the money received is less than the sale price due to the debt cancellation, the reinvestment requirement is met if that net amount is allocated to the new residence. Compliance with this requirement is subject to the deadlines established by the regulations, which can be before or after the transfer of the original home.

What you should do

It is necessary to perform an exact calculation of the principal pending amortization at the time of sale to determine the precise reinvestment figure. An error in determining this amount could result in a partial exemption instead of a total one, increasing the tax burden on the income tax return. It is recommended to verify the composition of the mortgage balance and the reinvestment deadlines provided for in the IRPF Law and the IRPF Regulations.

Frequently asked questions

Should I reinvest the total sale price of my house if I have a mortgage?
No, you must reinvest the amount resulting from subtracting the outstanding mortgage principal from the sale price.
Within what timeframe must the purchase of the new home be made?
The regulations allow the reinvestment to take place within a period of two years, either before or after the sale of the primary residence.
Official binding ruling V5599-26
View full ruling →
Book your free first meeting