EnglishFrançaisEspañol

A Guide to Capital Gains Tax in Spain for Expats

In Spain, any profit you make from selling an asset—whether it’s a property, shares, or even cryptocurrency—can trigger a tax bill. This is known as capital gains tax.

How much you pay, and even how you pay it, all boils down to one critical question: are you a Spanish tax resident? The answer, which usually depends on whether you spend more than 183 days a year in the country, will fundamentally change your tax obligations.

The Role of Tax Residency

Before we get into the nuts and bolts, let's clear up a common point of confusion. Capital gains tax isn't levied on the total sale price of your asset. It applies only to the profit—the difference between what you paid for it (the acquisition value) and what you sold it for (the transfer value). In our experience, many new expats get this wrong, and it’s a costly mistake.

The assets that typically fall under this tax are exactly what you'd expect:

  • Real estate, like a holiday flat or your main home.
  • Investments, including stocks, shares, and mutual funds.
  • Cryptocurrencies, whenever you sell, trade, or even use them to buy something.
  • Business assets, such as patents or intellectual property.

Your tax residency status is the fork in the road. Spend more than 183 days in Spain within a single calendar year, and you’re generally considered a tax resident. This means you're taxed on your worldwide gains.

If you're a non-resident, Spain only cares about gains you make on Spanish assets, like a property located here. The paperwork is different, too.

This flowchart breaks down the decision path.

A capital gains tax decision path flowchart illustrating tax obligations based on country residency.

As you can see, everything starts with residency. Getting this right is the first and most important step in managing your tax liability. For a deeper dive into the specific criteria, our guide to Spanish tax residency explained covers all the nuances.

Here's a quick comparison to see how the two statuses stack up.

Resident vs Non-Resident Capital Gains Tax at a Glance

Aspect Tax Resident Non-Resident
Taxable Gains Worldwide gains (all assets, anywhere) Gains on Spanish assets only (e.g., property)
How You're Taxed Part of your annual income tax return (IRPF) Through a separate, specific tax filing (Modelo 210)
Tax Rates Progressive rates (19% to 28%) Flat rate of 19%
Exemptions Eligible for primary home reinvestment relief, etc. Very limited exemptions available

This table makes it clear: being a resident offers more complexity but also more potential reliefs, while the non-resident path is simpler but more rigid.

How Spain Categorises Your Gains

For tax residents, the Spanish system is quite logical. It splits your income into two buckets: renta general (general income) and renta del ahorro (savings income).

Capital gains almost always land in the savings income bucket. This is a huge advantage, as the tax rates for savings are significantly lower than the progressive rates that apply to your salary or business profits.

This structure is designed to tax your day-to-day earnings differently from your investment returns. Knowing which bucket your profit falls into allows you to plan asset sales with a clear picture of the tax impact. It’s all about timing and strategy.

Alright, let's break down how the Spanish tax authorities (Hacienda) look at your capital gains. It’s not just about slapping a percentage on your profit; the real work is in calculating the actual taxable gain. Getting this right can save you a significant amount of money.

The basic formula is straightforward enough:

Taxable Gain = Sale Price – (Purchase Price + Costs + Major Improvements – Depreciation)

But as with all things tax-related, the devil is in the details. From our experience helping expats navigate this, we can tell you that most people don't realise just how many costs can be legally deducted. Good record-keeping isn't just a good habit—it's your best defence against a higher tax bill.

Map of Spain illustrating resident vs. non-resident tax implications, including property, investments, and a 183-day rule.

Figuring Out Your Taxable Gain

The "Sale Price" is simply what you sold the asset for. The "Purchase Price" is what you originally paid. The real opportunity for tax savings comes from correctly accounting for everything in between.

Deductible Costs: Don't Leave Money on the Table

You can—and absolutely should—deduct the costs directly associated with buying and selling the asset. For a property sale, this is a big deal. Think about everything you paid for:

  • Transfer Tax (ITP) or VAT (IVA) when you first bought the place.
  • Notary and Land Registry fees for both the purchase and the sale.
  • Legal fees and estate agent commissions.

Let me be clear: you need the receipts (facturas) for everything. If you can't prove you paid it, Hacienda will not let you deduct it. No exceptions.

Major Improvements vs. Simple Maintenance

This is another area where people often get tripped up. You can deduct the cost of "Major Improvements" (mejoras), which are significant upgrades that genuinely add value to your property. This is very different from routine upkeep.

A common mistake is trying to deduct the cost of painting the walls or fixing a leaky tap. Hacienda sees that as simple maintenance (conservación). A new kitchen, a full roof replacement, or adding a swimming pool? Those are mejoras and are deductible. The distinction is key.

