Crypto Cost Basis Calculator
Calculate your gain or loss using FIFO, LIFO, or HIFO — and instantly compare which method saves you the most tax.
This calculator is for estimation purposes only and does not constitute tax or legal advice. Always verify cost basis method rules with a qualified adviser in your country.
Most people underestimate how much the cost basis method affects their tax bill. Two investors can make the exact same trades, hold the exact same coins, and end up with completely different crypto tax liabilities — just because they used different accounting methods when calculating their gains. This calculator lets you run your numbers through all three methods and see the difference side by side, so you can make an informed decision before you file or sell.
Cost basis is the original price you paid for your crypto, including any fees at the time of purchase. When you sell, your taxable gain is simply the difference between what you received and that original cost. The complication arises when you’ve bought the same asset multiple times at different prices. In that situation, the order in which you assign those purchases to your sale determines how large your gain appears on paper — and different countries permit different methods for doing this. Taxable events are actually matters when you are about to calculate your crypto basis and send it to the accountant.
Add your purchase lots, enter your sale details, and the calculator will show you what your gain or loss looks like under FIFO, LIFO, and HIFO. It also highlights which method produces the lowest taxable gain for your specific situation, which is usually the most useful thing to know.
How to use this calculator
Start by adding your purchase lots in the top section. Each lot needs three things: the date you bought, the quantity you purchased, and the price you paid per unit at the time. If you bought Bitcoin in three separate transactions over two years, that’s three separate lots. The calculator treats each purchase independently, which is exactly how tax authorities expect you to track it.
Then fill in your sale details — how many units you sold, the price you sold at, and any fees the exchange charged on the transaction. Fees on the sale side reduce your proceeds, which in turn reduces your gain, so they’re worth including. Select your currency and the sale date, then choose a cost basis method. The results update instantly, and the comparison panel at the bottom runs all three methods simultaneously so you can see the difference without switching back and forth.
The lot-by-lot table at the bottom shows exactly which purchases were consumed by your sale, in the order the selected method dictates. Lots marked as sold were fully used. Partial means only some of that lot was needed. Remaining means the method didn’t touch that lot at all — those units are still in your portfolio with their original cost basis intact.
The three cost basis methods explained
FIFO — first in, first out
FIFO assumes you’re selling the oldest coins you own first. If you bought 0.5 BTC in January 2022 and another 0.5 BTC in June 2023, and then you sell 0.5 BTC today, FIFO says the coins you sold were the ones from January 2022. The cost basis used for the sale is therefore the January 2022 purchase price, not the June 2023 one.
This matters because in a market that has generally risen over time, your oldest purchases tend to have the lowest cost basis — meaning FIFO often produces the largest taxable gain. That sounds like a disadvantage, but it also means you’re more likely to be selling long-held assets, which in countries like the US and Australia qualifies you for lower long-term tax rates. FIFO is the default method accepted by tax authorities in all four countries this calculator covers, and it’s the one most accountants reach for first because it’s easy to justify and audit.
If you haven’t specifically chosen a different method and kept detailed records to back it up, tax authorities in most countries will assume you’re using FIFO. It’s the fallback, and in many cases it’s perfectly fine — especially if your oldest purchases were made at prices significantly lower than your more recent ones and you’ve held them long enough to qualify for preferential rates.
LIFO — last in, first out
LIFO flips the logic: it assumes you’re selling the most recently purchased coins first. Using the same example, if you bought in January 2022 and June 2023, a LIFO sale today would use the June 2023 purchase as the cost basis. If the market has risen since June 2023, that higher cost basis reduces your gain compared to using the January 2022 price.
In a market that’s been climbing, LIFO consistently produces lower gains than FIFO, which is why some investors prefer it. The catch is that LIFO is only permitted in the United States and Canada for crypto. The UK and Australia do not allow it — HMRC and the ATO require specific methods (share pooling in the UK, and either FIFO or another approved method in Australia), and LIFO doesn’t fit within those frameworks. If you’re a UK or Australian investor, the LIFO figure in this calculator is shown for comparison purposes only, not as a filing option.
Even in the US, using LIFO requires you to document it consistently and be able to demonstrate it to the IRS if asked. Switching between methods from year to year is not permitted without proper justification, so if you start with LIFO it’s worth sticking with it and keeping thorough records from the beginning.
HIFO — highest cost first
HIFO takes a different approach entirely. Rather than ordering by date, it orders your lots by price — highest purchase price first. When you sell, it automatically reaches for whichever lot cost you the most, regardless of when you bought it. The logic is straightforward: the higher your cost basis, the smaller your gain, so selling high-cost lots first minimises the tax you owe on each sale.
In most scenarios, HIFO produces the lowest taxable gain of the three methods. This is why it’s popular among active traders and people with large portfolios bought across many market cycles. In the US, HIFO is permitted under the specific identification rules — you need to identify which lots you’re selling at the time of the sale and maintain records that support it. The IRS doesn’t require pre-approval, but your records need to be solid enough to hold up if questioned.
HIFO is not explicitly recognised as a named method in the UK or Australia. The UK uses a share pooling system called Section 104 pooling, which averages the cost basis across all holdings rather than identifying individual lots. Australia generally follows FIFO or allows specific identification in certain circumstances. If you’re outside the US, treat the HIFO result as a useful benchmark for understanding your best-case scenario, but confirm with a local tax adviser what’s actually permitted in your situation.
Why the method you choose can make a meaningful difference
To make this concrete, imagine you bought 1 Bitcoin three times: once at $20,000, once at $40,000, and once at $60,000. You now sell 1 Bitcoin at $65,000. Under FIFO, you’d use the $20,000 lot, producing a $45,000 gain. Under HIFO, you’d use the $60,000 lot, producing only a $5,000 gain. The tax on $45,000 versus the tax on $5,000 is not a small difference — it could easily be thousands of dollars depending on your rate. Same trade, same outcome, completely different tax bill. That’s why the method matters, and it’s why this calculator shows you all three at once rather than forcing you to pick one and hope for the best.
The comparison is even more dramatic when you have many lots spread across different market cycles, which is the reality for most long-term crypto holders. Someone who dollar-cost averaged into Bitcoin monthly from 2020 to 2024 has dozens of purchase lots at vastly different prices. The difference between selling the cheapest lots first (FIFO in a rising market) versus the most expensive lots first (HIFO) compounds across every sale they make throughout the year.
Frequently asked questions
Can I change my cost basis method each year?
Generally, no. Tax authorities expect consistency, and switching methods between years to reduce your bill is something they look for. In the US, you can change your method, but you need to apply the new method going forward and document the change. You can’t retroactively restate prior years using a different method. The practical advice is to choose a method at the start, understand why you chose it, and stick with it — ideally with the help of a tax adviser who can document the decision properly.
What counts as a separate purchase lot?
Every transaction where you acquired crypto at a specific price is its own lot. Buying 0.1 ETH on Monday and another 0.1 ETH on Thursday at a different price gives you two lots, even though they’re the same asset. This applies to purchases on exchanges, but it also applies to crypto received as staking rewards, airdrops, or payment for work — each of those creates a new lot with a cost basis equal to the market value on the date you received it. The more meticulously you track each individual acquisition, the more control you have over your cost basis method.
What if I transferred coins between wallets or exchanges?
Transfers between wallets you own don’t create a new lot or reset your cost basis. The original purchase date and price follow the coins wherever they go. What matters is when you first acquired them and what you paid. The complication arises when exchanges don’t retain your full history, or when you move coins to a wallet and the exchange loses track of the original cost basis. This is increasingly common with the new Form 1099-DA reporting in the US, where exchanges may report proceeds without knowing your original cost. Keeping your own records of every acquisition — date, quantity, price, and where it was held — protects you against this.
Does this calculator work for all cryptocurrencies, not just Bitcoin?
Yes. The cost basis calculation works identically for every cryptocurrency — Bitcoin, Ethereum, Solana, or any other token. You enter the prices and quantities specific to whatever asset you’re tracking, and the method logic applies the same way regardless of which coin it is. If you hold multiple different assets and sold several of them in the same year, you’d run each asset through the calculator separately, since cost basis is tracked per asset rather than across your whole portfolio.
What happens to the lots I didn’t sell?
The lots that weren’t consumed by your sale retain their original cost basis and date. They sit in your portfolio exactly as before, and the next time you sell, the same method logic kicks in again using whatever remains. This is important to think about when choosing a method, because the order you sell in today affects the composition of what’s left for future sales. If HIFO removes all your high-cost lots this year, next year’s sales will be calculated against lower-cost lots — which means potentially larger gains down the line. There’s no perfect answer; it depends on your holding plans and what you expect the market to do.
How accurate are these calculations?
The calculator applies the correct mathematical logic for each method — the gain figures are accurate based on the numbers you enter. What it doesn’t account for is any adjustment for prior-year loss carryforwards, wash sale rules (where applicable), or the interaction between your crypto gains and other capital gains you may have in the same year. For a straightforward buy-sell situation with clean records, the numbers will match what you’d calculate manually. For anything involving transferred wallets, DeFi activity, staking income mixed in with trading gains, or large portfolios spanning many years, a tax professional who specialises in crypto is worth the cost.
A note on record keeping
The single most valuable thing you can do as a crypto investor — more than choosing the right method, more than timing your sales — is keeping complete records. Every purchase, every sale, every transfer, every staking reward. Date, quantity, price, platform. This sounds tedious, and for active traders it genuinely is, but it’s the foundation that every cost basis method sits on. Without it, you’re estimating, and tax authorities don’t accept estimates. The cost basis method you choose is only as defensible as the records you have to back it up.

I’m Eric Nkando, a crypto and crypto tax enthusiast, with other extensive experiences in forex and stock markets. I believe crypto and blockchain are no longer alien topics and I’m here to help investors tackle emerging issues of taxation and prudential investment strategies. My approach? Delivering clear, insightful analysis on digital assets, market trends, and trading strategies, bridging complex technical concepts with practical investment perspectives. My work has been widely published on leading financial platforms such as Investing.com, FXLeaders, and The Distributed.

