Tax-loss Harvesting in Spain: How to Offset Investment Losses Against Gains
Grete Suarez
14 sept 2026
Selling an investment at a loss can sometimes reduce your Spanish tax bill. But Spain has specific rules governing when an investment loss can be used, what it can offset and what happens if you buy the same investment again.
This strategy is commonly known as tax-loss harvesting. It involves selling an investment that has fallen in value to realize the loss for tax purposes, potentially using that loss to offset capital gains elsewhere in your portfolio.
Spain's rules are broadly similar to the concept used in the US, but the details in timing of repurchase and which kind of securities are different.
Here’s a general guide on how tax-loss harvesting works in Spain.
How tax-loss harvesting works in Spain
Suppose you bought shares for €10,000 and they are now worth €7,000. Selling them realizes a €3,000 capital loss.
That loss can generally be used to offset capital gains from other investments that fall within the savings tax base. For example, if you also realized a €5,000 gain from selling another investment, the €3,000 loss could reduce the net taxable gain to €2,000.
If your losses exceed your gains, Spain also allows certain remaining losses to offset positive income from movable capital, such as interest and dividends, subject to a 25% limit. Any unused loss can generally be carried forward for up to four years.
That makes realizing losses potentially useful toward the end of a tax year, particularly when an investor already has realized gains.
The two-month rule
Spain restricts the immediate use of a loss if you buy homogeneous securities within two months before or after the sale.
For securities traded on regulated markets, the restriction covers purchases made during the two months before or after the sale. For securities that are not traded on those markets, the period is generally one year before or after the sale.
The purpose is to prevent an investor from selling an investment solely to create a tax loss while effectively maintaining the same position by buying it straight back. But note that the loss is generally deferred rather than permanently lost. It can become deductible when the relevant securities are subsequently sold without triggering the repurchase restriction.
Spain also uses the FIFO (first in, first out) method when identifying homogeneous securities that are sold.
Example
You own 100 shares of a company that have fallen significantly.
You sell all 100 shares at a €4,000 loss and then buy the same 100 shares again three weeks later.
You cannot simply claim the €4,000 loss on that year's tax return. Because you repurchased homogeneous securities within the two-month window, the loss is deferred.
This can become particularly complicated when an investor has made multiple purchases of the same security over several years.
Can you sell one S&P 500 ETF and buy another?
The short answer is: potentially, yes, if the two ETFs are genuinely different securities and are not considered homogeneous.
The Spanish tax authority defines homogeneous securities around factors including the same issuer and class. Its guidance says that differences in certain secondary characteristics do not necessarily destroy homogeneity.
That means selling one S&P 500 ETF at a loss and buying a different ETF that tracks the S&P 500 may not trigger the same restriction if the funds are legally distinct securities. For example, switching from one ETF issuer to another may be different from selling shares in a company and immediately buying the same shares again.
However, simply having a different fund name or ticker does not automatically make an investment safe from the rule. The legal characteristics of the securities matter. Investors should check the specific funds before relying on this strategy.
What about investment funds and the Spanish traspaso rule?
Traspaso is a rule unique to Spain that offers tax deferral if you invest in eligible Spanish investment funds. When eligible fund units are sold and the proceeds are reinvested in another eligible investment fund, the investor generally does not recognize the capital gain or loss at that point. Instead, the new fund inherits the original acquisition value and date.
That means a traspaso generally does not create a taxable capital loss that can be harvested immediately.
There is an important exception: the special deferral regime does not generally apply to exchange-traded funds (ETFs). The tax authority says that gains or losses from ETFs must generally be recognized when the ETF is sold.
Read more on how the traspaso regime works.
Can you tax-loss harvest crypto in Spain?
Cryptocurrency is treated differently from shares and funds, although crypto losses can still form part of the savings tax base.
Selling cryptocurrency for euros can produce a capital gain or loss. Swapping one cryptocurrency for another can also trigger a taxable gain or loss because Spain treats the transaction as a permuta, or exchange of assets.
The tax authority also treats units of the same cryptocurrency as homogeneous for identification purposes and applies FIFO when determining which units have been sold.
Do you owe taxes on your crypto? Use our crypto tax calculator to simulate your potential tax position.
The tax-loss harvesting rules are more complicated here because the specific two-month securities rule is written around securities, while cryptocurrency has its own tax treatment. Anyone considering selling and quickly rebuying the same cryptocurrency specifically to generate a tax loss should get professional advice rather than assuming the stock-market rules apply the same way.
How Spain differs from the US
US investors may be familiar with the tax-loss harvesting strategy where you can realize losses to offset gains while managing the timing of purchases. However, be aware that the Spanish rules are not the same.
The US has a 30-day wash-sale rule, while Spain generally uses a two-month period for qualifying listed securities. Spain also has its own definition of homogeneous securities and a different system for carrying losses forward and offsetting them against investment income.
It's best to consult your financial advisor for your situation, as assuming the rules are identical can be an expensive mistake.
When tax-loss harvesting can make sense
Tax-loss harvesting may be worth considering when:
You have realized capital gains during the year.
You hold investments currently below their purchase price.
You want to rebalance your portfolio anyway.
You can sell an investment without violating the rules on repurchasing homogeneous securities.
You have carried-forward losses that could be used against future gains.
The strategy should fit the investment plan rather than drive it. Selling an asset solely for a tax benefit can create transaction costs, change your portfolio exposure or leave you out of the market while you wait to repurchase.
Spain's tax rules also require careful record-keeping, particularly when the same securities have been purchased at different times.
Tax-loss harvesting as a tax-saving strategy
Spain allows investors to use investment losses to reduce taxable gains, and unused losses can generally be carried forward for four years. But the two-month rule for homogeneous securities, FIFO accounting and the special treatment of investment funds can make tax-loss harvesting more complicated than it first appears.
Tax-loss harvesting can be a useful part of year-end tax planning, but it is not a strategy to execute on autopilot. Investors considering it should consult a qualified financial advisor or gestor, particularly when multiple purchases, ETFs, investment funds, cryptocurrency or carried-forward losses are involved.

Grete Suarez is a financial journalist covering personal finance and investing in Spain; former Goldman Sachs and Deloitte, published by Quartz and Yahoo Finance, and produced live news at CNN and Fox Business.
Share this article
Add paragraph text. Click “Edit Text” to update the font, size and more. To change and reuse text themes, go to Site Styles.
© 2026 Generation Wealth. All rights reserved. No part of this article may be republished without express written consent. When referencing this content, please cite the author and Generation Wealth (link back appreciated). For permission requests, contact: editorial@generationwealth.es
Important Notice: Generation Wealth produces independent, informational, and educational personal finance content on savings, investing, and money management to help readers understand and compare financial options. Our content is not personalized financial or tax advice, nor is it a product recommendation. Investing involves risks; always consult a qualified financial or tax professional before making decisions. Some articles include affiliate links or advertising, which do not affect the independence or objectivity of the content.
Other Related Articles

Latest Articles























