Capital Gains: Complete Guide 2026

September 30, 2026

When you sell a property for more than you paid for it, the tax authorities consider that you have obtained a capital gain and require you to pay income tax on it. At Domoblock, we spend much of the year calculating the differences between purchase, renovation, and sale prices, and we often see how the same property can generate a very different tax gain depending on which expenses are justified and how depreciation is handled. In this guide, we explain what a capital gain is, how it is calculated step-by-step, how it is taxed in 2026, and what exemptions exist, with a complete example.

¿Cuánto ganarías si inviertes desde hoy? Descúbrelo aquí.

What is a capital gain?

According to Article 33 of Law 35/2006 on Personal Income Tax, capital gains and losses are variations in the value of assets that become apparent when there is an alteration in their composition. Simply put: you sell, donate, exchange, or receive something, and the difference between what it was worth to you and what you obtain is the gain or loss. As long as there is no alteration, there is no taxation. The fact that your apartment is worth more today than when you bought it is not taxed until you sell it.

Difference between capital gain and income

Income comes from something that produces revenue on a recurring basis: a salary, rent, or interest. A capital gain arises from a change in your assets, usually a sale. The same property can generate both: rental income is considered real estate capital income, and the profit from selling it is a capital gain.

What is a capital loss?

It is the negative result of an alteration: you sell for less than the asset cost you, including expenses. Losses can be offset against gains, within the limits we see below.

Note: not all losses count. Those derived from consumption, gambling, or free transfers (for example, donating something that has lost value) are not computed (Article 33.5).

Transactions that can generate capital gains

Sale of a home or other property

This is the most common case and the one that involves the most money. The difference between the transfer value and the acquisition value, both adjusted for expenses, improvements, and depreciation, is taxed.

Transfer of shares and holdings

Selling shares, funds, or company holdings generates gains or losses. For investment funds, transfers between funds are not taxed until the final redemption. There is an anti-avoidance rule: if you sell listed shares at a loss and repurchase homogeneous securities in the two months before or after, you cannot report that loss until you sell the repurchased ones (Article 33.5.f).

Prizes, grants, and other additions of assets or rights

Contest or sweepstakes prizes and many public grants are capital gains that do not arise from a transfer. For this reason, they are taxed in the general tax base, not the savings base.

State lottery prizes and similar winnings have a special 20% tax rate, with the first €40,000 exempt.

Donations and free transfers

If you donate an apartment, the recipient pays Inheritance and Gift Tax, but you, as the donor, pay income tax on the gain accumulated since you bought it. Many families discover this too late. If there is a loss instead of a gain, it cannot be computed.

‍

What transactions are not considered capital alterations

Division of common property

If two siblings who inherited two apartments at 50% each are assigned one apartment each, there is no gain, provided the assignments correspond to their ownership shares (Article 33.2.a). Each retains the original acquisition date and value.

If there is an excess of assignment compensated with money, that portion may be subject to tax.

Dissolution of marital property regimes or joint ownership

Distributing assets upon the dissolution of a marital property regime or joint ownership is also not considered a change in net worth, provided the assignments respect the ownership shares.

Capital reductions

These do not generate a gain at the time of the reduction (Article 33.3.a). If the company returns contributions, the amount reduces the acquisition value of your shares; any amount exceeding that value is taxed as investment income.

Transfers due to the taxpayer's death

The so-called "death capital gain" does not exist in personal income tax: death does not generate a capital gain for the deceased (Article 33.3.b). Heirs take the value declared in the Inheritance Tax as the acquisition value.

‍

How to calculate a capital gain

Acquisition value

This is the actual amount paid for the asset (Article 35 of the Personal Income Tax Law). If you inherited or were gifted the asset, it is the value declared in the Inheritance and Gift Tax, which cannot exceed the market value.

Expenses, taxes, and improvements that can be included

Expenses and taxes inherent to the purchase paid by you are added to the acquisition value: Property Transfer Tax (ITP) or VAT, Stamp Duty (AJD), notary fees, registry fees, and administrative agency fees. Investments and improvements made afterward are also included. Mortgage interest is not included: it is treated in other sections of the tax return, not as part of the capital gain.

Transfer value

This is the actual sale price, provided it is not lower than the normal market value. If you sell to a family member at a price significantly below market value, the tax authorities may apply the market value.

Expenses and taxes associated with the sale

Deduct from the sale price any expenses you pay as the seller: agency commission, municipal capital gains tax (IIVTNU), energy performance certificate, or mortgage registry cancellation costs.

General formula and practical example

The formula is:

Capital gain = (sale price − selling expenses) − (purchase price + purchase expenses + improvements − depreciation)

A simple example: you bought shares for €10,000 with a €50 commission and sold them for €14,000 with a €60 commission. The profit is (€14,000 − €60) − (€10,000 + €50) = €3,890.

For real estate, the calculation involves more components, as you will see below.

