How to Calculate Capital Gains Tax When Selling Your Property: Step-by-Step Guide

How to Calculate Capital Gains Tax When Selling Your Property: Step-by-Step Guide

Did you know that the municipal capital gains tax on property sales can reach up to 30% of the land's cadastral value?

However, calculating municipal capital gains tax isn't as simple as it might seem. This tax is determined by considering various factors, such as how long you've owned the property (up to a maximum of 20 years) and the cadastral value of the land, not the selling price of the property.

Additionally, you have only 30 days after the sale to make the payment, and failing to do so can result in penalties. For example, in inheritance cases, the deadline extends to six months from the property owner's death.

The good news is that if you sell your property for less than what you paid, you might be exempt from this tax. In this article, we'll explain step by step how to calculate municipal capital gains tax correctly and avoid unpleasant surprises during the selling process.

What is Municipal Capital Gains Tax and When It's Paid

Simple definition of capital gains tax

The Tax on the Increase in Value of Urban Land (IIVTNU), commonly known as municipal capital gains tax, is a levy that taxes the increase in the value of urban land when property ownership is transferred.

This tax specifically applies to the value of the land, regardless of whether there is a building on it. For example, when selling an apartment, the tax considers only the value of the land, not the construction itself.

Municipal capital gains tax is triggered in different transfer situations:

  • Sales and exchanges
  • Donations
  • Inheritances or legacies
  • Establishment of real rights

Additionally, the tax has specific characteristics that define it as:

  • Direct: it directly taxes the taxpayer's wealth
  • Real: it applies to the increase in land value
  • Immediate accrual: it arises at the exact moment of transfer

Legal deadlines for payment

The deadlines for paying capital gains tax vary according to the type of transfer:

For inter vivos transfers (sales and donations):

  • 30 business days from the date of transfer
  • The payment corresponds to the seller in case of sale
  • In donations, the payment is made by the person receiving the property

For mortis causa transfers (inheritances):

  • 6 months from the date of death
  • Possibility of extension for another 6 additional months
  • The extension request must be made within the first 5 months

Failure to meet these deadlines can result in significant surcharges:

  • 5% for delays up to 3 months
  • 10% for delays between 3 and 6 months
  • 15% for delays between 6 and 12 months
  • 20% or more for delays over a year

It is essential to note that the tax expires after four years, counted from the end of the deadline for submitting the voluntary self-assessment. Likewise, the payment must be made at the city council where the property is located, although some municipalities allow electronic management.

Documents Needed to Calculate Capital Gains Tax

To correctly calculate municipal capital gains tax, we need to gather several essential documents. These documents will allow us to determine the tax amount precisely.

Cadastral value of the land

The cadastral value of the land is fundamental for calculating capital gains. We can obtain it through:

  • The most recent Property Tax (IBI) receipt
  • The electronic headquarters of the Cadastre
  • The latest income tax return

It is important to highlight that capital gains are calculated only on the value of the land, not on the construction. Therefore, when we transfer a property that includes land and building, we will consider the proportion that the cadastral value of the land represents with respect to the total cadastral value.

Original purchase deed

The original purchase deed is a crucial document because:

  • It proves the exact date of acquisition of the property
  • It establishes the initial acquisition value
  • It serves as evidence to demonstrate the possible non-existence of an increase in value

Additionally, in cases of lucrative transfers (inheritances or donations), we will need documentation that reflects the value declared in the Inheritance and Gift Tax.

City council certificates

The city council where the property is located provides essential documentation:

  • Information about current municipal coefficients
  • Specific certificates on applicable tax rates
  • Documentation on possible tax breaks or exemptions

To obtain these documents, we can:

  1. Go in person to the citizen service office
  2. Carry out the management electronically (in municipalities that allow it)
  3. Request telephone assistance by presenting a simple copy of the deed

City councils also have estimative calculators that allow knowing if there is an increase in land value before making the self-assessment. This tool is especially useful for determining the most favorable tax base according to our specific circumstances.

Steps to Calculate Your Municipal Capital Gains Tax

Since 2025, the calculation of municipal capital gains offers two different methods to determine the tax base. Let's analyze step by step how to perform this calculation accurately.

Obtain the cadastral value

The first step is to identify the cadastral value of the land, which appears broken down in the IBI receipt. This value is fundamental because:

  • It represents only the value of the land, not the construction
  • It is used as the basis for both calculation methods
  • It must correspond to the time of transfer

Determine the years of ownership

Next, we calculate the period that has elapsed between the acquisition and sale of the property. This calculation has a maximum limit of 20 years, even if the actual time of ownership is longer.

Apply the municipal coefficients

For 2025, the maximum established coefficients are:

  • Less than 1 year: 0.16
  • Between 1 and 5 years: 0.15 to 0.18
  • Between 6 and 10 years: 0.16 to 0.23
  • Between 11 and 15 years: 0.10 to 0.13
  • Between 16 and 19 years: 0.10 to 0.22
  • 20 years or more: 0.35

Calculate the final amount

