Imagen editorial sobre Ganancia patrimonial al vender una vivienda en España

Capital gain on selling a property in España

Seller taxation · Capital gain

The tax is not calculated simply by subtracting the purchase price from the sale price.

To determine the capital gain on a property in España the acquisition value and the transfer value must be calculated correctly . Purchase taxes and costs, investments and improvements, certain selling costs and depreciation on a rented property can materially affect the tax outcome.

Last updated: 9 August 2026 España · IRPF / IRNR SELL-005 · P0
Quick answer

The capital gain or loss from a property sale is generally determined by the difference between the transfer value and the acquisition value. The acquisition value may include the purchase price, investments and improvements, and certain costs and taxes inherent to the acquisition, excluding interest, and must be reduced by depreciation where applicable. The sale value may be reduced by certain costs and taxes inherent to the transfer that have been paid by the seller. Next, it must be determined whether the seller is taxed under Personal Income Tax (IRPF) as a resident or under Non-Resident Income Tax (IRNR) as a non-resident and whether any exemption or special regime applies.

IRPF

Resident seller

The gain arising from the transfer of the property is generally included in the savings tax base for IRPF purposes.

IRNR

Non-resident seller

The gain from a property located in España may be subject to IRNR even if the owner lives outside the country.

IMP

Improvements

Documented investments and improvements may increase the acquisition value. An improvement should not be confused with any repair.

DEP

Depreciation

If the property was rented out or used for business activities, depreciation may reduce the tax acquisition value.

Tax formula

Capital gain = transfer value − acquisition value

The IRPF Law establishes this general rule for property transfers. The seemingly simple calculation depends on correctly determining both values.

Transfer value Sale price − eligible seller expenses and taxes
Acquisition value Purchase + improvements + expenses/taxes − depreciation
=
Outcome Capital gain or loss
The outstanding mortgage is not deducted in this calculation.

The balance you still deba to the bank affects the net amount you receive on sale, but does not in itself reduce the capital gain. Mortgage debt may be relevant under specific rules, for example, when determining the amount obtained for the purposes of the main residence reinvestment exemption.

Acquisition value

The tax basis of a property may be higher than the price stated in the purchase deed

For a purchase for consideration, the Personal Income Tax Act adds certain investments, improvements, costs and taxes to the actual acquisition amount paid by the person who acquired the property.

Component General treatment Notes
Acquisition price Added. Actual amount paid to acquire the property in a purchase for consideration.
ITP / IVA / AJD on acquisition May form part of the acquisition value. These must be taxes inherent to the acquisition and paid by the person who acquired the property.
Notary and Land Registry costs on acquisition May be included. To the extent that they are costs inherent to the acquisition and have been paid by the buyer.
Investments and improvements Added when they qualify as such for tax purposes. They must be substantiated and distinguishable from ordinary maintenance and repairs.
Mortgage interest Does not increase the acquisition value under this rule. Article 35 expressly excludes interest from expenses and taxes that form part of the acquisition value.
Depreciation These reduce the value where applicable. Especially important if the property was rented out or used for an economic activity.

Building works and renovations

“I spent 40.000 € on renovations” does not automatically mean you can add 40.000 € to the acquisition value

The regulations distinguish investments or improvements from maintenance and repair costs. The classification depends on the specific nature of the work, not solely on the amount shown on the invoice.

  • Keep complete invoices and proof of payment.
  • Identify which work increased capacity, habitability, floor area or features.
  • Separate routine maintenance from a genuine investment or improvement.
  • Keep permits and technical documentation where applicable.
  • If there were several improvements in different years, keep the date of each one.

Transfer value

For the tax authorities, the sale price and transfer value are not necessarily identical either

The transfer value is based on the actual sale amount. From this, the costs and taxes inherent to the transfer that have been paid by the seller are deducted.

+

Actual sale amount

The actual consideration is used as the starting point, provided it is not lower than the normal market value under the terms of the law.

