Back to blog
Taxation & Investment

Cryptocurrency Losses: How to Offset Them in Your Spanish Tax Return and Recover Part of What You Lost

Learn how to offset cryptocurrency losses in your Spanish tax return. Anti-avoidance rule, compensation limits, 4-year carry forward and tax loss harvesting strategies.

E

Cleriontax Team

Crypto Tax and Data Analysis Experts

18 min read
Capital LossesLoss OffsettingTax Loss HarvestingAnti-Avoidance RuleLoss Carry ForwardFIFOAEATIncome Tax ReturnSavings Tax BaseCapital GainsCrypto LossesWash Sale RuleIncome TaxTax Optimization
Compensación de pérdidas en criptomonedas - Guía completa sobre tax loss harvesting, regla antiaplicación y arrastre de pérdidas patrimoniales en España
2 de marzo de 2026
18 min de lectura
Fiscalidad e Inversión
Capital LossesLoss OffsettingTax Loss HarvestingAnti-Avoidance RuleLoss Carry ForwardFIFOAEATIncome Tax ReturnSavings Tax BaseCapital GainsCrypto LossesWash Sale RuleIncome TaxTax Optimization

Losing money on cryptocurrencies hurts. But what really stings is losing money twice: first in the market and then with the Tax Authority, by not knowing how to take advantage of those losses for tax purposes. After the 2022 crashes and 2024 corrections, thousands of Spanish investors are carrying losses that could be reducing their tax bill — and they're not doing it.

The reality is that a cryptocurrency loss isn't just a red number in your portfolio. It's a tax asset that, managed correctly, can save you hundreds or thousands of euros in taxes over the next four years. But the system has very specific rules — and traps — that you need to know before making a move.

This article breaks down the complete mechanism for offsetting capital losses in cryptocurrencies: from the legal foundations to advanced tax loss harvesting strategies, including the dreaded anti-avoidance rule that has caught more than a few investors off guard.

How Capital Losses Are Generated in Cryptocurrencies

Before discussing offsetting, you need to understand which operations generate a computable capital loss for income tax purposes.

A capital loss occurs when you sell, exchange, or transfer a cryptocurrency for a value lower than its acquisition cost.

Operations That Generate Computable Losses

Direct sale to euros at a loss. You buy 1 ETH at €3,500 and sell it at €2,800. Capital loss: €700 (minus commissions).

Swap between cryptocurrencies at a loss. Every exchange between cryptocurrencies is a swap for tax purposes. If you exchange 1 BTC (acquired at €45,000) for ETH when Bitcoin is worth €38,000, you generate a €7,000 loss. This includes exchanges to stablecoins like USDT or USDC.

Liquidation of DeFi positions at a loss. Withdrawing funds from a lending protocol or liquidity pool at a value lower than deposited generates a capital loss.

Tokens that lose all value. If a token collapses to zero (think LUNA/UST in 2022), you can register the total loss of your investment.

Operations That Do NOT Generate Computable Losses

Transfers between your own wallets. Moving BTC from Binance to your Ledger is not a sale.

Drop in value without sale (unrealised loss). You cannot compute the loss until you sell or exchange.

Loss of wallet access. If you lose your private keys, the tax situation is ambiguous as there has been no transfer.

The Role of the FIFO Method

Spain applies the FIFO (First In, First Out) method for calculating capital gains and losses. When you sell a cryptocurrency, the oldest units are considered sold first. Our complete tax filing guide goes deeper into FIFO calculation with more examples.

The Offsetting Mechanism: How It Works Exactly

Capital loss offsetting in Spanish income tax follows a very specific order, regulated in Article 49 of the Income Tax Law.

The Savings Tax Base: Two Compartments

Compartment 1: Capital gains and losses. This is where gains and losses from transfers go: cryptocurrency sales, swaps, position liquidations.

Compartment 2: Investment income. This includes interest, dividends, and other yields. In crypto, this covers staking, yield farming, lending, and airdrop income.

Offsetting Rule: The Mandatory Order

Step 1: Within each compartment, gains offset losses of the same type. Crypto capital losses are first subtracted from capital gains in the same year (from other crypto, shares, investment funds, property, etc.).

