property

IRPF Exemption on the Sale of a Primary Residence: Reinvestment and the Over-65 Rule

Anyone who sells their primary residence in Spain and makes a profit must, in principle, declare that gain under IRPF — unless they meet one of the statutory exemptions. The Spanish Income Tax Act (Law 35/2006) provides for two key exemption provisions: the reinvestment exemption, available to all age groups, and the full tax exemption for persons aged over 65. Both rules sound straightforward, but contain numerous pitfalls regarding deadlines, reporting obligations, and the definition of primary residence. In this guide you will learn how the gain is calculated correctly, what conditions you need to meet step by step, which common mistakes can prove costly — and what to do immediately after the sale.

IRPF exemption on the sale of a primary residence in Spain

Are you planning to sell your primary residence on Mallorca and want to know whether and how you can make use of the IRPF exemption?


What exactly is IRPF in the context of a property sale?

The Spanish income tax (Impuesto sobre la Renta de las Personas Físicas, or IRPF for short) captures, pursuant to Article 34 of Law 35/2006, the so-called capital gain (ganancia patrimonial): the difference between the acquisition value and the transfer value of a property. Tax residents — that is, individuals who spend more than 183 days per calendar year in Spain or whose centre of economic interests is located there — are subject to the IRPF legislation. Non-residents, by contrast, fall under the Non-Resident Income Tax Act (LIRNR), which has its own set of rules.

Tiered capital gains tax rates on property sales in Spain: 19 % to 30 % depending on the size of the gain

Capital gains tax on property sales in Spain is not a flat tax but is applied on a sliding scale. The following rates apply to tax residents:

Amount of gain Tax rate
Up to 6.000 EUR 19 %
6.000 – 50.000 EUR 21 %
50.000 – 200.000 EUR 23 %
Over 200.000 EUR up to 30 %

Please note: The precise banding above 200.000 EUR may change depending on the budgetary situation. Have the specific calculation carried out by a tax adviser or a gestoría.

Important: The general progressive IRPF rate (19–47 %) applies to employment income and similar earnings — capital gains from property sales are taxed at the more favourable rates set out above.


How is the taxable gain calculated?

Before you can know whether an exemption applies, you need to know what is actually being taxed. The basic formula is:

Gain = Transfer value − Acquisition value

However, neither figure is simply taken from the purchase contract — both are defined by law and may be increased or reduced by certain costs.

Items that increase the acquisition value

Pursuant to Article 35 of the IRPF Act, you may add the following items to the original purchase price:

Increasing item Explanation
Acquisition ancillary costs Notary, land registry, and legal fees on purchase
Taxes paid on acquisition ITP, inheritance tax, gift tax
Investment and improvement costs e.g. construction of a pool, renovation, extension
Repair and maintenance costs insofar as they can be capitalised

Items reducing the transfer value

You may deduct the following from the sale proceeds:

Reducing item Explanation
Estate agent's commission if borne by the seller
Notary and land registry costs on sale Escritura, land registry transfer
Legal fees for carrying out the sale
Plusvalía Municipal municipal capital gains tax on land, provided it is paid by the seller

Please note: Since 1 January 2015, the former inflation adjustment coefficient for property has been completely abolished. The acquisition value is therefore no longer adjusted for price developments — this considerably increases the tax burden for properties held over a long period.


The reinvestment exemption: how it works

The most important exemption provision is found in Article 38 of Law 35/2006: anyone who reinvests the proceeds from the sale of their primary residence — in full or in part — into a new primary residence is not required to pay tax on the corresponding proportion of the gain.

Overview of requirements

Requirement Detail
Primary residence qualification The property sold must have served as the habitual primary residence (vivienda habitual)
Minimum period of use As a rule, at least 3 years of continuous primary residence
Reinvestment property Only one new primary residence in Spain (or the EU/EEA)
Reinvestment period Within 2 years before or after the sale
Occupancy requirement The new property must actually be used as the primary residence

Partial exemption for proportional reinvestment

The exemption is not all-or-nothing. If you reinvest only a portion of the proceeds in the new primary residence, only the corresponding share of the gain will be exempt. This is particularly relevant if you are moving to a less expensive property.

Worked example:

  • Net sale proceeds (after costs): 500.000 EUR
  • Purchase price of new primary residence: 300.000 EUR
  • Reinvestment ratio: 300.000 / 500.000 = 60 %
  • Taxable share of the gain: 40 %

Note: The reinvestment does not have to be made using cash from the sale. Even if you initially take out a mortgage and use the proceeds later to pay it off, the exemption may still apply — however, you should definitely seek tax advice on this, as the details are complex.

The two-year window: what exactly applies?

The two-year period runs in both directions: you may have acquired the new primary residence up to two years before selling the old one (advance acquisition), or you have two years after the sale to complete the reinvestment. However, the reinvestment must at least demonstrably have begun by the time the IRPF return for the year of sale is submitted — and the intention to reinvest must be actively documented.