Inherent costs

Certain costs directly linked to the transfer and paid by the seller may reduce the transfer value.

TAX

Transfer taxes

Taxes inherent to the transfer paid by the transferor may be included in this reduction when they meet the requirements.

Municipal capital gains tax and capital gains tax are different taxes.

The fact that a municipal tax may be a deductible component within the tax calculation of the capital gain does not make the two taxes the same obligation. IIVTNU must be analysed separately according to the municipality and circumstances.

Property that was rented out

Depreciation may increase future taxable capital gains

When a property was rented out and depreciation was tax deductible, the acquisition value used on sale must be reduced by the corresponding depreciation amounts.

  • It is not enough to recover the original purchase price.
  • The rental's tax history may alter the acquisition value.
  • Minimum depreciation may be taken into account in the applicable cases.
  • Keep income tax returns from the rental years.
  • Separate the land value from the building value when the calculation requires it.

Inheritance and gifts

If you did not purchase the property, the acquisition value is determined differently

When the acquisition was free of charge tui—for example, through inheritance or a gift— IRPF rules refer to the values resulting from the regulations governing Inheritance and Gift Tax, within the legal limits, after which the other applicable components are included.

ISD

Acquisition value

The starting point is the value determined under the rules for Inheritance and Gift Tax, without exceeding the market value under the legal provisions.

+

Expenses and taxes

Expenses and taxes inherent to the acquisition may be added provided they were paid by the acquirer.

IMP

Subsequent improvements

Investments and improvements made after inheriting or receiving the property may be relevant to the calculation.

Tax-resident seller

As a general rule, the gain on the property is included in the savings tax base for IRPF purposes

The currently applicable scale for the taxable savings base, after adding the established state and regional components under the IRPF Law, uses the following marginal rates.

Up to 6.000 €
19%
6.000 € – 50.000 €
21%
50.000 € – 200.000 €
23%
200.000 € – 300.000 €
27%
More than 300.000 €
30%
Do not multiply the entire gain by the highest bracket it reaches.

The scale is progressive. In addition, the gain on the property should not necessarily be assessed in isolation from the other gains, losses and income included in the taxpayer's savings tax base. For this reason, the final tax liability cannot be calculated correctly using only the purchase and sale price.

Important exemptions

Calculating a gain does not necessarily mean that all of it will be taxed

The IRPF Law provides for specific exemption scenarios. The requirements must be checked before assuming that a sale is exempt.

65+

Over 65 years of age

The gain obtained by a person over 65 years of age on the transfer of their main residence may be exempt under Article 33 of the Personal Income Tax Act.

There is also an exemption for persons in a situation of dependency severa or severe dependency under the legal provisions.

RE

Reinvestment in a main residence

The gain obtained on transferring the main residence may be fully or partially exempt when the amount received is reinvested in another main residence within the legal conditions and time limits.

Reinvestment may be made within the statutory period covering the two years before or after the transfer.

PART

Partial reinvestment

If less than the full amount required by the rule is reinvested, the tax exemption applies only to the proportional part of the corresponding gain.

“Main residence” has a tax definition.

As a general rule, the law requires continuous residence for three years, although it provides for circumstances that may allow the property to retain its status as a main residence before that period has elapsed. For certain exemptions, the regulations also include specific rules on when a property retains that status after it has ceased to be occupied as a residence.

Non-resident seller

For a non-resident individual, the gain on a Spanish property is currently taxed at 19%

The AEAT generally determines the gain by applying the rules of IRPF to calculate the difference between the transfer value and the acquisition value. The currently published rate for this property gain is 19%.

  • The adjusted acquisition value is calculated.
  • The transfer value is calculated net of allowable expenses.
  • The positive difference constitutes the taxable gain.
  • The transfer is declared using Form 210.
  • The withholding made by the buyer must be taken into account.
Non-residents: there is an important exception for certain reinvestments.

