Crypto cost basis calculator: FIFO, LIFO or HIFO, which saves more?
Worked example. Three Bitcoin lots: 0.4 BTC bought January 2024 at $45,000, 0.3 BTC bought March 2025 at $85,000 and 0.3 BTC bought June 2026 at $110,000. On December 1, 2026 you sell 0.5 BTC at $100,000, so proceeds are $50,000 (prices are illustrative, no fees).
| Method | Lots sold | Cost basis | Gain / loss | Term |
|---|---|---|---|---|
| FIFO | 0.4 from Jan 2024, 0.1 from Mar 2025 | $26,500 | $23,500 gain | All long term |
| HIFO | 0.3 from Jun 2026, 0.2 from Mar 2025 | $50,000 | $0 net | $3,000 short-term loss, $3,000 long-term gain |
HIFO saves the most this year because it sells the costliest coins first, but it leaves your cheapest lots for later sales, and a mixed result like the one above changes which tax rate applies. At an exchange, a method only counts if you identify the units to the broker by the time of the sale. Try your own lots below.
- Paste your buys of one coin, one per line: date, quantity, price per coin and an optional fee. The sample shows the format.
- Enter the sale: date, quantity, price per coin and fee.
- Compare the four methods in the table. Tap a method to see which lots it used; for specific ID, list the lot numbers to sell from.
Dates as 2024-02-01 or 02/01/2024. Pasting from a spreadsheet works (tab separated). Lot numbers follow line order.
| Method | Proceeds | Cost basis | Gain or loss | Short term | Long term |
|---|---|---|---|---|---|
| FIFO (first in, first out) | $60,000.00 | $15,300.00 | $44,700.00 | $0.00 | $44,700.00 |
| LIFO (last in, first out) | $60,000.00 | $42,400.00 | $17,600.00 | $17,600.00 | $0.00 |
| HIFO (highest cost first) | $60,000.00 | $45,000.00 | $15,000.00 | $3,600.00 | $11,400.00 |
| Specific ID (lots you pick) | $60,000.00 | $14,800.00 | $45,200.00 | $14,000.00 | $31,200.00 |
- Lot 1 (2023-03-10): 0.5 coins, basis $11,000.00, long term, $39,000.00
- Lot 2 (2024-02-01): 0.1 coins, basis $4,300.00, long term, $5,700.00
Track this in Hodl1099
Import your Coinbase, Kraken, Crypto.com, Gemini or Robinhood CSV and Hodl1099 keeps every lot wallet by wallet, then builds your Form 8949 lines. Free for up to 15 transactions per tax year.
This is an estimate, not tax advice. It runs in your browser and nothing you type is sent to us.
How the calculation works
This crypto cost basis calculator treats each line you paste as a lot. Its basis is quantity times price plus the fee. When you sell, the calculator takes coins from lots in the order the method sets, uses each lot’s cost per coin for the part it sells, and splits the sale proceeds (after the sale fee) across those lots by quantity.
- FIFO sells the oldest lots first. It is the default when you do not identify the units sold.
- LIFO sells the newest lots first.
- HIFO sells the lots with the highest cost per coin first, which usually gives the smallest gain.
- Specific ID sells from the lots you name, in the order you list them.
A lot sold more than one year after it was acquired is long term; otherwise it is short term. The same rule drives the holding period calculator.
Limits
This page handles one coin and one sale at a time. It ignores lots dated after the sale and flags a sale larger than your lots. It does not know which wallet each lot sits in: from 2025 the IRS expects basis to be tracked wallet by wallet, so a lot in one wallet cannot cover a sale from another. Hodl1099 itself tracks lots per wallet, carries basis across transfers between your own wallets and handles every sale in the year.
Sources: IRS virtual currency FAQs 8, 39, 40 and 41 (basis, specific identification, FIFO default) and Topic 409 (holding period).
Questions
What is cost basis for crypto?
It is what you paid to get the coins, including fees. The IRS describes basis as the amount you spent to acquire the virtual currency. Your gain or loss on a sale is the proceeds minus the basis of the units you sold.
Which method does the IRS use if I do not pick one?
If you do not identify which units you sold, IRS guidance treats them as sold in chronological order, oldest first. That is FIFO.
Can I use HIFO or LIFO for crypto?
HIFO and LIFO are ways of choosing lots under specific identification, which the IRS allows when you can identify the units sold and document their basis. For coins held at an exchange, ask the exchange which method it applies, because from 2025 sales its 1099-DA follows its own records.
Does the calculator include fees?
Yes. A buy fee is added to that lot’s basis, and the sale fee is subtracted from proceeds and shared across the lots used.
Why does the method change short-term and long-term gains?
Each lot keeps its own purchase date. FIFO tends to sell older lots that are more likely to be long term, while LIFO and HIFO often sell newer lots that may be short term.
More free crypto tax tools
- Crypto capital gains tax calculator (2026) Estimate 2026 federal tax on short-term and long-term crypto gains with the IRS 2026 brackets and 0%, 15%, 20% rates.
- Crypto tax-loss harvesting calculator See how harvested short-term and long-term losses offset your gains, what they save, and what carries over.
- Crypto holding period calculator Check whether a sale is short term or long term and the first day each lot turns long term.