The 65+ rule: full exemption without reinvestment

A more far-reaching provision applies to persons aged 65 and over, set out in Artikel 33 Absatz 4 Buchstabe b) des Gesetzes 35/2006: the gain from the sale of the primary residence is fully exempt from IRPF — without any reinvestment being required.

Conditions of the 65+ exemption

Condition Detail
Minimum age 65 years at the time of the sale
Nature of the property Must be the primary residence (vivienda habitual)
Minimum period of use At least 3 years of uninterrupted use as the primary residence
Reinvestment obligation None — the profit is freely available

This is one of the most significant tax advantages for older property owners in Spain: an owner who has lived in their Mallorca property for more than three years can sell at the age of 65 and pocket the entire gain completely free of tax.

Special case: joint ownership and mixed acquisition histories

A common situation in practice: one spouse has owned the property for twenty years, whilst the other acquired their share only two years ago through divorce or inheritance. Pursuant to Artikel 33.4 b) des Gesetzes 35/2006, each co-owner is assessed against their own individual circumstances:

  • Has the older owner (65+) used their share as their main residence for three years? → Their share of the gain is exempt.
  • Does the other owner not meet the requirements? → Their share remains taxable.

Please note: Particularly in cases of divorce, inheritance, or gifting of a share, the tax authority AEAT scrutinises very carefully whether the three-year period has been met for the respective share. You should have this kind of situation reviewed in advance by an Abogado or tax adviser without fail.


What counts as a 'main residence' (vivienda habitual)?

The exemption rules apply only to the main residence — and this term is more narrowly defined than many people assume. The following criteria arise from legislation and administrative practice:

