Crypto Cost Basis HIFO Calculator
Work out the cost basis of a crypto sale under the highest in first out method and what is left in your holdings.
Enter your numbers
Example: 2
Example: 31500
Example: 1.5
Example: 42750
Example: 2.5
Recent
Formula
How the calculation works
The calculator ranks your buy lots from the most expensive unit price down to the cheapest.
It sells from the top of that list until the quantity sold is covered, so the dearest units leave first.
It reports the cost basis that leaves with those units and the basis that stays behind in your remaining holdings.
Common mistakes
- Using HIFO while the exchange or your tax authority requires average cost, which makes the reported gain wrong.
- Selling more units than you hold and ignoring that the basis cannot exceed the total you actually paid.
When to use it
- Use it before filing when you want to minimise a realised crypto gain by choosing which lots to sell.
- Do not use it as a tax return, because your jurisdiction may force average cost or a specific lot tracking rule.
Worked example
With 2 units at 31,500 and 1.5 units at 42,750, selling 2.5 units gives a HIFO cost basis of 95,625, an average cost of 38,250 per unit, 1 unit remaining worth 31,500 of basis.
Common questions
Why use HIFO instead of average cost?
HIFO sells your most expensive units first, which raises the recorded cost basis and lowers the taxable gain on that sale.
Related tools
-
Dividend Yield
The yield a dividend pays against today's price, and against what you actually paid for it.
-
Crypto Profit
Profit on a trade from the buy and sell prices, with fees taken off, in money and in percent.
-
FIRE Number
The pot that lets investment income cover your spending for good.
-
Mutual Fund Target
What a fixed monthly investment grows to over a set number of years.
-
Fund and Bond Blend
The blended return and end value of a fund-and-bond mix.
-
Compound Annual Growth Rate (CAGR) Calculator
Find the compound annual growth rate that turns a starting value into an ending value over a set number of years.
-
Crypto Futures PnL Calculator
Work out the gross and net profit or loss of a leveraged crypto futures trade, including trading fees and the return on your margin.
-
Dividend Yield Calculator
Find the dividend yield on a share and the yearly and quarterly income your holding produces.