One last point: if you ever rented the property out, you must subtract any depreciation you claimed as a tax deduction during those rental years. This increases your taxable gain, and it's a detail many landlords forget until it's too late.

The Tax Rates: It All Depends on Where You Live

Once you’ve nailed down your taxable gain, the rate you pay comes down to one simple question: are you a tax resident or not?

For Tax Residents

If you’re a tax resident in Spain, your capital gains are considered "savings income" (renta del ahorro) and are taxed on a progressive scale. It’s like filling up buckets—the first chunk of your profit gets taxed at the lowest rate, the next at a slightly higher one, and so on.

The capital gains tax for residents starts at 19% on the first €6,000 of profit. It then climbs to 21% for gains between €6,001 and €50,000, 23% up to €200,000, 27% for €200,001 to €300,000, and 28% above €300,000.

For Non-Residents

For non-residents, the system is much simpler, but also less forgiving. You pay a flat rate on your entire gain.

  • 19% if you are a tax resident of another EU country, Iceland, or Norway.
  • 24% for residents of all other countries (this includes the UK and the US).

Non-residents don't get to use the tiered system or access most of the exemptions available to residents. This makes the calculation more direct but often results in a higher tax payment. The flat rate applies whether your gain is €5,000 or €500,000. It's our job to help you navigate this and make sure you don't pay a euro more than you legally have to.

Key Exemptions to Reduce Your Tax Bill

Paying tax on your profits is a legal requirement, but paying more than you have to doesn't need to be. Spain offers several important exemptions for capital gains tax that can seriously reduce, or even entirely wipe out, what you owe. In our experience, knowing these reliefs and how to apply them correctly is one of the most powerful tax planning tools available to residents.

Formula for calculating taxable gain from property sale, featuring stacked percentage buckets, houses, a receipt, and a calculator.

These breaks aren't automatic, though. You have to meet very specific conditions and declare them properly on your tax return. Let's break down the ones that make the biggest difference.

The Main Residence Reinvestment Relief

For tax residents, this is the big one. If you sell your main home (vivienda habitual) and reinvest the full proceeds into a new main home, you can avoid paying a single cent of capital gains tax on the profit.

The rules are strict, but the payoff is huge. Here’s what you need to know:

  • The property must be your main residence. You need to have lived there continuously for at least three years right before the sale.
  • You must reinvest the full sale proceeds. This means the total amount you received, not just the profit. If you only reinvest part of it, you’ll only get partial relief.
  • You have a two-year window. You can buy the new home up to two years before or two years after selling the old one.

It's absolutely vital to declare your intention to reinvest on your IRPF tax return for the year of the sale. We see people miss this simple step all the time, which turns a tax-free event into a fully taxable one.

The Over 65 Exemption

This is another massive benefit for long-term residents. If you are a tax resident and over the age of 65, you are completely exempt from paying capital gains tax when you sell your main residence.

The key conditions are straightforward:

  • You must be over 65 years old at the moment of the sale.
  • The property sold must have been your main residence for at least the last three years.

Unlike the reinvestment relief, there’s no string attached. You don’t have to reinvest the money into another property. The proceeds are yours to use however you want, completely tax-free. For a property that has appreciated significantly over many years, this can mean a tax saving of tens of thousands of euros.

The Transitory Regime for Assets Bought Before 1995

This one is a bit more complex, but it can be incredibly valuable if you own assets you bought a long time ago. Spanish tax law has special “abatement coefficients” (coeficientes de abatimiento) that reduce the taxable gain on assets purchased before 31st December 1994.

The system works by splitting the gain into two pieces: the profit generated up to 20th January 2006, and the profit generated after. Only the pre-2006 portion of the gain gets the reduction. The exact percentage depends on the asset type and how long you owned it before 1995. This can be a game-changer for expats who bought a holiday home in Spain decades ago.

These exemptions are truly game-changers. Residents who reinvest their primary home's sale proceeds into a new one can get a full exemption. Seniors over 65 who sell the home they've lived in for at least three years pay zero tax. And as we've seen, the historical rules for pre-1994 acquisitions can provide annual reductions on part of the gain. You can find more insights about these Spanish savings tax scale (official AEAT manual).

Navigating these exemptions requires careful planning and perfect documentation. The rules are detailed, and a small mistake can be very costly. If you think you might qualify for one of these reliefs, contact us for personalized advice before you act.

Reporting and Paying Your Capital Gains Tax