The AEAT provides for an exemption for reinvestment in a main residence for certain taxpayers resident in another Member State of the European Union or the European Economic Area within the applicable legal framework. The transferred property must have been the main residence in España and the reinvestment requirements must be met. The withholding of 3% and the formal obligation to declare the transfer continue to apply in accordance with the relevant procedure.

Older properties

A property acquired before 31 December 1994 may require a special calculation

There is a transitional regime of reduction or tapering coefficients for certain assets acquired before 31 December 1994. It does not automatically reduce the entire gain.

<94

Acquisition date

The acquisition must fall within the time period established by the transitional regime.

2006

Portion eligible for reduction

Only the portion of the gain generated up to 19 January 2006 may be eligible for a reduction.

400K

Cumulative limit

The regime is subject to a 400.000 € limit relating to transfer values eligible for the reduction from 1 January 2015.

Do not apply an abatement percentage to the entire gain.

The calculation requires separating the periods over which the gain was generated and tracking prior transfers that use up the limit and, where improvements exist, treating the relevant dates separately.

Simplified example

From a sale for 350.000 € to a taxable gain of 90.000 €

Example for illustrative purposes only. It is assumed that the property was never rented out, that no transitional regime applies, and that all expenses and improvements used are tax-deductible and documented.

Item Amount Effect
Price paid at purchase 200.000 € Acquisition value
Eligible acquisition taxes and expenses 20.000 € Added
Documented improvements 25.000 € Added
Adjusted acquisition value 245.000 € 200.000 + 20.000 + 25.000
Sale price 350.000 € Starting transfer value
Eligible transfer expenses and taxes 15.000 € Deducted
Adjusted transfer value 335.000 € 350.000 − 15.000
Capital gain 90.000 € 335.000 − 245.000
A gain of 90.000 € does not automatically mean 90.000 € × a single percentage.

If the seller is a tax resident, the gain is included in the tax base of the savings base together with the other applicable items, and a progressive scale is applied, along with the integration, offsetting and possible exemption rules. If you are a non-resident, you must apply the IRNR regime and take into account the buyer's withholding tax.

Tax documentation

To accurately calculate a sale of 2026, you may need documents dating back decades

BUY

Acquisition

Purchase, inheritance or gift deed, and documentation of the value at which you acquired the property.

TAX

Taxes

Evidence of ITP, IVA/AJD or ISD payments and other taxes inherent to the acquisition, where applicable.

OBR

Improvements

Invoices, payments, licences and technical documentation that can prove investments or improvements.

RENT

Rental

Tax returns and information needed to reconstruct depreciation if the property was rented out.

SELL

Sale

Sale deed and evidence of the inherent expenses paid by the seller are deducted.

MUN

Municipal taxes

Keep the assessments or self-assessments directly related to the transfer, where applicable.

65+

Exemptions

Documentation proving that it was your main residence, your age, dependency status or reinvestment, where an exemption is claimed.

OLD

Earlier purchase

If you acquired it before 1994, keep records of the dates, amounts and details of relevant previous transfers.

Common mistakes

Ten mistakes that can distort the calculation

01

Subtracting only the purchase price from the sale price

This ignores costs, taxes, improvements and depreciation, all of which form part of the tax rules.

02

Subtracting the outstanding mortgage

The outstanding loan principal does not by itself reduce the capital gain.

03

Adding mortgage interest

Interest is expressly excluded from the acquisition value under the general rule in Article 35.

04

Calling any renovation an improvement

Maintenance and repairs should not automatically be treated as a higher acquisition value.

05

Forgetting depreciation

This is especially risky when the property has been rented out for years.

06

Treating the 3% withholding as tax

It is an advance payment made by the non-resident seller, not the tax rate on the gain.

07

Confusing municipal capital gains tax

IIVTNU and capital gains tax are separate obligations.

08

Assuming an exemption applies

Age, main residence status and reinvestment are subject to specific requirements.

09

Losing old invoices

Without documentation, it can be much harder to substantiate expenses or improvements.