‍

How to calculate capital gains from the sale of a property

Purchase price and acquisition costs

Take the price from the deed and add the Property Transfer Tax (ITP) or VAT and Stamp Duty (AJD), notary fees, land registry fees, and agency fees. If you paid ITP based on the Cadastre reference value because it was higher than the purchase price, the purchase price remains the one on the deed, but the excess tax you paid is included as a cost.

Justified investments and improvements

Include work that increases the value or useful life of the property: a comprehensive renovation, an extension, an elevator, or the installation of new systems that did not previously exist. These must be justified with invoices in your name. Repairs and maintenance do not count, as we explain in the section on common mistakes.

Depreciation when the property was rented out

If you rented out the property, depreciation must be subtracted from the acquisition value. Here is the nuance that is most surprising: the minimum depreciation is subtracted even if you did not deduct it in your tax returns (Article 40 of the Personal Income Tax Regulations). In other words, if you did not apply it at the time, you lost the rental deduction and will also pay more tax on the gain when selling.

Sale price and transfer costs

Take the price from the deed of sale and subtract the agency commission including VAT, the municipal capital gains tax (plusvalía municipal), and other expenses you assume as the seller.

Full example. A property purchased in 2015 for €120,000 (€12,000 in property sale taxes and expenses), renovated for €15,000 in 2016, rented out for eight years, and sold in 2026 for €220,000. It is assumed that the building accounts for 60% of the cadastral value.

Step 1. Acquisition value:

  • Purchase price plus costs: €120,000 + €12,000 = €132,000.
  • Plus the 2016 renovation: €15,000.
  • Minus depreciation for the eight years of rental (3% × 60% × €147,000 × 8 years): €21,168.
  • Acquisition value: €125,832.‍
  • Step 2. Transfer value:
  • Sale price: €220,000.
  • Minus agency commission (3% plus VAT): €7,986.
  • Minus municipal capital gains tax and other expenses: €3,500.‍
  • Transfer value: €208,514.‍
  • Step 3. Result:‍
  • Capital gain: €208,514 − €125,832 = €82,682.‍
  • Tax liability on the savings base using 2026 rates: €17,896.86.
  • If you forget to subtract the depreciation, the declared gain would be €61,514 and the tax liability €13,028.22. The difference, €4,868.64, is exactly what the tax authorities usually claim during an audit. The figures are hypothetical.
¿Cuánto ganarías si inviertes desde hoy? Descúbrelo aquí.

Taxation of capital gains in the 2026 Personal Income Tax (IRPF)

Integration into the savings tax base

Gains derived from transfers are integrated into the savings tax base. The combined state and regional rates for 2026 are:

  • Up to €6,000: 19%.
  • From €6,000 to €50,000: 21%.
  • From €50,000 to €200,000: 23%.
  • From €200,000 to €300,000: 27%.
  • Over €300,000: 30%.
  • The final 30% bracket has been applied since 2025, following the reform of Law 7/2024. Gains that do not arise from a transfer (prizes, grants) go into the general tax base, subject to the progressive scale.

Temporal imputation: which tax year to declare in

They are declared in the year in which the change in assets occurs, usually the date of the deed (Article 14.1.c). A sale signed on December 30, 2026, is declared in the 2026 tax return, which is filed in 2027. If you sell with deferred payment and receive the money over more than one year, you can allocate the gain as you receive the payments (Article 14.2.d).

Offsetting capital gains and losses

First, capital gains and losses from transfers within the same year are offset against each other. If the balance is negative, it may be offset against the positive balance of investment income from the savings base, up to 25% of that amount (Article 49). Any amount that cannot be offset is carried forward to the following four years. It is advisable to record this each year, as it is lost if not applied in time.

Documentation required to justify the calculation

Purchase and sale deeds, ITP, VAT, and AJD tax settlements, notary, registry, and administrative agency invoices, improvement invoices, municipal capital gains tax settlement, and the agency's invoice. If the property was rented out, your tax returns for those years. The tax authorities may audit the sale for four years, but you must keep the supporting documents for the purchase and improvements from day one, even if they are twenty years old.

‍

Exempt capital gains or gains with tax benefits

Sale of a primary residence by individuals over 65

Capital gains from the sale of a primary residence are exempt if the seller is 65 years of age or older (Article 33.4.b). It must have been their residence for at least three consecutive years, or they must have ceased to reside there less than two years ago. If only one spouse meets the age requirement, the exemption applies to their share.

Reinvestment in a new primary residence

If you reinvest the amount obtained into another primary residence within the two years prior to or following the sale, the gain is exempt (Article 38.1). If you reinvest only a portion, the exemption is proportional. The nuance: the "amount obtained" is considered the sale price minus the outstanding loan you pay off. If you sell for €200,000 and pay off an €80,000 mortgage, you only need to reinvest €120,000 for the full exemption.

