Skip to content

Sell one, buy another: the gain may be tax free

Selling your main home and buying another: the reinvestment exemption

One of the few large reliefs left in Spanish income tax, and one of the most frequently lost — usually over a deadline counted wrongly or a mortgage that nobody deducted.

What the statute says

Article 38.1 of the Spanish income tax act exempts the capital gain arising on the transfer of your main home, provided the total amount obtained is reinvested in acquiring a new main home. The detail sits in article 41 of the implementing regulations.

Put plainly: sell the place you live in, buy another to live in, and the gain is not taxed. But four conditions have to be met, and each of them has to be capable of being proved years later.

RequirementWhat it means
The property sold was your main homeContinuous residence for at least three years, unless circumstances necessarily required the move, and actually occupied within twelve months of buying or finishing the works
The new one becomes your main home tooSame test, applied to the new property
You reinvest the amount obtainedNot the gain: the whole sale proceeds, reduced by any outstanding mortgage cancelled out of them
Within two yearsBefore or after the sale. The two years run backwards as well as forwards
The window is four years wide, not two

Reinvestment may take place in the two years before the sale or the two years after it. Anyone who bought first and sold afterwards still qualifies, and that is forgotten often enough to be worth saying twice.

The calculation, and the mortgage trap

What has to be reinvested is the amount obtained on the sale — but that amount is reduced by the outstanding principal of any loan cancelled out of the price. This is the point that generates more assessments than any other, because people reinvest what actually reached their bank account and assume the relief is complete.

ItemExample
Sale price300,000 €
Outstanding mortgage cancelled−120,000 €
Amount to be reinvested180,000 €
Acquisition value of the old home200,000 €
Capital gain100,000 €

Reinvest 180,000 € or more and the whole gain is exempt. Reinvest less and the relief is proportionate: put 90,000 € of the 180,000 € into the new home and half the gain — 50,000 € — is exempt, with the other half taxed in the savings base.

What else counts as reinvestment

  • Rehabilitation of the property that is to become your main home, where the works fall within the regulatory definition of rehabilitation. Not every refurbishment does.
  • Construction, with its own completion deadlines.
  • Extension of the home that already is your main one, in defined circumstances.
  • Payments on account made inside the window, even where the deed comes later.
What does not count

Paying down the mortgage on a home you bought years ago is not reinvestment: the reinvestment has to occur inside the two-year window. Nor does buying a property that is not going to be your main home, however residential it is. A holiday flat is not a main home, and neither is one bought to let.

Three situations that change the answer

You are over 65

If you are over 65, the gain on the transfer of your main home is exempt without any need to reinvest. It is a separate and much simpler relief, and it is worth establishing which of the two applies before organising anything, because the planning is entirely different.

You are not resident in Spain

Residents of the European Union, Iceland, Norway and Liechtenstein can claim the reinvestment exemption in respect of what was their main home in Spain, on the same conditions. The difficulty is evidential: you have to show that the Spanish property really was your main home, which means assembling the proof — municipal registration, utility consumption, tax address — well before the sale rather than after it. This is declared through form 210 on the sale.

Divorce, a job move, a change in care needs

The three-year requirement falls away where circumstances necessarily require the change of address. That word is doing the work: it is not enough that moving was sensible or convenient. There is a large body of administrative doctrine on what is accepted and what is not, and it is the ground on which these cases are most often fought.

How it is claimed

The relief is claimed in the return for the year in which you sell:

  • The full capital gain is declared.
  • Where reinvestment has not yet happened, you tick the intention to reinvest and state the amount you are committing.
  • If in the end you do not reinvest, or reinvest less, you correct the position by filing an amended return for the year of sale, with interest.
The mistake with no way back

Failing to record the intention to reinvest in the return for the year of sale. If it is not stated, the administration takes the gain to be taxable, and putting that right afterwards requires a procedure that does not always succeed. It is declared properly the first year or it becomes very difficult.

