Skip to content

The two-year window

How the amount you have to reinvest is calculated

Sale price less the outstanding loan that is paid off, with the complete calculation and the effect of reinvesting only part of it.

The whole reinvestment exemption depends on one figure, and that figure is hardly ever the one the seller has in mind. It is not the gain, it is not what landed in their bank account and it is not the price in the deed on its own. It is the total amount obtained on the sale, adjusted by one rule (the rule on the outstanding loan) which article 41.2 of the IRPF Regulations writes in two lines and which decides the outcome in half of all cases. This guide is the complete arithmetic, step by step.

Step 1: the total amount obtained

The starting point is the transfer value: the price stated in the deed, reduced by the expenses and taxes inherent in the sale that the seller paid. The usual deductions are the plusvalía (the municipal tax on the increase in land value) when the seller pays it, the estate agent's commission, the energy certificate, the certificate of habitability where the town hall requires one, and the costs of cancelling the mortgage at the land registry.

Things that are not costs of the sale are not deducted: the removal, the new furniture, the last month of mortgage on the old house or the refurbishment done so that it looked good in the photos. Nor is the income tax you will have to pay afterwards, however obvious that may seem.

ItemAmount (€)Deducted from the transfer value?
Price in the deed340,000It is the starting point
Estate agent's commission (VAT included)12,100Yes
Municipal plusvalía paid by the seller3,900Yes
Energy certificate and habitability certificate260Yes
Cancellation of the mortgage at the registry640Yes
Removal and furniture for the new house4,500No
Total amount obtained323,100

Step 2: subtract the outstanding loan, if there was one

This is the adjustment that really changes the numbers. Where borrowed money was used to buy the home being sold, the Regulations say the total amount obtained is the result of reducing the transfer value by the principal of the loan still outstanding. The logic is simple: that money was never yours, it went straight from the buyer to the bank, and you cannot reinvest what you never received.

Outstanding principal, not instalments or interest

What is subtracted is the capital outstanding on the day of signing, the figure shown in the certificate of outstanding debt that the bank issues for the cancellation. Interest accrued and unpaid is not subtracted, nor is the early repayment fee, nor the balance of a credit line that has nothing to do with the purchase. And it has to be finance used to buy the home being sold: a later mortgage taken out on that house to pay for something else does not fall within the rule, and that nuance is the one that causes the most arguments.

ItemAmount (€)
Total amount obtained (step 1)323,100
Outstanding principal of the purchase loan, paid off out of the sale−118,400
Amount to reinvest to exempt 100 %204,700

Look at the effect: someone who had a mortgage needs to reinvest much less than it seemed. That is the good side of a rule usually explained as if it were a penalty. In practice the amount to reinvest comes quite close to what the seller sees arriving in their current account, which is exactly what the rule was aiming for.

Step 3: the gain, which is a separate sum

The gain is worked out separately and plays no part in step 2. It is the difference between the transfer value (the one from step 1) and the acquisition value, which is made up of the price paid at the time plus the expenses and taxes inherent in the purchase that the buyer bore: the ITP (the Spanish transfer tax on resale property) or non-deductible VAT, the notary, the land registry and the gestoría (the administrative agency that handled the paperwork) back then. If the home was let at any point, the acquisition value is reduced by the depreciation, and there is a specific rule for that which we explain in the depreciation that is subtracted even if you never deducted it. The cost of improvements is also added to the acquisition value, but not the cost of repairs: the dividing line is set out in improvement or repair.

ItemAmount (€)
Transfer value323,100
Purchase price at the time186,000
ITP, notary, registry and gestoría on the purchase16,300
Documented improvement (complete replacement of the electrical installation)9,400
Acquisition value211,700
Capital gain111,400

Step 4: the exemption, full or proportional

If €204,700 or more is reinvested in another main home within the two years, the gain of €111,400 is fully exempt. If less is reinvested, the exemption is proportional: the part of the gain exempted bears the same proportion to the whole gain as the amount reinvested bears to the amount that had to be reinvested. The formula is a simple rule of three.

Reinvested (€)ProportionExempt gain (€)Taxable gain (€)
204,700 or more100 %111,4000
160,00078.16 %87,07024,330
120,00058.62 %65,30346,097
60,00029.31 %32,65178,749
00 %0111,400

The practical reading of this table is that each extra euro reinvested saves tax until you reach the ceiling, and that beyond the ceiling it saves nothing. Reinvesting €260,000 when the amount to reinvest was €204,700 does not improve the tax result by a single cent: going over the figure gives no additional entitlement. It is worth knowing before stretching to buy a more expensive home for reasons believed to be tax reasons.

What counts as an amount reinvested

The price of the new home counts, and so do the expenses and taxes inherent in that purchase that you pay: the ITP or VAT on the purchase, the notary, the land registry and the gestoría. The costs of the financing do not count (the valuation, the arrangement fee, the insurance linked to the mortgage) because they are a cost of the loan, not of acquiring the property. Nor does furniture, nor a later refurbishment, unless it fits within the specific cases of construction or renovation, which have their own deadline rules.

The money does not have to be the same money

The rule requires you to reinvest an amount, not to trace the banknotes. Someone who bought the new home before selling the old one, with savings or with a bridging loan, has reinvested all the same: what gets compared is figures and dates, not the path of each transfer. What does help is for the file to tell the story in order, because a review that does not understand the flow of money tends to ask twice.

The three mistakes we see again and again

  1. Reinvesting the gain instead of the amount obtained. This is the expensive one, and it is almost always discovered once the two years are over.
  2. Forgetting to subtract the outstanding loan. This one runs the opposite way: it makes the seller believe far more had to be reinvested than the law requires, and leads them to give up on the exemption as impossible.
  3. Counting as reinvestment what is not. The furniture, the new kitchen and the mortgage costs add up in the seller's own sums and do not add up in the tax office's.

Two spouses, two calculations

When the home belongs to two people, the exemption is not calculated as a couple. It is calculated for each taxpayer and on their percentage of ownership. Each has their own amount obtained, their own gain and their own obligation to reinvest their share, and each decides whether or not to reinvest. It is entirely possible for one of the two to be fully exempt while the other pays tax, if the new home is bought in different proportions from the old one.

ItemOwner A (50 %)Owner B (50 %)
Their share of the amount to reinvest (€)102,350102,350
Share in the purchase of the new home70 %30 %
Amount reinvested on a €260,000 purchase (€)182,00078,000
ResultFull exemptionProportional exemption of 76.2 %

The same split applies to the outstanding loan: each owner subtracts their own share of the capital outstanding, not the whole of it against one of them. In a separation or divorce where the home is awarded to one spouse, this calculation gets considerably more complicated, and it should be done before signing the convenio regulador (the separation agreement approved by the court), because afterwards the division is closed.

Before signing, two documents

For this calculation to hold up you need two papers that are only easy to get at the right moment: the certificate of outstanding debt issued by the bank for the cancellation, showing the capital outstanding at the date of signing, and the original purchase deed with the invoices for the costs at the time. Asking for them afterwards is possible and a nuisance; asking for them the week of the signing costs nothing.

We are tax lawyers, not a gestoría that processes forms: the part that adds value here is deciding what goes in each box and being able to defend it later. What we do not do is promise an outcome before seeing the deeds. If you would like us to run the numbers with your documents, write to us through the reinvestment form; the general picture of the relief is on the page on main home reinvestment, and the conditions, one by one, are in this other guide.

Your reinvesting in a new home, in two minutes

That is how long the form takes. The rest is our work.

Start here
Book a callWhatsApp