10

Ignoring purchases made before 1994

They may fall under a transitional regime requiring a specific calculation.

Preparing a sale

Calculate the tax implications before accepting the final price

The sale price is not the net amount that will remain after the transaction. Where a property has historic improvements, rental income, inheritance, a mortgage, non-resident status or a possible exemption, it is advisable to first reconstruct the property's tax history.

Verified official sources

Calculation rules, rates, exemptions and non-residents

Sources reviesadawed on 9 August 2026. Tax information is based on national legislation and explanatory material from the Tax Agency.

Last verified: 9 August 2026

Tax rates, limits, forms and exemptions are information subject to change. This page should be reviewed when the Personal Income Tax Law, the Non-Resident Income Tax Law or procedures published by the AEAT change.

Frequently asked questions

Capital gain on selling a property

As a general rule, it is calculated by subtracting the adjusted acquisition value from the adjusted transfer value. adjusted acquisition value. The former may be reduced by certain selling expenses and taxes paid by the seller; the latter includes the acquisition price, investments and improvements, certain expenses and taxes and, where applicable, reduced by depreciation.

The costs and taxes inherent to the acquisition and paid by the purchaser may be included in the acquisition value, excluding interest, in accordance with the rules of Article 35 of the Personal Income Tax Act.

No. The regulations include investments and improvements in the acquisition value, but not every maintenance or repair expense should automatically be treated as an improvement. It is necessary to assess the nature of the work and retain the relevant documentation.

Not in itself. The gain is determined by comparing the tax acquisition and transfer values. The outstanding principal on the mortgage affects the net proceeds received and may be relevant under specific reinvestment rules, but it is not deducted directly from the gain.

Tax-deductible depreciation must be reviewed and, where applicable, the minimum depreciation. These amounts may reduce the acquisition value and increase the gain resulting from the sale.

The current savings taxable income scale uses combined marginal rates of 19%, 21%, 23%, 27% and 30%. The specific tax liability depends on the total savings tax base, possible offsettable losses, exemptions and other circumstances, so a single percentage should not be applied to the entire gain.

The AEAT currently publishes a rate of 19% for the real estate capital gain of a non-resident without a permanent establishment. In addition, the buyer must apply a withholding of 3% of the consideration as an advance payment of the seller's tax. of the seller.

No. It is a payment on account. The seller subsequently calculates and declares the gain under the IRNR procedure and deducts the withholding tax from the resulting tax liability. If the withholding exceeds the tax liability, a refund of the excess may be claimed in accordance with the applicable procedure.

The Personal Income Tax Act provides an exemption for gains obtained by individuals over 65 years of age when transferring their main residence, provided that the property qualifies as such under the applicable legal rules.

The gain obtained from selling a main residence may be fully or partially exempt through reinvestment when the requirements regarding the main residence, amount reinvested, time limit and other conditions set out in the legislation are met.

For acquisitions made gratuituitously, the acquisition value is based on the values determined in accordance with the rules of the Inheritance and Gift Tax, within the legal limits, adding the applicable expenses, taxes and investments or improvements, and adjusting depreciation where applicable.

The transitional regime for reduction coefficients may apply. Only a certain part of the gain may be eligible for reduction, and there is a cumulative limit of 400.000 € in transfer values eligible for the regime since 2015, so the calculation must be carried out on a case-by-case basis.

Notice: This guide is for informational purposes and does not replace personalised tax, legal or accounting advice. The actual calculation of a capital gain may depend on tax residence, acquisition dates, co-ownership, improvements, depreciation, rentals, inheritances or gifts, exemptions, offsettable losses, previous transactions and other circumstances. Before filing IRPF or IRNR, check the current regulations and procedures of the Agencia Tributaria and seek professional advice when the transaction requires it.

Actualidad inmobiliaria

Últimas publicaciones

Información práctica para agentes, agencias, compradores, vendedores e inversores del mercado inmobiliario español.