HOME / FINANCE & ECONOMICS / BLOCKCHAIN & CRYPTO / CRYPTO COST BASIS CALCULATOR (FIFO/LIFO/HIFO)
Finance & Economics / Blockchain & Crypto

Crypto Cost Basis Calculator (FIFO/LIFO/HIFO)

Purchases (lots)

Total held: 1.2 coins. Include purchase fees in the price: they are part of your cost basis.

Your ordinary income bracket

US federal: 0%, 15% or 20%

Comparison

MethodCost basisShort-term gainLong-term gainEst. tax
FIFO$12,200.00$0.00$56,800.00$8,520.00
LIFO$42,600.00$10,800.00$15,600.00$4,716.00
HIFO$42,600.00$10,800.00$15,600.00$4,716.00

Lowest estimated tax here: LIFO (last in, first out: newest coins sold first).

Proceeds: $69,000.00. Gains held more than one year are long-term. Losses show as negative gains and are not taxed here (they can offset other gains).

Which lots each method sells

FIFO

  • 0.5 from 2023-01-10 @ $17,000.00 (long-term, 979 days)
  • 0.1 from 2023-11-20 @ $37,000.00 (long-term, 665 days)

LIFO

  • 0.4 from 2025-03-05 @ $88,000.00 (short-term, 194 days)
  • 0.2 from 2023-11-20 @ $37,000.00 (long-term, 665 days)

HIFO

  • 0.4 from 2025-03-05 @ $88,000.00 (short-term, 194 days)
  • 0.2 from 2023-11-20 @ $37,000.00 (long-term, 665 days)
In the US, FIFO applies unless you specifically identify which units you sold, which LIFO and HIFO require you to do at the time of sale with records that support it. From 2025, cost basis must be tracked separately for each wallet or exchange account. Tax figures are federal estimates at the rates you entered; state tax and the 3.8% net investment income tax are not included. Confirm with a tax professional.

Sale on September 15, 2025.

Compare the cost basis, short- and long-term capital gains and estimated tax of a crypto sale under FIFO, LIFO and HIFO, from your purchase lots and the sale, and see exactly which lots each method sells.

Formula

Gain=proceeds−cost basis of the lots sold\text{Gain} = \text{proceeds} - \text{cost basis of the lots sold}
held more than1year=long-term\text{held more than} 1 \text{year} = \text{long-term}
tax=short-term gain×ordinary rate+long-term gain×long-term rate\text{tax} = \text{short-term gain} \times \text{ordinary rate} + \text{long-term gain} \times \text{long-term rate}

Worked Example

Lots0.5 coin at $17,000 (Jan 2023), 0.3 at $37,000 (Nov 2023), 0.4 at $88,000 (Mar 2025)
Sale0.6 coin at $115,000 on September 15, 2025
Tax rates22% short-term, 15% long-term
Result
FIFO$56,800 long-term gain, $8,520 tax
LIFO and HIFO$10,800 short-term + $15,600 long-term, $4,716 tax

FIFO sells the cheapest, oldest coins, so the basis is only $12,200 on $69,000 of proceeds. Selling the $88,000 lot first raises the basis to $42,600: part of the gain becomes short-term at 22%, but the total gain is so much smaller that the tax falls by $3,804.

Frequently Asked Questions

Which cost basis method can I use for crypto in the US?

FIFO applies unless you specifically identify the units you sold. Methods such as HIFO or LIFO are forms of specific identification and require you to identify the lots at or before the time of the sale and keep records; since 2025 this is tracked wallet by wallet or account by account.

What is the difference between short-term and long-term crypto gains?

Coins held for one year or less produce short-term gains, taxed at ordinary income rates of up to 37%. Coins held longer produce long-term gains, taxed at 0%, 15% or 20% federally, plus the 3.8% net investment income tax for high earners.

Is HIFO always the lowest-tax method?

It minimizes the gain on the current sale, but not always the tax: a high-cost lot may be short-term and taxed at a higher rate, and using up high-basis lots now leaves low-basis lots, and larger gains, for later sales.