How to avoid capital gains tax in Spain: 5 legal strategies for property owners

Luxury modern villa with infinity pool at sunset in Spain, illustrating lifestyle strategies for how to avoid capital gains tax in Spain legally and efficiently.

Investing in luxury houses in Spain offers unparalleled lifestyle benefits and strong returns. However, understanding how to avoid capital gains tax in Spain is essential to protect your profits when selling. Whether you’re a resident or non-resident, there are legal strategies to minimize or eliminate your capital gains tax (CGT) liability: avoid paying more than needed!

Índice del artículo

Disclaimer for magazines or newspapers: you must have the consent of Golden Partners to reproduce our content in whole or in part in your publication. Send us an email to the contact form and we will be happy to assist you.

What is capital gains tax in Spain?

Luxury villa in Spain illustrating capital gains tax implications for property sellers.

Capital gains tax in Spain applies to the profit earned from selling an asset (purchase price), such as real estate. The tax rate depends on your residency status and the amount of gain:

  • Residents: Progressive rates (19% to 28%), depending on the gain amount.
  • Non-residents: Flat 19% for EU/EEA residents; 24% for others. 

Additionally, non-resident sellers are subject to a 3% withholding tax retained by the buyer at the time of sale.  When a non-resident sells property in Spain, a 3% withholding tax is automatically deducted from the sale price by the buyer, as a prepayment of the capital gains tax in Spain

In 2024, Spain’s Tax Agency (Agencia Tributaria) collected a total of €294.7 billion in tax revenue, with the Personal Income Tax (IRPF) accounting for €129.4 billion, up 7.6% from 2023. While there’s no specific breakdown for capital gains from real estate sales, these gains are taxed under the savings base of IRPF, contributing significantly to the overall increase. Capital gains from property sales in Spain are taxed progressively from 19% to 30%, depending on the amount. This reflects the growing impact of real estate transactions on Spain’s tax revenue.

Plan your tax-efficient property sale
Discover how to legally minimize your capital gains tax
when selling luxury property in Spain.

5 legal ways to avoid or reduce capital gains tax in Spain

Looking to legally reduce or avoid capital gains tax when selling property in Spain? Whether you’re tax resident in Spain or a non-resident, Spanish tax law provides several exemptions and strategies to help you minimize your tax liability. From age-related exemptions and reinvestment rules to international tax treaties and smart ownership structures, here are five proven methods to reduce your capital gains tax in Spain—all fully compliant with Spanish tax regulations.

1. Exemption for residents over 65

If you’re over 65 years old and selling your primary residence in Spain, you may be fully exempt from capital gains tax, provided that you’ve owned and lived in the property for at least three years prior to the sale. This exemption applies only to residents and is one of the most generous tax reliefs available under Spanish law.

2. Reinvestment in a new primary residence

Spanish tax residents can defer or avoid CGT if they reinvest the entire sale proceeds from their current main home into another primary residence within two years. The reinvestment must be complete and within the EU or EEA. Partial reinvestments offer partial relief, making this a flexible and strategic option for property owners.

3. Offsetting expenses and improvements

Capital gains tax is calculated on the net profit from the sale, meaning you can reduce your taxable gain by deducting certain qualified expenses, such as:

  • Purchase costs (e.g., notary fees, property transfer tax, and registration costs)
  • Selling costs (e.g., real estate agent commissions, legal fees)
  • Capital improvements (e.g., major renovations that increase property value). Routine maintenance does not qualify, so it’s important to distinguish between repairs and actual improvements.

4. Utilizing tax treaties

Spain has signed double taxation agreements (DTAs) with over 90 countries, including the United Kingdom, Germany, the United States, and Mexico. These treaties often allow non-residents to claim tax credits or exemptions in their country of residence, potentially avoiding being taxed twice on the same capital gain. To benefit from these benefits on capital gains in Spain for the tax paid, sellers must file the correct forms (e.g., Spain’s Form 210) and comply with both countries’ reporting requirements.

Understanding the relevant DTA is key, as it determines whether Spain has taxing rights over the capital gain. This process can help non-resident property owners in Spain avoid double taxation and recover excess tax withheld at the time of sale.

5. Strategic ownership structures

Using corporate entities, holding companies, or other investment vehicles to hold Spanish real estate may offer capital gains tax advantages, especially for high-value properties. This approach is more complex and requires proper international tax planning to ensure full compliance with Spanish and international regulations. Always seek advice from a tax advisor experienced in Spanish property law.