Knowing you owe capital gains tax is one thing. Actually reporting and paying it to the Spanish tax authority (Agencia Tributaria) is another beast entirely. The process is completely different depending on whether you’re a resident or not. Getting it right is non-negotiable—mistakes lead to automatic penalties and interest.

In our experience helping expats across Spain, the biggest headaches come from not knowing which form to file or when to file it. Let's clear up how it works.

For Tax Residents: The Annual IRPF Return

If you're a Spanish tax resident, your life is simpler. Your capital gains are just another line item on your annual personal income tax return, the Declaración de la Renta or IRPF.

You report all your worldwide capital gains on Modelo 100. This form is your yearly financial check-in with Spain, consolidating everything from your salary to investment profits. The filing window is usually from early April to 30 June each year, covering the previous calendar year.

So, if you sell shares in one tax year and make a profit, you declare that gain in the following IRPF campaign (typically April to June of the next year). It is a single, consolidated process.

For Non-Residents Selling Spanish Property

This is where it gets complicated—and immediate. The system for non-residents selling property is designed to make sure the tax office gets its cut upfront.

When a non-resident sells a property in Spain, the buyer is legally required to withhold 3% of the total sale price. This isn't a fee; think of it as a down payment on the capital gains tax you'll owe. The buyer pays this amount directly to the Agencia Tributaria on your behalf using Modelo 211.

This 3% withholding is a legal obligation placed on the buyer. If they fail to do it, the tax office can put a lien on the property, creating a nightmare for the new owner. As the seller, it's your job to make sure this happens correctly.

Once the 3% is paid, your job isn’t done. You, the seller, must then file your own tax return, Modelo 210, within four months of the sale. This is where you settle the final bill. Here's what you do on that form:

  1. Calculate the actual capital gain using the formula: Sale Price – (Purchase Price + Costs).
  2. Figure out the final tax owed by applying the non-resident tax rate (19% for EU/EEA residents, 24% for others) to that gain.
  3. Compare the tax owed to the 3% already withheld.

If the 3% withholding was more than you actually owed, you’re due a refund. If it was less, you have to pay the difference when you file Modelo 210.

Misunderstanding this two-step dance is one of the most common—and costly—mistakes we see non-resident sellers make. You can learn more about non-resident tax obligations and how we can assist.

If you don’t file Modelo 210, you not only forfeit any right to a refund but also open yourself up to fines. Our firm handles this entire process for clients, from verifying the 3% withholding to filing the final return and chasing down any refund you’re owed.

Tax Planning Strategies for Expats in Spain

Going beyond just filing your taxes on time can save you a serious amount of money on capital gains. These aren't obscure loopholes; they're legitimate strategies we use every day to help our clients build a smart financial life in Spain. With the right approach, a potential tax headache becomes just another manageable part of your plan.

Spain’s tax system is heavily funded by taxes on income, profits, and capital gains. In 2023, these taxes made up a massive 47.21% of all tax revenue. The Spanish tax authorities watch these gains very closely, which makes proper planning absolutely essential.

Diagram illustrating Spanish tax withholding and filing process for Modelo 210 and IRPF.

Timing Your Move and Residency Status

One of the most powerful tools we have is simple timing. If you know a large asset sale is on the horizon, we can plan your move to manage your tax residency for that year. Remember, you become a Spanish tax resident by spending more than 183 days here in a single calendar year.

Let’s say you plan to sell a large stock portfolio in December. If you moved to Spain in July of that same year, you'd likely become a tax resident and expose that entire worldwide gain to Spanish tax. By simply waiting until January to make your move, you could remain a non-resident for the year of the sale. This small change could completely alter your tax bill.

Leveraging Special Tax Regimes like the Beckham Law

For high-earning professionals moving to Spain for work, the Beckham Law can be a game-changer. This special regime allows eligible people to be taxed as if they were non-residents for their first six years in Spain.

Under Spain's special expatriate regime (Article 93), taxation of foreign-source gains depends on the exact income type and legal conditions in force. This point must be checked case by case before assuming an exemption.

This makes the Beckham Law a potentially powerful tool for people with non-Spanish assets, but it must be analyzed against your exact facts and the current legal text. Our firm specialises in assessing eligibility and managing applications for this regime. You can see our detailed guide on who actually qualifies for the Beckham Law.

Structuring Investments and Documenting Costs

