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.

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?
- 📩 Submit a personal enquiry — individual tax assessment by an experienced gestoría
- An overview of all taxes on property sales
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.
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
- Check the tax requirements: Has the minimum period of use been reached? Are you over 65? Is reinvestment a realistic possibility?
- 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.
- 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).
- 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.
- 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).
- Registering the new main residence as such: Complete the empadronamiento in the new municipality within twelve months of purchase or occupation.
- 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
- Law 35/2006 (LIRPF) – Artikel 33 (tax exemptions), Artikel 34–35 (calculation of gains), Artikel 38 (reinvestment exemption): https://www.boe.es/buscar/act.php?id=BOE-A-2006-20764
- Royal Decree 439/2007 – Artikel 41 (implementing provisions on reinvestment): https://www.boe.es/buscar/act.php?id=BOE-A-2007-6820
- AEAT – Agencia Estatal de Administración Tributaria (forms, guidance notes, Modelo 100): https://www.aeat.es
- ATIB – Agència Tributària de les Illes Balears (Balearic tax matters): https://www.atib.es