Crypto Cost Basis Calculator
Bought crypto at different prices and sold some? Add each buy, enter how much you sold and at what price, then pick a method to see the cost basis, proceeds and realized gain or loss. Switch between FIFO, LIFO, HIFO and average cost to compare.
How to calculate your crypto cost basis
- Add a buy row for each purchase with the amount of crypto and the price you paid per unit.
- Enter how many units you sold and the sale price per unit.
- Choose a method (FIFO, LIFO, HIFO or average) to read off the cost basis, proceeds and gain or loss.
Examples
Two buys, one unit sold
Buy 1 unit at $100, buy 1 unit at $200, then sell 1 unit at $250.
FIFO: cost basis $100, gain $150. LIFO and HIFO: cost basis $200, gain $50. Average: cost basis $150, gain $100.
Selling part of a larger position
Buy 2 units at $10 and 2 units at $20, then sell 3 units at $30 using FIFO.
Cost basis $40, proceeds $90, gain $50, with 1 unit still held.
Frequently asked questions
What is cost basis for crypto?
Cost basis is what you originally paid for the units you sold, including the price per unit. You subtract it from your sale proceeds to find the capital gain or loss that may be taxable.
What is the difference between FIFO, LIFO, HIFO and average cost?
FIFO sells your oldest units first, LIFO sells the newest first, and HIFO sells the highest-cost units first to minimize the reported gain. Average cost spreads the weighted-average purchase price across every unit. The method changes the cost basis, so the gain or loss differs.
Which method should I use?
It depends on your jurisdiction and which methods your tax authority allows. Some require FIFO, others permit specific identification such as HIFO. This tool lets you compare them, but check your local rules before filing.
Is this tax advice?
No. This calculator is for general information and estimation only. It is not tax, legal or financial advice. Tax treatment of crypto varies by country and situation, so consult a qualified professional before relying on these numbers.
Is my data private?
Yes. Every calculation runs entirely in your browser. Your buy amounts, prices and sale details are never sent to a server or stored anywhere.
Does it include fees, staking income or multiple coins?
Not automatically. To fold in trading fees, add them to a buy's price or subtract from the sale price. The tool covers a single asset and one sale at a time; income such as staking or airdrops is handled separately for tax.
Related tools
Stock Average Calculator
Work out the average cost of a stock across multiple buys. Add each purchase to see your cost basis, total shares, and profit or loss.
ROI Calculator
Calculate return on investment online. Enter the cost and final value to get your ROI percentage, net profit and an annualized return over any period.
Income Tax Calculator
Estimate your 2025 US federal income tax. Enter income and filing status to see taxable income, tax owed, effective rate and take-home pay.
401(k) Calculator
Project your 401(k) balance with employer match. Enter salary, contribution, match and return to see your contributions, the match and growth over time.
Amortization Schedule Calculator
Build a full loan amortization schedule. Enter the amount, rate and term to see each month's payment, principal, interest and balance, plus total interest.
Annuity Calculator
Calculate the present and future value of an annuity. Enter a payment, rate per period and number of periods for ordinary or annuity due timing.