Skip to main content
Crypto tax tool

Crypto Cost Basis Calculator

FIFO, LIFO, HIFO — side by side. No sign-up, nothing saved. Updated for 2026.

Free tool

Crypto Cost Basis Calculator

Enter each lot you bought, then the sale. FIFO, LIFO, and HIFO are computed in parallel so you can see which method produces the lowest taxable gain for your situation.

Purchase lots

Sale details

Result · FIFO

Proceeds
—
Cost basis
—
Gain / loss
—
Avg cost / unit
—

This calculator tracks cost basis only. Tax owed depends on your country, income, and holding period — use the Capital Gains Calculator for the full tax estimate.

What cost basis is

Cost basis is what you paid for the crypto you're selling — purchase price per unit plus any fees you paid to acquire it. When you later dispose of that crypto, your taxable gain (or loss) is the proceeds you received minus the cost basis of the units you sold. Pick the wrong basis and you either overpay tax or underreport — both are expensive.

FIFO, LIFO, HIFO — the three methods

If you've bought the same coin at different prices on different days, each buy is a “lot”. When you sell part of your holding, you have to pick which lots the sold units came from. The method you choose decides which lots feed the sale and therefore your cost basis.

  • FIFO (first in, first out) — oldest lots go first. Common default in US tax reporting and used by the IRS when you don't specifically identify lots.
  • LIFO (last in, first out) — newest lots go first. Useful when prices have been rising and you want the most-recent (higher) basis against the sale.
  • HIFO (highest in, first out) — the lots with the highest cost per unit go first. Usually produces the lowest taxable gain in a volatile market. HIFO is a specific identification method under US rules — it's only valid if you can prove you identified the lots at the time of the sale (your exchange or tax software needs to track it).

Which method should you use?

There's no universal answer. HIFO is often the cheapest for a one-off sale in a rising market, but it requires specific identification and some brokers won't let you report that way on a 1099-DA. For 2025 and later tax years in the US, cost basis has to be tracked per wallet (not aggregated across your whole stack) — a change from the pre-2025 universal method. If you're unsure, run all three in the calculator above, note which produces the lowest gain, and confirm the eligibility of your preferred method with a tax professional before you file.

Related reading