Kointax.ioKointax.io

Crypto Gains Calculator for Income Tax: How the FIFO Method Works

How to calculate cryptocurrency gains and losses for income tax using the FIFO method. Practical examples with BTC, ETH, and stablecoins.

Equipo declaracrypto·April 24, 2026·8 min read

Crypto Gains Calculator for Income Tax: How the FIFO Method Works

Calculating cryptocurrency gains for income tax is not as complicated as it seems if you understand the FIFO method. This guide explains the mechanism with real examples and shows you why an automated calculator is essential when you have more than just a few transactions.

What is the FIFO Method and Why Is It Mandatory in [Target Country]

FIFO (First In, First Out) means that when you sell a cryptocurrency, the cost assigned to the units sold is that of the first units you purchased.

The [Tax Authority] established this in binding consultation V0999-18: cryptocurrencies are "homogeneous goods" and fall under Article 37.1a of the [Income Tax Law], which mandates the FIFO method.

You cannot choose LIFO or WAC for income tax purposes, even if your platform offers them as options. FIFO is the only valid method before the [Tax Agency].

Basic Example: FIFO Calculation with Bitcoin

Let's assume the following transaction history:

DateTransactionQuantityUnit PriceAmount
03/15/2022Buy0.5 BTC€38,000€19,000
07/10/2023Buy0.3 BTC€26,000€7,800
11/20/2023Buy0.2 BTC€34,000€6,800
04/05/2024Sell0.6 BTC€58,000€34,800

Step 1: Identify the Units Sold with FIFO

We sell 0.6 BTC. Using FIFO, we assign the cost of the oldest lots:

  • From Lot 1 (03/15/2022): use 0.5 BTC × €38,000 = €19,000
  • From Lot 2 (07/10/2023): use 0.1 BTC × €26,000 = €2,600
  • Total Acquisition Cost: €21,600

Step 2: Calculate the Gain

  • Sale Value: €34,800
  • FIFO Acquisition Cost: €21,600
  • Capital Gain: €13,200

Step 3: Apply the Tax Rate (2024)

Savings Base BracketRateAmount
First €6,00019%€1,140
Next €7,200 (up to €13,200)21%€1,512
Total Tax Due€2,652

Step 4: Update the FIFO Inventory

After the sale, the remaining inventory is:

  • 0.2 BTC from Lot 2 at €26,000 (0.2 remaining from the original 0.3)
  • 0.2 BTC from Lot 3 at €34,000
  • Total: 0.4 BTC with a pending acquisition cost of €5,200 + €6,800 = €12,000

Why Manual Calculation Is Unfeasible with Multiple Exchanges

The above example involves 4 transactions. The average investor in [Target Country] has:

  • 3-5 different exchanges
  • 50-200 annual transactions
  • Multiple cryptocurrencies with overlapping histories
  • Fees paid in the cryptocurrency itself
  • Transfers between personal wallets

With each purchase of a small fraction of BTC at different times, the FIFO inventory turns into dozens of lots. The most common mistake is calculating only by cryptocurrency, without considering the complete history from the first purchase.

The Problem with Swaps Between Cryptocurrencies

If you exchange BTC for ETH (swap), two taxable events occur simultaneously:

  1. Sale of BTC: generates a gain or loss based on the FIFO cost of that BTC.
  2. Purchase of ETH: the ETH received enters your inventory at the market price at that moment (which will be its future acquisition cost).

A proper FIFO calculator must handle these swaps automatically.

What a Good FIFO Calculator for Income Tax Should Include

  • ✅ Complete transaction history from the first purchase (not just the current year)
  • ✅ Purchase fees added to the acquisition cost
  • ✅ Sale fees deducted from the sale value
  • ✅ Automatic conversion of USD/USDT to [Local Currency] using [Central Bank] exchange rates
  • ✅ Crypto-to-crypto swaps treated as dual transactions
  • ✅ Staking and rewards valued at market price on the receipt date
  • ✅ Export to income tax fields (e.g., 1626, 1627)
  • ✅ Data generation for Forms 172 and 173

Calculation Results: What You Need for Filing

At the end of the calculation process, you need:

  1. Sum of all capital gains for the fiscal year (e.g., field 1626 in income tax)
  2. Sum of all capital losses (e.g., field 1627)
  3. Net gain to include in the savings base
  4. Balance of losses to offset (if the result is negative)
  5. For Form 172: balance of each cryptocurrency and exchange as of 12/31
  6. For Form 173: summary of transactions by exchange

Updated: April 2026 | Tax Year: 2025

Ready to calculate your crypto taxes?

Connect your exchanges, import your history and generate your IRPF report in minutes.

Start free — no card needed