Criterion Requirement
Actual occupation Permanent, habitual centre of life
Minimum period of use Generally 3 consecutive years
Registration Empadronamiento (municipal residents' register) as an indicator, but not sufficient on its own
Only one main residence Each taxpayer may have only one main residence
Exceptional circumstances Work-related relocation, marriage, separation, or disability may shorten the 3-year period

Second homes, holiday properties, or long-term rental properties do not count as a main residence — even if you are registered there. In cases of doubt, the AEAT will investigate on the basis of electricity and water consumption, bank records, and evidence from employers.


Step by step: the process when selling with a claim to exemption

7-step process for the IRPF exemption on the sale of a primary residence: from eligibility check to securing evidence with AEAT
  1. Check the tax requirements: Has the minimum period of use been reached? Are you over 65? Is reinvestment a realistic possibility?
  2. Calculate the gain on a provisional basis: Compile the acquisition cost plus all improvement costs and ancillary costs; determine the sale proceeds minus selling costs.
  3. Document the reinvestment plan: If reinvestment is planned: record searches and statements of intent in writing, and conclude preliminary purchase contracts (where possible before the deadline expires).
  4. Declaring the exemption in the IRPF return: Even when full exemption applies, the transaction must be declared in the tax return (Modelo 100) — including the relevant exemption code.
  5. Retaining supporting documents: Keep all invoices for improvements, notarial deeds, purchase contracts, and registration certificates for at least four years (the general statute of limitations of the AEAT).
  6. Registering the new main residence as such: Complete the empadronamiento in the new municipality within twelve months of purchase or occupation.
  7. Keeping evidence ready for the AEAT: In the event of an audit, use as a primary residence and reinvestment must be fully documented.

Capital gains tax rates: what remains taxable?

Where the exemption only applies in part, or the conditions are not fully met, the taxable portion of the gain is taxed at the capital gains tax rates. The following rates apply to tax residents:

Amount of gain Tax rate
Up to €6,000 19 %
€6,000 – €50,000 21 %
€50,000 – €200,000 23 %
Over €200,000 up to 30%

By comparison: anyone who is not tax-resident in Spain (a non-resident) is taxed on property sales under the LIRNR — the exact rates and rules differ, and the IRPF exemptions do not apply to non-residents as a general rule.


The most common mistakes — and how to avoid them

In practice, exemption claims repeatedly fail on the same points. Here are the most important pitfalls:

Mistake Consequence Countermeasure
Three-year requirement not met Full tax liability, no entitlement to exemption Plan the timing of the sale carefully
Reinvestment deadline exceeded Back-taxation plus interest Mark the deadline firmly in your calendar; bring forward the property purchase if necessary
Exemption not declared in the IRPF return AEAT raises tax assessment, objection required Always state with exemption code in Modelo 100
Improvement costs not documented Higher taxable gain Keep all invoices since purchase
Co-ownership shares overlooked Only partial exemption possible Clarify ownership structure in advance with an adviser
Empadronamiento missing or submitted too late AEAT doubts primary residence status Register immediately after moving in
Reinvestment in a property abroad Generally only recognised in Spain/EU/EEA Have the destination country checked in advance

What comes next? Obligations after the sale

The sale is completed — but the tax work is only just beginning. The following points should not be forgotten after the notary appointment:

  • Plusvalía Municipal: The municipal land value increment tax is due independently of IRPF and must generally be declared with the relevant local authority within 30 days of the sale. The IRPF exemption does not protect against the Plusvalía.
  • 3 % retention for non-residents: If you are registered in the land registry but are not tax-resident in Spain, the buyer withholds 3 % of the purchase price and pays it to the AEAT (Modelo 211). As a resident, this does not apply.
  • IRPF declaration: The sale must be declared in the tax return (Modelo 100) for the calendar year of the sale — the submission deadline is generally by the end of June of the following year.
  • New primary residence: As soon as you move into the new property, register your Empadronamiento and ensure that the property is genuinely used as your primary residence.
  • Mortgage redemption: If there was still a mortgage on the sold property, this is generally redeemed at the notary. The redemption costs cannot reduce the transfer value.

Checklist: IRPF exemption on the sale of a primary residence

  • Three years of uninterrupted use as primary residence evidenced (Empadronamiento, electricity/water bills)
  • All improvement and acquisition ancillary costs since purchase compiled
  • Gain provisionally calculated (acquisition value vs. transfer value)
  • Aged over 65 at the time of sale? → Full exemption with no reinvestment required
  • Reinvestment intention documented and feasible within the two-year window?
  • New primary residence identified and purchase process initiated
  • Exemption code for Modelo 100 confirmed with gestoría or tax adviser
  • Plusvalía Municipal registered with the local authority within the deadline
  • All supporting documents kept securely for at least 4 years
  • Empadronamiento at new property applied for promptly

Conclusion

The IRPF exemption on the sale of a primary residence is real and significant — on a gain of several hundred thousand euros, it can reduce the entire tax liability to zero. But it does not apply automatically: you must actively meet the conditions, declare the exemption correctly, and observe deadlines meticulously. The 65+ rule in particular represents a once-in-a-lifetime opportunity for many Mallorca property owners to pass on one of their most valuable assets free of tax — provided the three-year requirement as a primary residence has been met. Anyone wishing to use the reinvestment exemption should begin planning well in advance and not rely on the "two years after the sale" window without a concrete new primary residence already in sight. A qualified gestoría or tax adviser (Abogado Fiscalista) in Mallorca is not a luxury here — it is an essential investment.

Official Sources

Do I need to declare the sale in my IRPF return even if I am fully exempt?
Yes. Even with full exemption, the sale must be declared in the tax return (Modelo 100) with the appropriate exemption code. Anyone who fails to declare the sale risks investigation and penalty surcharges from the AEAT.
Does the reinvestment exemption also apply to the purchase of a new primary residence in another EU country?
In principle, Spain recognises reinvestment in a primary residence within the EU and the EEA. However, the precise requirements should be checked with a tax adviser in advance, as providing proof to the AEAT is more involved in such cases.
I am 64 and selling in six months — is it worth delaying the sale until after my 65th birthday?
If you are 65 by the time of the notarial appointment and the three-year requirement as your primary residence is met, the full exemption applies without any reinvestment obligation. Postponing the sale date by a few months can therefore result in a significant tax saving — in most cases this is well worth doing.
What happens if I do buy the new property but never actually move in?
The exemption requires that the new property is genuinely used as your primary residence. If you buy a new property but rent it out or use it as a holiday home, the exemption is withdrawn retrospectively — the AEAT can demand the tax back, plus interest and, where applicable, penalties.
Can I use the exemption if my primary residence is registered under an SL?
No. The IRPF exemption for the primary residence applies only to natural persons (personas físicas). A property held through a company (SL) is subject to corporation tax (Impuesto de Sociedades), not IRPF. For more on this, see the guide on purchasing via an SL.
What documents do I need to prove the three-year period as my primary residence?
The AEAT typically accepts the following as evidence: an empadronamiento certificate from the municipal registration office, electricity, water and gas meter readings spanning the three years, bank statements showing direct debits from utility providers at the relevant address, and employment contract documents or medical certificates bearing that address.
Does the 65+ exemption also apply to the sale of a share I acquired through inheritance?
That depends on when you acquired the share and whether you have since met the three-year primary residence requirement. If you received the inherited share only a year ago and have been living there since then, the qualifying period is likely not fulfilled. Individual assessment by an abogado is essential here.
Does the IRPF exemption also protect against the Plusvalía Municipal?
No. The Plusvalía Municipal (the municipal tax on the increase in land value) is a separate tax and is calculated independently of IRPF. The IRPF exemption has no bearing on it. The Plusvalía must generally be declared to the local authority within 30 days of the sale.