The mistake that repeats: you reinvest the price, not the gain
This is by a distance the most expensive confusion on this line. Somebody selling their home for 300,000 € having bought it for 200,000 € thinks the gain is 100,000 € and that reinvesting that 100,000 € means paying nothing. It does not work that way. For the relief in article 38 of the Personal Income Tax Act to cover the whole gain, you have to reinvest the total amount obtained on the sale — the full 300,000 €.
With one essential qualification in your favour: from the amount obtained you deduct the outstanding mortgage cancelled with the proceeds. If 120,000 € of mortgage was still running, the amount to reinvest drops to 180,000 €. That deduction is what makes the relief workable in most real cases, and it is exactly the figure missing from back-of-envelope calculations.
The two exits, side by side
| Reinvest | Pay tax on the gain | |
|---|---|---|
| What you pay on the gain | Nothing, if the reinvestment is total | The savings scale, in bands |
| What has to be reinvested | The amount obtained less the loan cancelled | — |
| Window | Two years, counted backwards and forwards from the sale | — |
| What the sold property had to be | Your main home | Any property |
| What the bought property has to be | A new main home, actually occupied and intended as such | Whatever you like |
| Indispensable formality | Recording the reinvestment — or the intention to reinvest — in the return for the year of the sale | Declaring the gain in that same return |
| Freedom afterwards | Committed: the money has a destination and the home has a holding period | Total |
The two-year window opens before the sale
This surprises a lot of people: the two-year period counts in both directions. A home bought up to two years before the sale qualifies, not only one bought afterwards. Anyone who bought first and sold later — which is the commoner order where there are children or a job relocation — is within it, provided no more than two years separate the two events and the rest of the conditions hold.
What counts as reinvestment is the amounts actually paid over in that period, including anything paid with a new loan taken out to buy. What does not count is intention without payment.
Partial relief, which is the usual outcome
If you do not reinvest everything, the relief is not lost: it applies proportionately. The part of the gain that is exempt bears the same relation to the whole gain as the amount reinvested bears to the amount that had to be reinvested.
Using the earlier figures, which illustrate the mechanics and are not thresholds: amount to reinvest 180,000 € and gain 100,000 €. Reinvest 135,000 € and that is 75 %, so that proportion of the gain is exempt: 75,000 €. The remaining 25,000 € is taxed in the savings base. The difference between doing that calculation properly and not doing it is several thousand euros.
When it is better not to claim it
- When you have turned 65 and are selling your main home: the gain is already exempt under article 33 of the Personal Income Tax Act, with nothing to reinvest and no money tied up.
- When the gain is small. If it falls in the first savings band, the tax can be less than the cost of chaining on a purchase you do not need, with its notary, its registry and its transfer tax.
- When the new property is not genuinely going to be your main home. Buying to let, buying for the children or buying to spend part of the year does not fit, and forcing it is buying yourself an enquiry.
- When the money has another destination — clearing debts, a business, a move abroad. The relief is not free: it ties up the amount and it ties you to the new home.
If you sell in one year and are going to buy in the next, you have to declare the gain and record your intention to reinvest in the return for the year of the sale. This is not an informational courtesy: anyone who simply leaves the gain out because they are going to reinvest is left with an undeclared gain, and when the letter arrives, arguing for the relief becomes far harder. And if the announced reinvestment is then not made, or not made in time, the non-exempt part has to be regularised with late-payment interest; doing that on your own initiative, before the tax office asks, triggers at worst the surcharges under article 27 of the General Tax Act, which is a considerably better place to be.
That what you sold was your main home: actual and continuous residence for at least three years, subject to the listed exceptions — marriage, a job move, circumstances requiring the change. And that what you bought is going to be one, occupied within the following twelve months. A flat left empty or let out before selling does not meet the first, however much it was your home for years. And if you are not resident in Spain in the year of the sale, the relief is a different conversation altogether: we look at it on selling as a resident or a non-resident.
When reinvesting or paying the tax on the gain fits neither column
The comparison assumes you sell one house and buy another. Half a dozen very common situations fall outside that pattern, and in every one of them the answer depends on details the table does not carry.
- Building instead of buying. Someone who sells and puts up a house on land they already own is reinvesting, but with a calendar problem: what counts is the amounts actually paid within the two years, and building work is paid against certificates that can run past that window. The house also has to be finished and occupied in order to be one. It is the situation in which the relief is most often lost for arriving late rather than for lack of money.
- Refurbishing the home you already had. Different from improving it: ordinary improvement work on a flat that was already your main home is not the acquisition of a new one. The line exists, it is narrow, and it is worth raising before the builders start.
- Divorce. One spouse keeps the home and the other leaves it under the separation agreement. The one who leaves stops living there, but does so for a circumstance the rules contemplate among those that excuse continued occupation. What gain surfaces, and when, depends on how the ending of the joint ownership is structured and on whether money changes hands.
- The couple where only one of them owns it. The relief belongs to whoever has the gain. Buying the new home in both names does not transfer the relief to the other, and buying half each with one person's money can reinvest half of what was assumed.
- Buying the new home outside Spain. While you are resident here the rules do not require the property to be in Spanish territory, but they do require it genuinely to be your main home. And if you go and live in it, you will probably stop being resident here, at which point the conversation returns to the beginning.
That last one is the version we see most: the owner who sells in Spain and moves back to their own country in the same year or the next. Whether the relief is available at all, and under which set of rules, turns on your residence in the year of the sale and not on your intentions for the year after. It is worth settling before the deed, because afterwards the date cannot be moved.
What to look at before deciding on reinvesting or paying the tax on the gain
Five figures and three documents. With them the decision is calculated; without them it is an opinion:
- The amount obtained on the sale and the loan balance repaid on the day of completion, with the bank's certificate of zero debt.
- The real gain: the purchase deed, the costs and taxes paid at the time, documented improvements, and depreciation if the property was ever let.
- The two dates, sale and purchase, to check whether they fit inside the two-year window in either direction.
- What has actually been paid for the new home within that period, which does not always match its price.
- Proof that what you sold was your main home: padrón registration, utilities in your name and three continuous years.
- Your age on the day of the sale, because from 65 the conversation may be a different one altogether.
How we handle reinvesting or paying the tax on the gain
We calculate three specific numbers: the amount that has to be reinvested once the cancelled loan is deducted, the real gain with the costs and improvements that genuinely count, and the tax under each of the two scenarios. That shows whether full relief is within reach, whether partial relief is the realistic outcome, and what each additional euro reinvested is actually worth.
We do not promise the tax office will not ask: on transactions of this size it asks frequently. What we prepare is the file that supports the relief — deeds, mortgage cancellation certificates, municipal registration records, utility bills — before it is needed. It is on reinvesting in a new home, and the form asks for the dates, the amounts and the mortgage, which is where all of it comes from.