Proactive planning is about more than just when you move; it’s about how you hold and document your assets from day one.

  • Asset Location: Think carefully about where you hold your investments. If you qualify for the Beckham Law, holding assets outside Spain is a clear win. For regular residents, the tax impact depends on the asset and any double taxation treaties in play.
  • Meticulous Record-Keeping: This is non-negotiable, especially for property owners. Keep every single factura (official invoice) for your purchase costs, like notary fees and transfer taxes. You must also document all major improvements (mejoras). These costs are deducted directly from your taxable gain when you sell.

These are the kinds of practical, actionable steps that make a real financial difference. They take a bit of forethought and organisation, but the savings are well worth it.

Common Questions About Spanish Capital Gains Tax

We get a lot of questions about capital gains tax in Spain. Here are quick answers to the ones that come up most often, based on our daily work helping clients navigate the system. If you don't see your question here, contact us for personalized advice.

Do I Have To Pay Capital Gains Tax On Cryptocurrency In Spain?

Yes, you do. This surprises many people, but the Spanish tax authorities (Agencia Tributaria) are very clear on this. They don't see crypto as a currency; they see it as an asset, just like a stock or a piece of property.

That means any profit you make is a taxable event. This includes selling for euros, trading one crypto for another, or even using it to buy a coffee. All of it gets bundled into your "savings income" (renta del ahorro) on your annual resident tax return (IRPF) and taxed at rates from 19% up to 28%.

You absolutely must keep meticulous records: the date and price you bought, and the date and price you sold or spent it. The Agencia Tributaria is getting very good at tracking this stuff. The silver lining? If you have losses, you can use them to offset other capital gains from the same year. This is a key planning point.

What Happens If The 3% Withholding Is Not Paid?

When a non-resident sells a property in Spain, the law puts the responsibility on the buyer. The buyer is legally required to withhold 3% of the full sale price and pay it directly to the tax office using form Modelo 211. This acts as a down payment on your capital gains tax bill.

If the buyer messes this up and doesn't pay it, the problem is theirs, not yours. The Agencia Tributaria will put a legal charge (a lien) on the property itself. This is a massive headache for the new owner, who now has to pay the 3% plus fines to get a clean title.

But just because the buyer paid it doesn't mean you're off the hook. You, the seller, still have to file your own tax return (Modelo 210) within four months. This is where you calculate what you actually owe. If the 3% was too much, you can claim a refund. If it was too little, you have to pay the rest. We see this process go wrong all the time, and it's much easier to get it right from the start.

How Does A Double Taxation Agreement Affect My Capital Gains?

Double Taxation Agreements (DTAs) are a lifesaver for expats. Spain has them with dozens of countries, including the UK, the US, and nearly all of Europe. Their job is to stop you from being taxed on the same profit in two different countries.

But a DTA doesn't mean you get to pick where you pay tax, and it certainly doesn't mean you pay no tax at all. For real estate, the rule is almost always the same: the country where the property is located has the first right to tax the gain. So if you sell your flat in Valencia, Spain gets to tax that profit, no matter where you live now.

A DTA provides a mechanism to avoid being taxed twice. It usually allows you to claim a tax credit in your home country for the tax you've already paid in Spain. It ensures fairness, it doesn't create a tax-free situation.

For other assets like stocks or business shares, the rules get more complicated and depend on the specific treaty. The first thing we do with any new client is analyse the relevant DTA to make sure tax is declared correctly in both places, avoiding expensive mistakes.

Can I Deduct Mortgage Interest From My Capital Gains?

No. This is probably the most common misunderstanding we have to clear up for clients selling property in Spain. You cannot deduct mortgage interest payments from your capital gain calculation.

Your taxable profit is worked out quite simply: the sale price minus the acquisition value. The acquisition value is what you originally paid, plus the direct costs of buying. These deductible costs include things like:

  • Notary and Land Registry fees
  • Transfer Tax (ITP) or VAT (IVA) you paid on purchase
  • Legal fees and estate agent commissions
  • The cost of major improvements (mejoras) that genuinely increased the property's value, like adding a new room (not just repainting).

Mortgage interest is seen as a cost of financing, not a cost of acquiring the property itself. The one place it does count is if you rented the property out. During those years, the mortgage interest was a valid expense to deduct against your rental income. It’s a small but vital distinction.


Navigating the details of capital gains tax in Spain can feel overwhelming, but you don't have to figure it out on your own. Our tax team gives clear, practical advice that fits your situation. Whether you're selling property, managing investments, or dealing with crypto, we're here to help you stay compliant and keep your tax bill as efficient as possible.

Book a consultation with our tax specialists today.

Share your love
Francesc Ordeig Fournier
Francesc Ordeig Fournier
Articles: 192