Step 2: If you still have net capital losses after offsetting within the compartment, you can offset up to 25% of the positive balance from the other compartment (investment income). So if you have €10,000 in staking yields and €20,000 in net capital losses, you can only offset €2,500.

Step 3: Any remaining losses are carried forward to the next 4 tax years, applying the same mechanism each year.

Complete Practical Example

Tax year 2025:

  • Loss from BTC sale: -€15,000
  • Gain from ETH sale: +€6,000
  • Staking yields: +€4,000
  • Lending yields: +€2,000

Step 1: -15,000 + 6,000 = -€9,000 (net loss)

Step 2: Total yields: €6,000. 25% of 6,000 = €1,500 offset. Remaining loss: -€7,500

Step 3: The €7,500 carries forward to 2026.

Real tax saving: Without offsetting you'd pay tax on €12,000. With offsetting, only €4,500. At an average rate of 21%, the saving is approximately €1,575.

The Anti-Avoidance Rule: The Trap You Must Know

The anti-avoidance rule (also called the 2-month rule or wash sale rule) is probably the most unknown and dangerous aspect of loss offsetting in cryptocurrencies.

What Does the Rule Say?

Article 33.5.f) of the Income Tax Law establishes that capital losses are not computable when, within 2 months before or after the sale, the taxpayer acquires homogeneous securities.

In crypto terms: if you sell Bitcoin at a loss and buy Bitcoin again within the following 2 months (or had bought it within the 2 months before the sale), the loss cannot be offset.

Does This Rule Apply to Cryptocurrencies?

The rule technically refers to "homogeneous securities admitted to trading", a traditional stock market concept. Cryptocurrencies are not strictly securities. However, Spain's Directorate General for Taxes has extended the criterion to cryptocurrencies by analogy. Until a court rules otherwise, the prudent approach is to respect the 2-month rule.

What Happens to the Non-Offsettable Loss?

The loss doesn't disappear — it's integrated into the acquisition cost of the repurchased securities. So when you sell that crypto in the future, the loss is effectively deferred.

Does the Rule Apply Between Different Cryptocurrencies?

No. The homogeneity rule applies to the same asset. BTC is homogeneous with BTC, ETH with ETH. But BTC is not homogeneous with ETH. Selling BTC at a loss and buying ETH immediately does not trigger the rule. This distinction is what makes certain tax loss harvesting strategies possible.

Loss Carry Forward: Up to 4 Years to Offset

If you can't offset all your losses in one year, the excess carries forward to the next 4 tax years.

The Deadline Matters

If you don't manage to offset losses within 4 years, you lose them permanently.

Losses from 2022 → last opportunity: 2026 tax return (filed in 2027) Losses from 2023 → last opportunity: 2027 tax return Losses from 2024 → last opportunity: 2028 tax return

Tax Loss Harvesting: Legitimate Strategies to Optimise Your Tax Bill

Tax loss harvesting consists of deliberately realising unrealised losses to offset them against present or future gains. It's a perfectly legal practice.

Strategy 1: Selective Realisation Before Year-End

Before 31 December, review your portfolio and identify positions with unrealised losses. If you have capital gains to declare that year, realising those losses can reduce the tax base.

Important: If you want to maintain exposure, you must wait 2 months before repurchasing to avoid the anti-avoidance rule.

Strategy 2: Asset Rotation (Indirect Swap)

This strategy takes advantage of the fact that the anti-avoidance rule only applies to homogeneous assets.

  • Sell all your BTC, realising the loss
  • Immediately buy ETH for the same amount
  • The BTC loss is offsettable because you haven't repurchased BTC
  • You maintain crypto market exposure (though with a different asset)

Strategy 3: Temporal Staging

If you have a very large loss, it may make sense to realise losses gradually over several years rather than concentrating them all in one.

Strategy 4: Coordination with Other Assets

Cryptocurrency losses offset capital gains from any source: shares, investment funds, property, etc.

Savings Tax Base Rates: How Much You Actually Save

BracketTax Rate
Up to €6,00019%
€6,000 to €50,00021%
€50,000 to €200,00023%
€200,000 to €300,00027%
Over €300,00028%

