Web3 & Crypto· 5 min read

Crypto Tax Calculator: FIFO, LIFO, and HIFO Capital Gains

Learn how to compute realized gains on crypto trades using three lot-matching methods and estimate your tax liability.

By EasyCrypto Team Last updated: 2026-08-18.

Why this matters

Tax authorities around the world increasingly treat cryptocurrency as taxable property. Every time you sell, trade, or convert one token for another, you trigger a taxable event that must be reported. Failing to calculate your gains correctly can lead to penalties, interest charges, and audit flags that are costly and time-consuming to resolve.

The challenge is that crypto traders rarely buy and sell a single lot. You might accumulate Bitcoin over dozens of purchases at different prices across months or years. When you sell a fraction of your holdings, which cost basis applies? The lot-matching method you choose — FIFO, LIFO, or HIFO — can meaningfully change your reported gain and the tax you owe.

Understanding these methods lets you make informed decisions before filing. You can model different scenarios, see which method minimizes your tax burden, and verify that your exchange-generated tax report is accurate. This is especially important for active traders who execute hundreds of transactions per year across multiple pairs and exchanges.

See it in action

Lot-matching methods compared

MethodMatching RuleTypical Effect on Gain
FIFOOldest lots firstHigher gain (older lots often cheaper)
LIFONewest lots firstLower gain (recent lots often pricier)
HIFOHighest-cost lots firstLowest gain (maximizes deductible cost)

How to use it

Enter each buy lot with its date, the number of units acquired, and the price per unit at the time of purchase.

Enter each sell event with its date, the number of units sold, and the price per unit received.

Choose a lot-matching method from the FIFO, LIFO, or HIFO options provided.

Set your short-term and long-term capital gains tax rates to get a quick liability estimate.

Review the detailed result card showing every matched lot, cost basis, proceeds, and realized gain per sale.

Testing your result

Start with a simple two-lot scenario to verify the math manually. Buy 1 BTC at 20,000, buy 1 BTC at 30,000, then sell 1 BTC at 40,000. Under FIFO the cost basis is 20,000 and the gain is 20,000. Under LIFO the basis is 30,000 and the gain drops to 10,000. Under HIFO the result matches LIFO because the 30,000 lot has the highest cost.

Next, verify the short-term versus long-term classification. If you held the 20,000 lot for over a year before selling, it should be flagged as long-term. If you held the 30,000 lot for only six months, it should appear as short-term. Confirm that the tax estimate applies the correct rate to each bucket and that the sum matches your manual calculation.

Common mistakes

Forgetting to account for transaction fees by not rolling them into the per-unit buy price or deducting them from sell proceeds.

Assuming FIFO is always required — many jurisdictions allow LIFO or HIFO, though the IRS in the US currently requires specific identification when possible.

Mixing trades from different assets instead of tracking each token's lots separately.

Ignoring staking rewards and airdrops, which may create taxable income at the time of receipt in some jurisdictions.

Edge cases and options

If you sell more units in a single event than any one lot contains, the tool automatically draws from the next matching lot. For example, selling 1.5 BTC against two 1 BTC lots will consume the first lot entirely and take 0.5 from the second. The result card shows this partial match clearly so you can trace every unit.

The tax estimate is deliberately simplified. Real tax liability depends on your total income, filing status, other capital losses carried forward, and jurisdiction-specific rules like wash sale provisions. Use the estimate as a planning tool, not a substitute for professional tax advice. The detailed lot-matching output is what matters most — hand that to your accountant.

Real-world use cases

A day trader who executes dozens of swaps on a DEX each week needs to identify which cost basis applies to every partial sell, and compare HIFO against FIFO to find the lower tax scenario before filing.

A long-term holder who bought ETH at three different price points over two years wants to see which lots will be classified as long-term versus short-term if they sell today.

A tax preparer verifying that a client's exchange-generated 1099 matches the actual lot-level detail, catching discrepancies before the IRS does.

Frequently asked questions

Q: What is the difference between FIFO, LIFO, and HIFO?

A: FIFO matches the oldest lots first, which often have a lower cost basis and therefore produce a higher reported gain. LIFO matches the newest lots first. HIFO matches the highest-cost lots first, minimizing reported gain. Tax authorities may restrict which method you can use, so always check your local rules.


Q: Does this handle short-term vs. long-term gains?

A: Yes. Each sale is flagged as short-term (held one year or less) or long-term (held longer than one year) based on the buy date of the matched lot versus the sell date. Long-term gains typically qualify for lower tax rates in most jurisdictions.


Q: How is the tax estimate computed?

A: Short-term gains are multiplied by your short-term rate and long-term gains by your long-term rate, both of which are editable. This is a simplified estimate. Actual tax liability depends on your total income, jurisdiction, losses carried forward, and other factors.


Q: Can I export the lot-matching detail?

A: The result card lists each sell event with its matched lots, units, cost basis, proceeds, and gain. You can copy or screenshot the detail for your records or to share with your accountant.


Q: Does this account for transaction fees?

A: Not by default. You can include fees by adding them to the price per unit on buys (increasing your cost basis) and subtracting them from the price per unit on sells (reducing your proceeds).


Q: What if I have trades from multiple tokens?

A: Track each token separately since lots from one asset cannot offset gains from another. Run the calculator once per token and sum the results for your total capital gains picture.

Start using it now

Try the Crypto Tax Calculator tool. See also Stock Profit Calculator, DCA Calculator, and Staking Rewards Calculator.

Need help using this tool?

Read our complete Crypto Tax Calculator tutorial for step-by-step guidance.

Ready to try the tool?

No accounts. No uploads. No limits. Start now.