Transfers in situations of dependency

The sale of a primary residence by individuals in a situation of severe or high dependency, in accordance with Law 39/2006, is also exempt, with no age limit.

Other exemption scenarios provided for by regulations

  • Individuals over 65 who reinvest the gain from any asset into an insured life annuity, up to €240,000 and within a period of six months (Article 38.3).
  • Dation in payment of a primary residence or mortgage foreclosure, subject to requirements (Article 33.4.d).
  • Donations to non-profit entities covered by Law 49/2002.
  • Reduction coefficients for real estate purchased before December 31, 1994, which reduce the portion of the gain generated up to 2006, with a cumulative limit of €400,000 in transfer value.

‍

Common mistakes when declaring a capital gain

Confusing repairs with improvements

Replacing a broken boiler with a similar one is a repair: if the apartment was rented out, it was deducted as a rental expense and does not add to the acquisition value. Installing heating where there was none is an improvement and does add to it. When renovating an apartment, separate which items in the budget are improvements and which are maintenance. We recommend doing the same with your invoices.

Omitting deductible expenses from the calculation

The most common oversights are the municipal capital gains tax paid upon sale, the AJD tax from the purchase, the administrative agency fees, and the registry cancellation fees. Each one reduces the gain.

Failure to keep invoices and supporting documents

Without an invoice, an improvement does not exist for the tax authorities. Cash payments without an invoice do not serve as proof.

Applying an exemption without meeting all requirements

The reinvestment exemption requires the new property to be your primary residence (living in it for at least three years and occupying it within twelve months). If this is not met, you must regularize the situation with late-payment interest.

‍

Frequently Asked Questions (FAQs)

Besides personal income tax (IRPF), must I pay the municipal capital gains tax?

Yes. The municipal capital gains tax (IIVTNU) is a separate tax that levies the increase in the value of urban land and is paid by the seller. It can be deducted as an expense when calculating the IRPF gain. If you sell at a real loss, you can request that it not be assessed by providing proof via the deeds.

What happens if I sell below the Land Registry's reference value?

For the seller's IRPF, the actual price counts, provided it is not below market value. The reference value is primarily used for the property transfer tax (ITP) paid by the buyer. A sale significantly below market value may attract the attention of the tax authorities, so it is advisable to be able to justify the price.

Do I have to declare the sale if I have lost money?

Yes. Every sale must be declared even if the result is negative. It is also in your interest: the loss can be offset against other gains for the year, and if there is a surplus, you can carry it forward for four years. If you do not declare it, you lose that right.

How is an inherited apartment that I sell shortly after taxed?

Your acquisition value is the one declared for Inheritance Tax, plus any corresponding inheritance expenses. If you sell soon after for a similar price, the gain will be small or zero. Declaring a low value in the inheritance to pay less Inheritance Tax results in higher IRPF when selling later.

Is there any withholding tax when I sell an apartment?

If you are a tax resident in Spain, there is no withholding: you pay in your tax return. If you are a non-resident, the buyer must withhold 3% of the price and pay it to the tax authorities as a payment on account of the Non-Resident Income Tax.

Does investing with a participating loan generate a capital gain?

No. Income obtained from a participating loan is taxed as investment income, with a 19% withholding, also within the savings tax base. This positive balance can be offset against net capital losses from the same year, up to 25%.

¿Cuánto ganarías si inviertes desde hoy? Descúbrelo aquí.

Are you looking for alternatives to invest in the real estate sector?

Domoblock enables users to invest starting from €200 in real estate projects entirely online through real estate tokenization and blockchain technology. Assessing the true outcome of a transaction requires more than simply comparing the initial capital with the proceeds received: it is necessary to identify the tax classification of the return, associated expenses, the date of transfer, and the documentation applicable to each project. While technology streamlines operations, it does not replace professional tax or legal advice, nor does it eliminate the risks of illiquidity, delays, or capital loss.

With Domoblock, a real estate investment platform offering house flipping projects in Spain, you can achieve your goals and secure your long-term financial independence.

Conclusion

The capital gain on a property is not the difference between what you paid and what you received: it is the result of adding expenses and improvements and subtracting depreciation. Our practical advice: open a folder today with the deed, purchase taxes, and every construction invoice, and separate repairs from improvements. If the apartment was rented out, calculate the depreciation before setting the sale price. This way, you will know how much you will actually keep.

‍

Author

Sergio Navarro

Expert in blockchain, investments, and personal finance

Do you like what you're reading?

Subscribe to our Newsletter

Do you like what you're reading?

Subscribe to our newsletter!

Funded

Zaragoza | Downtown

5 Pedro María Ric

DOMO-ZGZ-12
Flipping house

Funded

100%

€550,012.94

Target

€550,012.94

Estimated annual return:
12.13%
Estimated duration:
8 months
Chat with other investors and ask your questions in our Telegram group

Related articles