You could also benefit from a special tax regime before arriving to Spain (i.e., Beckham Law) so to be taxed at a flat rate of 24% and to benefit from other tax exemptions; or even once you are already tax resident in some regions as Madrid (i.e., Mbappé Law).

How Golden Partners can assist you

At Golden Partners, we specialize in guiding both national and international investors through the complexities of Spanish real estate transactions. Our services include:

  • Property search: Identifying luxury properties that meet your investment goals.
  • Legal assistance: Ensuring compliance with Spanish laws and regulations.
  • Tax planning: Developing strategies to minimize tax liabilities.

Property management: Offering ongoing support to maximize your investment returns.

Invest smartly in Spanish real estate
Let Golden Partners guide you through profitable
and tax-efficient property investments in Spain.

Frequently asked questions about capital gains tax in Spain

If you’re selling property in Spain, understanding how capital gains tax works is essential—especially when trying to reduce your tax bill legally. 

Below are the most frequently asked questions by both residents and non-residents, covering exemptions, deductible expenses, age-related relief, and the difference between CGT and other Spanish property taxes like plusvalía. These answers will help you make informed decisions and potentially save thousands in taxes.

For Spanish tax residents, the best legal ways to avoid CGT include selling your primary residence after the age of 65 or reinvesting the proceeds into another main home within two years. Non-residents can reduce or avoid CGT by reviewing applicable double taxation treaties and deducting allowable expenses from the taxable gain.

You can offset several costs against the capital gain, including:

  • Purchase-related expenses such as notary fees, registration taxes & property transfer tax
  • Selling costs, including estate agent commissions and legal fees
  • Capital improvements like structural renovations or upgrades that add value

It’s crucial to keep proper invoices and legal proof to validate each deduction in case of a tax audit. Also, to eb advised by a Spanish tax lawyer.

Residents over 65 years old who sell their main residence may be exempt from CGT, as long as they’ve lived in the property for at least three years. Additionally, residents of any age who reinvest 100% of the proceeds into a new primary home (within the EU/EEA) may also qualify for a full or partial exemption.

If you are over 65 and selling your main residence, you may be completely exempt from capital gains tax, provided that the property has been your habitual residence for a minimum of three years. This exemption applies only to Spanish tax residents.

No, plusvalía municipal is not the same as capital gains tax. Plusvalía is a local tax charged by the municipality on the increase in the value of urban land, whereas capital gains tax is a national tax applied to the profit from the sale of the property itself. In most cases, you may have to pay both, depending on your situation.

If you are looking to invest in luxury homes in Costa del Sol, Mallorca, Jávea, Marbella, Estepona, San Sebastián, or any other part of Spain, coastal or inland, contact Golden Partners.

Contacte con Golden Partners
Especialistas en Derecho Inmobiliario y Extranjería
Entradas relacionadas
Sin categoría
Luxury modern villa with infinity pool at sunset in Spain, illustrating lifestyle strategies for how to avoid capital gains tax in Spain legally and efficiently.
Learn legal strategies to know how to avoid capital gains tax in Spain when selling luxury property. Expert advice for residents and non-residents!
Sin categoría
Luxury seafront villa with infinity pool and palm trees, perfect for those looking to buy house in Ibiza.
Buy house in Ibiza today. Explore flats, villas & homes for sale in Ibiza Spain with expert guidance and full support from Golden Partners.
Sin categoría
Modern luxury villa with infinity pool and ocean view at sunset — premium properties for sale near me.
Discover properties for sale near you: rural, beachfront, cheap & luxury. Golden Partners helps local & international investors in Spain.
Sin categoría
American family moving to Spain from USA, embracing new life abroad.
Moving to Spain from USA? Learn about visas, taxes, real estate & lifestyle. Discover how Golden Partners can help you relocate seamlessly.
Sin categoría
Luxury villa for sale in Costa Adeje with infinity pool and breathtaking ocean views at sunset.
Invest in San Sebastian real estate: thriving markets, prime locations, and high ROI. Explore opportunities with Golden Partners today.
Sin categoría
Luxurious beachfront apartment with panoramic sea views in San Sebastian, Spain real estate, showcasing modern interiors and a spacious terrace overlooking La Concha Bay.
Invest in San Sebastian real estate: thriving markets, prime locations, and high ROI. Explore opportunities with Golden Partners today.