A €10,000 loss offset against gains can save you between €1,900 and €2,800 depending on the bracket.

Documentation Required to Offset Losses

The AEAT can request evidence for any declared loss.

For each loss-making operation:

  • Exact date and time
  • Asset sold
  • Quantity sold
  • Sale price (with exchange screenshot)
  • FIFO acquisition cost
  • Commissions paid
  • Loss calculation

To demonstrate anti-avoidance rule compliance:

  • Complete buy/sell history for the same asset in the 2 months before and after each loss-making sale

Our data export guides for Binance, Kraken, Bybit, MetaMask, and Ledger will help you obtain the necessary data. For DeFi operations, see our guide on documenting transactions for the Tax Authority.

Common Mistakes When Offsetting Crypto Losses

Offsetting losses without respecting the anti-avoidance rule. The most costly mistake. If the Tax Authority detects you repurchased the same asset within 2 months, it will annul the offset and may impose an additional penalty.

Not declaring losses believing they're "not worth it". Every loss has tax value. A €500 loss today can offset a €500 gain next year.

Forgetting loss carry forwards from previous years. If you declared losses in 2023 or 2024 that weren't fully offset, you must include the pending balance.

Offsetting savings base losses against general base income. Crypto capital losses CANNOT offset employment income, rental income, or other general base income.

Not considering commissions. Gas fees and trading fees are part of the calculation.

FIFO calculation errors. Incorrectly applying FIFO can turn a real loss into a declared gain. See the most common mistakes when declaring cryptocurrencies.

Special Cases

Tokens That Collapse to Zero

When a token loses virtually all its value, you can register the total loss. The difficulty lies in documenting it.

Hacks and Thefts

If your cryptocurrencies were stolen in an exchange or wallet hack, Spain's DGT has acknowledged that theft losses can be considered capital losses, provided you submit a police report.

Cryptocurrencies on Collapsed Exchanges

The FTX case is paradigmatic. If you had funds on a defunct exchange, the loss can be computed when there's reasonable certainty the funds won't be recovered — typically when bankruptcy is declared.

Frequently Asked Questions

Can I offset cryptocurrency losses against share gains?

Yes. Capital losses and gains are integrated in the same savings base compartment, regardless of asset type.

What if I only have losses and no gains?

The losses carry forward for 4 years. You can also offset up to 25% of positive investment income.

Does the 2-month rule apply equally to all cryptocurrencies?

It applies to each cryptocurrency individually. BTC is homogeneous with BTC, ETH with ETH. But BTC is not homogeneous with ETH.

Can I sell at a loss and have a family member repurchase?

No. Anti-fraud rules cover related-party transactions.

Are losses from collapsed exchanges (like FTX) offsettable?

Yes, but you must adequately document the loss with judicial resolution or police report.

How are losses declared in the tax return?

Capital losses are included in the capital gains and losses section of the savings base. Loss carry forwards are indicated in the corresponding fields for pending negative balances.

Cleriontax: Maximise Your Crypto Loss Offsets

At Cleriontax, we don't just calculate your capital gains and losses: we optimise the offsetting strategy so you pay exactly what you owe, not a euro more.

Our service includes:

Precise calculation of all gains and losses applying FIFO correctly, with professional data cleaning and classification of each operation.

Verification of anti-avoidance rule compliance for each loss-making operation.

Optimal calculation of cross-compartment offsetting and loss carry forwards.

Detailed tax report ready for your income tax return.

Advisory on tax loss harvesting strategies tailored to your situation.

Request your optimised tax report →

Every euro of uncompensated loss is a tax saving you're leaving on the table. Contact our team.

Disclaimer: This article is for informational and educational purposes only. It does not constitute personalised tax advice or investment recommendation. Tax regulations are subject to change. Always consult a qualified professional for your specific case.

Last updated: March 2026

Published by: Cleriontax Team — Cryptocurrency Tax and Data Analysis Experts

Did you find this article helpful?

Share it with other investors who might need it

Need help with your cryptocurrency tax return?

Our team of experts can analyze your case and prepare your complete tax return

Request free analysis