Your case, in two minutes

Your main-home rollover: your map of obligations

The form for this service asks only what matters here. At the end you have your map of obligations, the deadlines running against you and a fixed price.

Start with this form →

What your main-home rollover costs

WorkPrice
Consultation: we review your case and tell you whether you qualify and what is missing92 €
Written opinion: full analysis, with the calculation, the deadlines and the doctrine370 €
Reflecting it in your income tax returnFixed quote
Answering a query from the tax office about the reinvestmentfrom 290 €

Taxes included. The consultation is credited against the written opinion if you go ahead with it.

The evidence file, which is built before the sale

Every requirement in this relief is a question of fact, and facts are proved with documents that existed at the time. What we ask for, and what a review will ask for, is broadly the same list: the municipal registration history showing who lived there and from when; utility bills showing real consumption rather than a standing charge; the tax address declared in those years; the deeds of both properties; and, where the three-year rule is being disapplied, the documentation of the circumstance that required the move — the court order, the employment contract, the medical or care assessment.

The weak point is almost always the new property. Claiming the relief commits you to making the new home your main one within twelve months and living in it, and that has to remain true afterwards. Buying a property, claiming the relief and letting it out is the fact pattern that produces the assessments, and it produces them several years later, when the letting has been reported by someone else.

Where this sits alongside everything else

Selling a home sets off more than one tax. The gain is income tax, and this relief is about that. The town hall separately taxes the increase in the land value, which is dealt with on its own page and is not affected by this exemption at all. And if you are not resident here, the sale is declared on form 210 and 3 % of the price will have been withheld by the buyer. People who plan for the relief and forget the municipal tax are surprised by a bill that the exemption does nothing to remove.

Questions we are asked about your main-home rollover

Does the time I lived there before marrying count? What counts is continuous habitual residence for three years in the property being sold, whatever your personal circumstances were. What has to be provable is actual residence: municipal registration, utility bills, tax address.

I bought the new one before selling the old one. Does that work? Yes. Reinvestment may occur in the two years before the transfer. It is the limb of the relief that goes to waste most often.

Do I reinvest the gain or the whole price? The amount obtained on the sale, reduced by the mortgage cancelled out of it. Not the gain. That distinction decides whether the relief is full or partial.

I am renting for a few months between the two homes. That does not defeat the relief, provided the new property becomes your main home within twelve months of its acquisition and the reinvestment deadline is met.

And if I end up not reinvesting? You correct the year of sale by amended return, with late payment interest. Doing it on your own initiative avoids a penalty, as we explain on filing late.

What to decide about your main-home rollover

What we are asked most about this service is not how to fill a form in: it is whether one option or the other suits you.

Reinvesting or paying the tax

See the comparison →

Main home reinvestment: 5 guides, in depth

Main home rollover relief: the four conditions

The four conditions for the Spanish main home reinvestment exemption, one by one: the home you sell, the home you buy, the amount and the two-year window.

Read the guide →

How to calculate the amount to reinvest

Sale price less the outstanding loan paid off, step by step: the full calculation for the Spanish main home exemption and the effect of a partial reinvestment.

Read the guide →

The two-year reinvestment window in detail

Backwards and forwards: payments on account, off-plan and self-build homes, instalment sales and the other clocks that run alongside the two-year reinvestment window.

Read the guide →

Proving it was your main home in Spain

Padrón registration, utility bills, tax address and the circumstances that release you from the three-year period: how a main home is proved for the reinvestment exemption.

Read the guide →

Claiming the reinvestment exemption, and if it fails

How the main home reinvestment exemption is entered in the Spanish tax return, what to do if you then do not reinvest, and how to answer the review that follows.

Read the guide →

Read it yourself

The full text, as published today. It is in Spanish only.

Links to the Boletín Oficial del Estado, the Spanish official gazette.

Book a callWhatsApp