There are two methods to determine the tax base:

Objective method:

  1. Multiply the cadastral value of the land by the corresponding coefficient
  2. Apply the municipal tax rate (maximum 30%)

Real method:

  1. Calculate the difference between the sale and purchase value
  2. Multiply by the percentage of the cadastral value of the land
  3. Apply the municipal tax rate

City councils can reduce the cadastral values of the land by up to 15% according to their degree of update. Additionally, since November 2022, taxpayers can perform self-assessment by both systems through the virtual tax office.

It is important to note that we can always choose the method that is most beneficial for our particular case. For example, if the real capital gain is lower than the one calculated by the objective method, we can choose to declare the real one.

Special Cases and Exemptions

Spanish legislation contemplates various special cases where municipal capital gains tax may have different treatment. Let's analyze the most relevant situations that could affect the payment of this tax.

Sale at a loss

The Supreme Court has established a significant precedent by declaring that capital gains liquidations are null when it is demonstrated that the sale was made at a loss. Furthermore, this decision allows requesting the return of what was paid in firm liquidations, even from previous years, as long as the loss in the transfer can be accredited.

To demonstrate the non-existence of an increase in value:

  • Submit a self-assessment indicating "not subject"
  • Provide documentation that supports the loss of value
  • Attach the purchase and sale deeds of the property

Inheritances and donations

In transfers by inheritance, there are specific considerations:

  • The deadline for payment extends to 6 months from the death
  • There is a possibility of extension for another 6 additional months
  • The extension request must be made in the first 5 months

For donations, the donee has 30 business days to settle the tax. In both cases, it is essential to demonstrate whether or not there has been an increase in value since the last transfer.

Primary residence

The exemption for primary residence applies in specific situations:

  • People over 65 years old who sell their primary residence
  • Transfers by deed in lieu of foreclosure of the primary residence
  • Mortgage foreclosures of the main residence

Likewise, there is a special exemption when:

  • The total amount is reinvested in another primary residence
  • The reinvestment is made within a maximum period of two years
  • It can be made both before and after the sale

If the reinvestment is partial, the exemption will apply proportionally to the amount reinvested. Similarly, transfers between spouses due to separation or divorce are exempt when they are made in compliance with court judgments.

Conclusion

Municipal capital gains tax represents a crucial aspect during the sale of any urban property. Certainly, the calculation process may seem complex, but by following the steps detailed above, you can determine the corresponding amount precisely.

It is essential to remember that since 2025 we have two different methods for calculating the tax base. Therefore, it is essential to analyze which one is more beneficial for our particular situation. In addition, exemptions and special cases can mean considerable savings if applied correctly.

Undoubtedly, success in managing this tax lies in the proper preparation of the necessary documentation and compliance with established deadlines. Thus, keeping all required documents organized and knowing the payment periods will help us avoid unnecessary surcharges.

Finally, in case of any doubt about calculating municipal capital gains tax, it is always advisable to consult with specialized professionals or go directly to the corresponding city council. The correct management of this tax will allow us to make a property transfer without setbacks or unpleasant surprises.

FAQs

How is the tax base determined to calculate municipal capital gains tax? There are two methods to calculate the tax base: the objective method, which multiplies the cadastral value of the land by an established coefficient, and the real method, which considers the difference between the sale and purchase value. The taxpayer can choose the method that is most beneficial.

What is the deadline to pay municipal capital gains tax after selling a property? The deadline to pay municipal capital gains tax is 30 business days from the date of transfer in case of sales and donations. For inheritances, the deadline extends to 6 months from the date of death, with the possibility of extension for another 6 additional months.

Are there exemptions from paying municipal capital gains tax? Yes, there are exemptions in specific cases. For example, people over 65 years old who sell their primary residence, transfers by deed in lieu of foreclosure of the primary residence, and mortgage foreclosures of the main residence are exempt from paying capital gains tax.

What documents are necessary to calculate municipal capital gains tax? The essential documents include the most recent Property Tax (IBI) receipt to obtain the cadastral value of the land, the original purchase deed that proves the date of acquisition, and city council certificates on applicable coefficients and tax rates.

Should capital gains tax be paid if a property is sold at a loss? No, if it can be demonstrated that the sale was made at a loss, municipal capital gains tax should not be paid. The Supreme Court has established that capital gains liquidations are null when it is demonstrated that the sale was made without an increase in value. It is necessary to submit a self-assessment indicating "not subject" and provide documentation that supports the loss of value.

Alberto Toro
Author
Alberto Toro
Founder & Director
With a background as an economist and an MBA, he specialised in digital marketing before finding his passion in real estate 10 years ago.
Have you seen the best flats for sale in Malaga?
Enjoy a unique lifestyle!
Find out!
Latest news
© 2025 Pineapple Homes - All Rights Reserved
Manage consent

We use our own and third-party cookies to personalize the web, analyze our services and show you advertising based on your browsing habits and preferences. For more information visit our Cookies Policy

Accept cookies Configuration Reject cookies