Table of Contents
Updated September 17, 2025. This article summarizes state criteria (AEAT/BOE). Please check for any specific regional regulations and municipal ordinances.
Example: A Dutch national who sells his home in Spain, which is his primary residence, and invests the proceeds in the purchase of a primary residence in Amsterdam , Holland.
Professional notice This guide is for informational purposes only. The improvement vs. repair classification and the application of exemptions require a case-by-case analysis (facts, licenses, bills, deadlines, actual use as a primary residence, etc.).
Scenario 1 · Natural person resident in Spain who sells their habitual residence
The profit from selling your primary residence is exempt if you reinvest the entire amount obtained in acquiring or renovating your new primary residence . If you reinvest only a portion , the exemption is proportional.Taxes involved
- Personal Income Tax (capital gains based on savings) : rates 19%–30% depending on current brackets.
- IIVTNU (Municipal Capital Gains Tax) : according to the city council ordinance; the most favorable method (real or objective), if applicable.
Key exemptions and bonuses
- Exemption for reinvestment in a primary residence : There is a full exemption if you reinvest the entire amount obtained (not just the profit) in purchasing or renovating your new primary residence within the two years before or after the sale. If you reinvest only “part” of the sale proceeds, the exemption is proportional.
- People over 65 years of age or severely dependent/highly dependent : total exemption from the gain when transferring the habitual residence (no reinvestment required).
- Assets acquired before 31/12/1994 : possible reduction by abatement coefficients on the portion of the gain generated up to 19/01/2006, with a joint limit of €400,000 for transfer values from 2015.
- Loss offset : Savings losses from past/next fiscal years can offset gains (with limits and time windows).
- The outstanding principal amount of the mortgage is allowed as a deduction . That is, if there is outstanding principal on the mortgage of the sold property, this amount may reduce the profit obtained from the sale if reinvested in a primary residence.
Expenses/costs that reduce profit
(added to the acquisition value or reduce the transfer value):- Purchase : ITP/AJD or VAT on acquisition, notary, registration, management, legal fees, appraisal.
- Investments and improvements (not repairs; see exhaustive list below).
- Sale : agency fees, notary/registry fees for mortgage cancellation and early cancellation fees if linked to the sale, energy efficiency certificate, required certificates and bonds, and attorney fees.
Municipal capital gains tax (IIVTNU)
- Exempt if there is no increase in land value. If there is, you can choose the actual method (difference between values) or the objective method with coefficients; the lower is paid .
Exact deadlines
- Time window: you can reinvest in one or more transactions within 2 years before or after the sale ( counted from date to date ).
Reinvestment is allowed successive .
In installment sales, reinvesting each collection within the fiscal year in which it is received is also accepted.- Forgetting to file your tax return: If you met the requirements for exemption but didn’t mark it on your tax return, the TEAC has established that you can request rectification within 4 years (this isn’t an “option” that you lose).
What cases are included as reinvestment in primary residence?
- Purchase of a new home that you must use as your primary residence , and that you must live in permanently within 12 months of purchase or completion of construction, and maintain as your primary residence; general rule: 3 years of residence, unless there are justified reasons for moving.
- Renovation of what will be your new primary residence . For the purposes of this exemption, renovation is considered an acquisition if any of these criteria are met (AEAT summary):
- Reconstruction by consolidation and treatment of structures, facades or roofs ; or
- That the overall cost of the works exceeds 25% of the purchase price (if you purchased within the two years prior to the start of the works) or, otherwise, the market value at the start of the works.
- Construction of a new home: This is permitted if the work is completed within four years of the start date (TS doctrine) and ownership is acquired.
- External financing: You can finance the purchase; the exemption does not require that the reinvested money be the same as the sale price. To measure whether the reinvestment is total or partial , the AEAT allows the “total amount obtained” to be calculated as the sale value less the outstanding mortgage principal on the sold property (as above).
Proportionality (if you don’t reinvest everything)
- Exemption = profit × (reinvested amount / total amount earned) . The remainder is taxed at the savings rate.
- Definition: The taxpayer’s effective and permanent residence has been in place for three consecutive years (with exceptions based on necessity: relocation, separation, employment, etc.). The sale must have been habitual at the time of the sale or have been habitual on any day during the previous two years .
Very frequent clarifications
- “Purchased within two years” or “structurally renovated”? That’s right, both are valid : you can buy the new one or renovate it (using the technical renovation criteria above) within two years (or have done so within the two years prior to the sale).
- What if I first pay off the mortgage on the old home with the sale price? To measure whether the reinvestment is complete , the AEAT (Tax Agency) allows the “total amount obtained” from the sale to be considered the outstanding principal of the mortgage on the sold home. This softens the requirement when the majority of the price “goes” to paying off the debt.
- What if I buy off-plan or build? It’s fine, but the work must be completed within four years of the start date , and the home must become your permanent residence.
- Installment sale? It’s considered installment if you allocate each payment to reinvestment during the period in which you receive it.
- Did I forget to mention the tax exemption? You can correct your self-assessment for up to four years if you met the requirements and reinvested on time ( TEAC criteria unifying doctrine).
Mini- documentary checklist (to avoid requirements)
- Deeds of sale and purchase / construction contract and certificates (completion of work/license if you are renovating or building).
- Proof of habitability (registration/consumption) and entry within 12 months .
- Payment schedule if there are installments / new mortgage .
- Expense and tax settlements and, if applicable, proof of the outstanding principal of the old mortgage on the date of transfer.
- For non-EU/EEA residents : Form 211 (3% withholding) and Form 210 ; if applicable, Form 228 for refunds.
Exemption for the sale of a primary residence applicable to the purchase of a primary residence in another EU/EEA country.
Who can apply?
Taxpayers residing in the EU or EEA (with mutual assistance in the exchange of information) who sell their former primary residence in Spain and reinvest the total proceeds in another primary residence (the new one can be located outside of Spain).Example: A Dutch national who sells his home in Spain, which is his primary residence, and invests the proceeds in the purchase of a primary residence in Amsterdam , Holland.
- Exemption for reinvestment in a primary residence for EU/EEA residents (with information exchange), when the transferred residence was their primary residence in Spain and is reinvested in a new primary residence (same deadlines and proportionality).
- Pre-1994 abatement (with the same rules and an aggregate limit of €400,000).
Practical keys
- What is reinvested: the total amount obtained from the sale (see calculation below). If it is partial , the exemption is proportional .
- Term: Reinvestment can be made within 2 years after or 2 years before the sale (counted “from date to date”).
- Proof of “main residence” (for the one sold in Spain and the new one): effective and permanent residence (in the one sold, whether it was at the time of the sale or has been at any time in the previous two years ). The 3-year residence rule applies, with exceptions (job transfers, etc.).
- Processing/retention: In the event that the seller is NOT A TAX RESIDENT IN SPAIN , the buyer must retain 3% (Form 211 ).
The seller must present Form 210 regularizing:
- If there is total exemption, the profit will be 0 ;
- If it is partial, only the non-exempt part is taxed.
- If the reinvestment is made after filing Form 210, a refund can be requested using Form 228 .
Scenario 2 · Natural person resident in Spain who sells a second home
Taxes involved
- IRPF (savings) and IIVTNU as in scenario 1.
Key differences
- does not apply (unless the home sold was your primary residence and you meet the requirements, which is not the case with a second home).
- Maintained: pre-1994 abatement (if applicable), acquisition/sale expenses, improvements and choice of the most favorable method in IIVTNU.
Scenario 3 · Non-resident individual selling a home in Spain
Taxes involved
- IRNR (capital gain ) : separate taxation by transaction . General rate: 19% on profit (criterion 2025).
- 3% Withholding : The buyer withholds and pays 3% of the price (Form 211). The seller files Form 210 to adjust: this withholding is deducted; if it exceeds the amount, it is refunded.
- IIVTNU : same as residents (subject to the transmitter).
Computable costs
- Same rules as in Personal Income Tax: Expenses and taxes on acquisition/sale and investments and improvements as in the case of sales by Residents in Spain.
Depreciation counts!
Be careful with amortizations if it was rented: they reduce the acquisition value. When we calculate the capital gain on a sale, it is done like this: Gain = Transfer value − Acquisition value (adjusted) Well, if the property was rented and tax depreciations were applied to the declarations (resident personal income tax or non-resident non-resident income tax) , these depreciations reduce the acquisition value . In other words, the more you have deducted for amortization, the greater the future profit when you sell . 🔹 Practical example (resident in Spain)- Purchase of home (expenses included): €200,000
- Rented property for 10 years. Each year, a 2% depreciation deduction was applied to the greater of the (construction cadastral value or cost). Let’s assume €2,000/year .
- Total amortized: 2,000 × 10 = €20,000
- Adjusted acquisition value = 200,000 − 20,000 = €180,000
- Sale for €300,000
- Profit = 300,000 − 180,000 = €120,000 (instead of €100,000 if it had not been rented).
- In each fiscal year, the AEAT allows deductions for expenses (including 3% annual amortization on construction costs).
- This amortization, even if you have not deducted it (through forgetfulness), will still reduce the acquisition value in the future sale (“minimum amortization required”).
- Thus, the Treasury does not allow “the best of both worlds” (deducting now and keeping the value high later).
- Minimum depreciation required : even if you didn’t apply it, the AEAT still deducts it . In other words, it’s no good “forgetting” to reduce your profit later.
- Documentation : It is advisable to keep the depreciation data applied in previous tax returns carefully to balance the profit calculation.
- Tax impact : If you have rented your apartment for many years, the taxable income may increase significantly compared to what you would intuitively expect.
- If it was rented → the deductible amortization lowers the acquisition value .
- This increases the profit when selling, both in IRPF (residents) and IRNR (non-residents).
Scenario 4 · Non-resident foreign company selling a home in Spain
Taxes involved
- IRNR :
- Without a permanent establishment (PE) : the profit is taxed as non-resident income tax (reference rate 19%); the buyer is required to withhold 3% (Form 211) and file a self-assessment (Form 210).
- With EP : it is assimilated to Corporate Tax for the net profit attributable to the EP.
- IIVTNU : in charge of the transmitter.
Computable costs
- Same general rules: acquisition and transfer expenses/taxes and investments and improvements .
Special tax of 3% (Form 213) per year, for certain non-EU/EEA resident entities that own real estate in Spain.
🔹 What is it- It is regulated in Article 40 et seq. of the TRLIRNR (Revised Text of the Non-Resident Income Tax).
- This is an annual tax of 3% of the cadastral value of urban properties owned in Spain by a non-resident entity .
- It is settled using Form 213 , which is submitted every January with respect to the situation as of December 31 of the previous year.
- Non-resident foreign companies that own urban real estate in Spain.
- The tax is levied on the ownership of the property, not on the income or profit from its sale.
- It’s like a tax “penalty” to prevent shell companies from holding real estate in Spain without paying taxes here.
- Entities with tax residence in EU or EEA countries with effective exchange of tax information. This does not apply to EU/EEA companies.
- Foreign entities that carry out an effective economic activity in Spain related to the property (for example, a hotel, premises in actual operation, offices).
- Foreign entities listed on regulated markets in the EU/EEA.
- foreign public law entities .
- Non-profit entities recognized as such.
- A British Virgin Islands company owns an apartment in Marbella, but has no economic activity in Spain.
- Cadastral value = €400,000
- Special tax = 3% × €400,000 = €12,000 per year to be paid each January (Form 213).
- If, on the other hand, the company is German (EU) and proves tax residence in Germany, it is exempt .
- If the company is from a country with an agreement but outside the EU/EEA (e.g., the US ), it may be subject to the agreement unless it can demonstrate that it uses it in a real economic activity in Spain.
- This tax is independent of the taxation of the sale (IRNR + 3% withholding Form 211).
- The company must pay it every year while it owns the property .
- When the property is sold, the obligation for subsequent years is extinguished, but the Treasury usually checks whether Form 213s from previous years have been filed.
Scenario 5 · Spanish company selling a home
Taxes involved
- Corporate Tax : general rate 25% on the accounting profit adjusted for tax purposes (includes the accounting capital gain from the sale, less any negative carryforwards, reserves, etc.).
- IIVTNU : subject to the transmitter if there is an increase in the land value; choice of the most favorable method.
Useful notes
- There is no general exemption for reinvestment of real estate capital gains in the IS (state regime), although incentives such as capitalization or leveling reserves and compensation of BINs may be implemented .
Which works and renovations DO usually count as improvements (they increase the acquisition value)
Key: They must increase the property’s capacity, habitability, useful life , or efficiency . Keep complete invoices (with VAT, issuer and recipient tax identification numbers), traceable payment methods , and, if applicable, building permits/notifications and certificates .Extensions and redistributions
- Close and integrate terraces legally, gaining useful surface area .
- Comprehensive redistribution that creates new rooms or improves accessibility/functionality.
Structure and covering/façade
- Foundation/floor reinforcements , roof replacement with structural improvements .
- Thermal insulation (SATE, blown-in chambers, cladding), double/triple glazing and high-performance carpentry .
- Soundproofing (certified acoustic improvements).
Facilities (when they represent a qualitative leap)
- Comprehensive renovation of electricity (panel, sections, circuits, protections) and plumbing/sanitation .
- High-efficiency air conditioning : aerothermal , geothermal , radiant/cooling floor , heat recovery.
- Renewable energy : photovoltaic and solar thermal with connection and infrastructure.
- Home automation and structured cabling that increase performance and efficiency.
Accessibility and safety
- Installation of elevators or stair lifts (community and individual), lifting platforms.
- Armored doors , fire protection systems, and approved security improvements.
Kitchens and bathrooms (integral)
- Comprehensive renovations with changes to the facilities and improvements in quality/functionality (not just tiling/aesthetic replacement).
Community works passed on to the owner (proportional to his/her share)
- New elevator , facade renovation (including SATE), structural improvements , waterproofing with increased lifespan.
Usual acquisition and transmission costs that do count
Acquisition- Taxes: ITP/AJD (or VAT on first delivery); fees.
- Notary , Registry , agency , lawyer , API , appraisal .
- Real estate agency fees (if paid by the seller).
- Notary/Registry for mortgage cancellation , early cancellation fee , related agency.
- Energy efficiency certificate , certificates/identifications required by regulations.
- Other necessary and duly justified expenses.
Checklist (before selling)
- Identify your scenario (resident/non-resident/society) and applicable taxes .
- Check if you can apply for a reinvestment exemption or an exemption for those over 65 (if it is a primary residence).
- Check the abatement (acquired before 31/12/1994) and control the aggregate limit of €400,000 .
- Order a simple note , property tax receipts , cadastral value , and request a capital gains simulation using both methods.
- Gather invoices and receipts for improvements and expenses (purchase/sale/mortgage cancellation/certificates).
- If you are a non-resident , plan for Model 210 and the 3% withholding (Model 211) .
- If you are a company , review the effects on IS (compensation of BINs , reserves, impairments, etc.).
Frequently Asked Questions
Can I add the cost of painting and minor repairs?
No. They are repairs and maintenance . Only improvements and investments increase the acquisition value.And what about replacing windows or installing ETICS?
Normally yes (improved efficiency and habitability), with invoices and, if applicable, an energy certificate proving the efficiency increase.Does mortgage cancellation qualify as a tax deduction for the sale?
The outstanding balance is n’t an expense; however , the fees and costs required to cancel it (notary, registry, agency fees, etc.) are usually included when they are linked to the transfer.If I reinvest only a portion of the tax into my new primary residence, what happens?
The exemption applies proportionally to the amount reinvested relative to the total amount obtained from the sale.Professional notice This guide is for informational purposes only. The improvement vs. repair classification and the application of exemptions require a case-by-case analysis (facts, licenses, bills, deadlines, actual use as a primary residence, etc.).