1. The basic capital-gain formula
The capital gain (or loss) generated by the sale of a property is calculated under article 35 of Law 35/2006 (IRPF) using the following formula:
Where:
- Transfer value: what the seller actually obtains from the sale, after deducting the costs they bear.
- Acquisition value: what the buyer paid in their day for the property, including all costs inherent to the purchase, plus the improvements made, minus the depreciation if the property was let.
If the result is positive, there is a capital gain that will be taxed in the IRPF savings base. If it is negative, there is a capital loss that may be offset against the taxpayer's other gains in the following four tax years.
Gains and losses on transfers are offset against each other within the savings base; a negative balance may also offset up to 25% of the positive balance of income from movable capital of the same year, and the rest in the following four years (art. 49 LIRPF).
2. Transfer value: what it is and how to calculate it
The transfer value is the actual amount for which the property was sold, provided it is not lower than market value, in which case market value prevails (art. 35.2 LIRPF).
Sale price
The sale price is the one stated in the public deed of sale or, failing that, in the private contract. It includes any amount agreed to be paid to the seller, whether in cash, cheque, transfer or any other means of payment.
What if the declared price is lower than the real value?
If the Administration considers that the actual sale price was higher than the declared one (for example, through a value verification), the verified value will be taken. This is especially relevant in transactions between related parties or in property markets where market prices exceed declared ones.
3. Costs deductible from the transfer value
From the sale price, the costs and taxes inherent to the transfer paid by the seller are deducted. The result is the net transfer value.
| Cost | Deductible? | Notes |
|---|---|---|
| Tax on the Increase in Value of Urban Land (municipal plusvalía) | ✅ Yes, always | Only if the seller pays it. If passed on to the buyer contractually, it is not deductible for the seller. |
| Estate-agent commission | ✅ Yes | Only the part paid by the seller. Must be documented with an invoice. |
| Notary fees (deed of sale) | ✅ Yes, if paid by the seller | The seller may agree to bear the costs of the deed. If borne by the buyer, not deductible for the seller. |
| IBI for the year of sale | ❌ No | An ownership cost, not inherent in the transfer. |
| Mortgage cancellation costs at the Land Registry | ✅ Yes | Notary and registry of the deed of mortgage cancellation. |
| Valuation for mortgage cancellation | ⚠️ Debatable | The DGT does not always accept it. It is advisable to have the invoice and argue it is inherent to the transfer. |
| Community fees or outstanding levies borne by the seller | ❌ No | These are ownership costs, not inherent to the transfer. |
| 3% withheld by the buyer from non-resident sellers (IRNR) | ❌ No | It is a payment on account by the seller, not a transfer cost. |
Municipal plusvalía: when it is deductible and when it is not
The Tax on the Increase in Value of Urban Land (IIVTNU), known as the municipal plusvalía, has the seller as the taxpayer in onerous transfers. Therefore, in principle, the seller always pays it and it is always deductible from the transfer value for IRPF purposes.
However, in practice it is often agreed that the buyer pays it. In that case, the seller cannot claim the deduction in IRPF.
If the seller declares the municipal plusvalía but does not actually pay it (because of deferment), the law only allows it to be deducted once paid (art. 35.2 LIRPF), which may require amending the return.
The estate-agent commission
The DGT has confirmed in multiple binding rulings that the estate-agent commission paid by the seller is deductible from the transfer value, provided it is properly documented (invoice or equivalent).
"The transfer value shall be the actual amount for which the disposal was made. From this value, the costs and taxes referred to in letter b) of section 1 shall be deducted insofar as they are borne by the transferor."
On costs inherent in the sale see V1177-20 (registry cancellation of the mortgage and municipal plusvalía).
4. Acquisition value: all the components
The acquisition value is the price that the current seller paid in their day for the property, plus the purchase costs and the improvements made, less the depreciation if the property was let.
The purchase price
This is the one set out in the public deed of sale or equivalent document at the time of acquisition. If the property was inherited, the acquisition value is the value declared in the Inheritance Tax (capped at the market value on the date of death). If it was a gift, the value of the gift declared.
Monetary updating: does it still exist?
Before 2015, there were monetary update coefficients that corrected the effect of inflation on the acquisition value of properties. These coefficients were eliminated by Law 26/2014 with effect from 1 January 2015. From that year, the acquisition value of properties is no longer updated for inflation, which represents a tax penalty for long-term owners.
5. Costs included in the acquisition value
Art. 35.1.b) LIRPF allows the "costs and taxes inherent to the acquisition" paid by the acquirer to be included in the acquisition value. The full list is:
| Cost | Includable? | Notes |
|---|---|---|
| Transfer Tax (ITP) — for second-hand homes | ✅ Yes | The rate varies by autonomous community. |
| VAT — for new homes | ✅ Yes | Currently 10% for main residence (or 4% for social housing). |
| Stamp Duty (AJD) | ✅ Yes | Applies to new homes alongside VAT. Since 10 November 2018 (Royal Decree-law 17/2018), the bank pays it on mortgage loans, but if the buyer paid it in their day, it does count. |
| Notary fees (deed of purchase) | ✅ Yes | Those paid by the buyer at the time of purchase. |
| Land Registry registration fees | ✅ Yes | Registry fees for recording the purchase. |
| Agency fees | ✅ Yes | If an agency was hired for the purchase. |
| Property valuation (for the mortgage) | ⚠️ Debatable | It is a cost of the loan. |
| Mortgage opening commission | ⚠️ Controversial | A cost of the loan, not of the purchase. Better not to include it. |
| Mortgage loan interest | ❌ No | Interest is deductible under the main-residence deduction (transitional regime for acquisitions before 2013), but does not form part of the acquisition value. |
| Life insurance linked to the mortgage | ❌ No | Not a cost inherent to the acquisition of the property. |
| Community fees or IBI during ownership | ❌ No | These are maintenance or ownership costs, not acquisition costs. |
6. Improvements vs. repairs: a crucial tax distinction
Improvements made to the property during the ownership period increase the acquisition value, thus reducing the capital gain. However, repairs and maintenance costs are not included in the acquisition value, although they may be deductible if the property has been let.
What is an improvement for tax purposes?
The distinction between improvement and repair is one of the most contentious in tax practice. Generally:
| Item | Type | Effect on the gain | Examples |
|---|---|---|---|
| Works that increase the surface area or built volume | Improvement | Increases acquisition value | Extension of the flat, building a terrace, enclosing a balcony |
| Works that add new previously non-existent elements or installations | Improvement | Increases acquisition value | Installation of air conditioning, heating where there was none, new lift |
| Refurbishment works that permanently improve the quality or category of the property | Improvement (depending on the works and the evidence) | Increases acquisition value | Full kitchen or bathroom refurbishment with higher-quality materials; full renewal of installations |
| Replacement of damaged elements with equivalent ones | Repair/maintenance | Does not count (unless let) | Replacing a broken boiler, repairing existing heating, painting the walls |
| Ordinary maintenance | Maintenance | Does not count | Painting, replacement of small appliances, minor plumbing repairs |
Improvements and repairs: the criterion
In general, improvements are works that increase the capacity or habitability of the property or lengthen its useful life; repairs and maintenance preserve normal use or correct damage.
How each job is classified depends on invoices and evidence.
The practical problem: mixed works
In practice, many works are "mixed": they contain both improvement and repair elements. In these cases, the DGT requires the taxpayer to differentiate in the invoice or in the works documentation what part corresponds to improvement (countable) and what part to repair (non-countable). If it is not possible to distinguish, the AEAT may reject all of the works as an improvement.
When are improvements added to the acquisition value?
Improvements are added to the acquisition value in the year they are carried out. If depreciation is taken on the improvements (because of letting), it is also deducted from the acquisition value.
7. Depreciation if the property was let
If the property was let at any time during the ownership period, depreciation must be subtracted from the acquisition value when calculating the capital gain: at least the minimum depreciation, even if you never deducted it (art. 40.1 RIRPF).
The "minimum deducted" rule
Article 35.1 of the Act refers to the Regulation, which takes the minimum depreciation into account whether or not it was deducted (art. 40 RIRPF). For let properties, the Supreme Court held in judgment 1502/2025, of 20 November (appeal 7361/2023, ROJ STS 5416/2025), that a landlord with income from immovable capital need not apply the maximum 3 % depreciation and may apply the minimum when calculating acquisition value.
Minimum depreciation is always taken into account (art. 40.1 RIRPF).
Calculating depreciation on let properties
Deductible depreciation on a let property is 3 % of the higher of acquisition cost or cadastral value, excluding the land. The example uses that rate; under the judgment cited, minimum depreciation may be considered.
8. Reduction coefficients: transitional regime for properties acquired before 31/12/1994
For properties acquired before 31 December 1994, there is a transitional regime (ninth transitional provision of the LIRPF) allowing reduction coefficients to be applied to the part of the gain generated before 20 January 2006. This regime reduces the taxation of gains accumulated over many years of ownership.
Conditions of the transitional regime
- Only for assets acquired before 31 December 1994.
- Cumulative limit: the regime only applies to the part of the gain corresponding to the period from acquisition to 19 January 2006. The gain after that date is taxed without reduction.
- The regime applies while the total transfer values to which it has been applied since 1 January 2015 do not exceed €400,000; a sale that crosses the limit benefits in proportion. Sales before 2015 do not count.
Reduction coefficients for properties
For real estate, the part of the gain before 20 January 2006 is reduced by 11.11 % for each year of ownership over two. Ownership is counted in years from acquisition to 31 December 1996, rounded up. This means that:
- If ownership at 31 December 1996 exceeded ten years, that part of the gain is not taxed.
- Otherwise the reduction depends on the number of years.
Calculation formula with reduction
The calculation procedure is:
- Calculate the total gain: Transfer value − Acquisition value.
- Divide the gain into two parts:
- Part 1: Gain generated up to 19/01/2006 = Total gain × (days from acquisition to 19/01/2006 / total days from acquisition to transfer).
- Part 2: Gain generated from 20/01/2006 = Total gain − Part 1.
- On Part 1, reduce by 11.11 % for each year of ownership over two.
- Part 2 is taxed in full without reduction.
Interaction with the reinvestment exemption
They are compatible. The DGT sets the order in V2227-23: first the part exempt through reinvestment, then the reduction on the non-exempt gain. The reinvested part of the transfer value that gives rise to the exemption does not count towards the €400,000 limit.

9. 2025 IRPF savings tax scale: rates applicable to the capital gain
The capital gain from the sale of properties is taxed in the IRPF savings taxable base, which has its own scale of progressive rates. For the 2025 tax year, the scale is:
| Savings net taxable base | Marginal state + regional rate | Cumulative effective rate |
|---|---|---|
| Up to €6,000 | 19% | 19% |
| From €6,000 to €50,000 | 21% | 19% up to €6,000 + 21% on the excess |
| From €50,000 to €200,000 | 23% | Cumulative for previous brackets + 23% on excess |
| From €200,000 to €300,000 | 27% | Cumulative + 27% on excess |
| Over €300,000 | 30% | Cumulative + 30% on excess |
Tax payable on different gains
| Capital gain | Approximate IRPF charge | Effective rate |
|---|---|---|
| €20,000 | €4,080 | 20.4% |
| €50,000 | €10,380 | 20.8% |
| €100,000 | €21,880 | 21.9% |
| €150,000 | €33,380 | 22.3% |
| €200,000 | €44,880 | 22.4% |
| €300,000 | €71,880 | 24.0% |
| €500,000 | €131,880 | 26.4% |
10. Practical example 1: standard case with no incidents
Case data
- Property acquired in 2010 for €220,000
- Purchase costs: ITP (8%) = €17,600; notary = €900; registry = €400; agency = €350. Total purchase costs: €19,250
- Improvements made in 2018: full refurbishment of kitchen and bathrooms = €18,000
- The property was never let
- Sale price in 2025: €380,000
- Sale costs: municipal plusvalía = €4,200; agency commission = €7,600; notary (borne by seller) = €600
Calculation
| Item | Amount |
|---|---|
| Sale price | €380,000 |
| Less: municipal plusvalía | − €4,200 |
| Less: agency commission | − €7,600 |
| Less: notary (borne by seller) | − €600 |
| = Net transfer value | €367,600 |
| Purchase price (2010) | €220,000 |
| Plus: purchase costs | + €19,250 |
| Plus: improvements (2018) | + €18,000 |
| Less: depreciation | €0 |
| = Acquisition value | €257,250 |
| CAPITAL GAIN | €110,350 |
Tax payable (without the reinvestment exemption)
- First €6,000: 6,000 × 19% = €1,140
- From €6,000 to €50,000 (€44,000): 44,000 × 21% = €9,240
- From €50,000 to €110,350 (€60,350): 60,350 × 23% = €13,880.50
- Total IRPF: €24,260.50
11. Practical example 2: property with letting and improvements
Case data
- Property acquired in 2005 for €150,000 (of which €40,000 corresponds to land)
- Purchase costs: ITP (7%) = €10,500; notary + registry + agency = €1,800. Total purchase costs: €12,300
- Let for 6 years (2009–2015): depreciation of 3% on €110,000 (construction value) = €3,300/year × 6 years = €19,800 cumulative depreciation
- Improvements made in 2016: installation of central heating and bathroom refurbishment = €22,000
- Sale price in 2025: €290,000
- Sale costs: municipal plusvalía = €3,800; agency = €5,800. Total sale costs: €9,600
Calculation
| Item | Amount |
|---|---|
| Sale price | €290,000 |
| Less sale costs | − €9,600 |
| Net transfer value | €280,400 |
| Purchase price | €150,000 |
| Plus purchase costs | + €12,300 |
| Plus improvements (2016) | + €22,000 |
| Less cumulative depreciation | − €19,800 |
| Acquisition value | €164,500 |
| CAPITAL GAIN | €115,900 |
Tax payable (without exemption)
- 6,000 × 19% = €1,140
- 44,000 × 21% = €9,240
- 65,900 × 23% = €15,157
- Total IRPF: €25,537
12. Practical example 3: property acquired before 1994 with reduction coefficients
Case data
- Property acquired on 1 March 1990 for €30,000 (converted from pesetas)
- Purchase costs in 1990: €2,500
- Sale price in October 2025: €320,000
- Sale costs: €8,000
- No letting or significant improvements
- The taxpayer has not sold other assets with reduction since 2015, so the full €400,000 limit is available
Step 1: Calculation of the total gain
- Net transfer value: 320,000 − 8,000 = €312,000
- Acquisition value: 30,000 + 2,500 = €32,500
- Total gain: 312,000 − 32,500 = €279,500
Step 2: Temporal split of the gain
- Days from acquisition (01/03/1990) to transfer (01/10/2025): 12,998 days
- Days from acquisition (01/03/1990) to 19/01/2006: 5,803 days
- Gain up to 19/01/2006 (Part 1): 279,500 × (5,803 / 12,998) = €124,784
- Gain from 20/01/2006 (Part 2): 279,500 − 124,784 = €154,716
Step 3: Application of the reduction coefficient on Part 1
Ownership to 31/12/1996: 6 years and 10 months, rounded up to 7. Years over two: 5. Reduction: 5 × 11.11 % = 55.55 %.
- Reduction on Part 1: 124,784 × 55.55% = €69,317
- Reduced Part 1 (taxable): 124,784 − 69,317 = €55,467
- Part 2 (taxable in full): €154,716
- Total gain subject to IRPF: €210,183
Tax payable without the reinvestment exemption
- 6,000 × 19% = €1,140
- 44,000 × 21% = €9,240
- 150,000 × 23% = €34,500; 10,183 × 27% = €2,749
- Total IRPF: €47,629
13. DGT 2025 doctrine: relevant binding rulings
Order between reinvestment and reduction coefficients
V2227-23: first the exemption, then the reduction.
Costs inherent in the sale
V1177-20: those directly related to the purchase or sale, including the registry cancellation of the mortgage and the municipal plusvalía.
14. Common mistakes in calculating the capital gain
15. Conclusion: why prior calculation is fundamental
Accurate calculation of the capital gain is the starting point for any tax planning around the sale of a main residence. Without knowing the exact amount of the gain, you cannot:
- Determine the potential tax saving with the reinvestment exemption.
- Correctly calculate the minimum reinvestment needed for full exemption.
- Assess whether it is worth reinvesting or absorbing the tax cost.
- Plan the sale at the most favourable moment (especially with reduction coefficients and the €400,000 limit).
Tell us your case
Official sources
- Law 35/2006, IRPF — Art. 35 (transfer and acquisition value)
- Law 35/2006, IRPF — Ninth Transitional Provision (reduction coefficients)
- RD 439/2007, RIRPF — Art. 41
- DGT V1177-20 — Costs inherent in the sale
- DGT V2227-23 — Reinvestment and the ninth transitional provision
Working out your taxable gain in Spain
How do I calculate the capital gain on my Spanish home?
Subtract the acquisition value from the transfer value. The acquisition value is the purchase price plus purchase costs and improvements, less depreciation if the home was let. The transfer value is the actual price less the sale costs and taxes that you, as seller, paid.
Is the municipal plusvalía deducted when calculating my income tax gain?
Yes, if you as the seller paid it: it reduces the transfer value. If you agreed with the buyer that the buyer would pay it, you cannot deduct it. The same logic applies to the estate-agent commission, which needs an invoice and counts only for the part you paid.
Does Spain adjust my purchase price for inflation when I sell?
No. Monetary update coefficients for property were abolished with effect from 1 January 2015, so your nominal purchase price is used. The only surviving relief of that kind is the transitional regime for property acquired before 31 December 1994, subject to a €400,000 limit on accumulated sale prices.
I rented out the home for a few years. Does that change the gain?
Yes. Depreciation from the letting period reduces the acquisition value and therefore increases the gain. At least the minimum depreciation is taken into account even if you never claimed it in your returns (article 40.1 of the Regulation).
Last reviewed: 1 October 2025. General information on Spanish law in force; it does not replace advice on your specific case.
Further reading
