Skip to content
Browser Tools

How to Calculate Crypto Capital Gains Tax (FIFO, LIFO, HIFO)

How crypto gains are worked out: cost basis, fees, short vs long-term holding, and how FIFO, LIFO and HIFO change your tax, with a simple worked example.

By Browser Tools Team · · 3 min read

Open the free Crypto Capital GainsFIFO, LIFO and HIFO gains and tax. Runs in your browser.

To calculate a crypto capital gain, subtract the cost of the coins you sold (what you paid plus fees) from what you got for them (minus fees). Which coins count as "sold" depends on your cost-basis method, such as FIFO, LIFO or HIFO, and how long you held them decides whether the gain is short-term or long-term. The Crypto Capital Gains Calculator does all of this from a list of your trades, without uploading anything.

This guide is educational, not tax advice. Rules differ by country and change over time.

What counts as cost basis and proceeds?

  • Cost basis: the price you paid for the coins, plus buying fees.
  • Proceeds: what you received when you sold, minus selling fees.
  • Gain or loss = proceeds − cost basis.

Fees matter: they increase your cost and reduce your proceeds, so they lower your gain.

A worked example: why the method matters

You make three trades in Bitcoin (fees left out to keep it simple):

Date Type Quantity Price
Jan 2024 Buy 1 BTC 30,000
Mar 2025 Buy 1 BTC 40,000
Oct 2025 Sell 1 BTC 60,000

Which Bitcoin did you sell?

  • FIFO (first in, first out) uses the oldest purchase: cost 30,000. Gain = 30,000. It was held about 21 months, so it's long-term.
  • LIFO (last in, first out) uses the newest purchase: cost 40,000. Gain = 20,000. Held 7 months: short-term.
  • HIFO (highest cost first) uses the most expensive purchase, which here is also the 40,000 one: gain 20,000, short-term.

With the calculator's default rates (24% short-term, 15% long-term), FIFO gives an estimated tax of 4,500 and LIFO 4,800. A smaller gain isn't always less tax: the holding period changes the rate.

What are short-term and long-term gains?

In the US, coins held for one year or less produce short-term gains taxed like ordinary income; coins held longer than one year get lower long-term rates. Many other countries treat holding periods differently or not at all. The calculator splits every sale into short-term (held 365 days or less) and long-term, and lets you set your own rates for each.

Which method can you use?

That depends on where you pay tax:

  • US: FIFO applies unless you specifically identify which units you sold, which requires good records. Since 2025, cost basis has to be tracked per wallet or account. Check current IRS guidance.
  • UK: HMRC doesn't use FIFO or LIFO. Tokens are pooled under special rules (same-day, the next 30 days, then an average-cost pool). The calculator's methods won't match UK rules exactly; use it as a rough guide only.
  • Other countries: rules vary. India, for example, taxes gains on crypto ("virtual digital assets") at a flat rate and doesn't let losses offset other income. Check your tax authority.

How do you use the calculator?

  1. Open the Crypto Capital Gains Calculator.
  2. Add each trade: date, buy or sell, asset (BTC, ETH…), quantity, price per unit and fee. Or Import CSV with the columns date, type, asset, quantity, price, fee. Load example fills in sample trades.
  3. Pick the method: FIFO, LIFO or HIFO.
  4. Enter your short-term and long-term tax rates.
  5. Read the proceeds, cost basis, net realized gain, the short and long split, and the estimated tax. The Each sale table shows the gain on every sale; Still held shows what's left and its average cost.
  6. Export CSV to keep a record.

If you sell more of a coin than you bought, the row shows an error so you can fix the missing purchase. Your trades never leave your device.

What records should you keep?

  • Every buy, sell and swap: date, quantity, price and fee.
  • Transfers between your own wallets (these aren't sales, but you need them to track cost basis).
  • Exchange statements and CSV exports, ideally once a year.

Missing purchase records are the main reason crypto tax gets painful. Export trade history from each exchange before accounts close or data expires.

Common mistakes

  • Forgetting swaps. Coin-to-coin trades are often taxable disposals.
  • Ignoring fees. They reduce your gain.
  • Mixing methods. Pick one allowed method and use it consistently.
  • Assuming losses don't matter. In many countries losses offset gains; record them.

Estimate your gains

Enter your trades in the free Crypto Capital Gains Calculator. To see how long-term savings grow, try the Compound Interest Calculator; for quick percent changes, the Percentage Calculator. Always confirm your final figures with a tax professional.

Frequently asked questions

How is a crypto capital gain calculated?

Gain = what you received when you sold (minus selling fees) − your cost basis (what you paid, plus buying fees) for the coins you sold.

What is the difference between FIFO, LIFO and HIFO?

They decide which purchases a sale uses. FIFO sells your oldest coins first, LIFO the newest first, and HIFO the most expensive first. The choice changes your gain and whether it's short or long-term.

Is swapping one coin for another taxable?

In many countries, including the US and UK, exchanging one crypto for another counts as a disposal and can create a taxable gain. Record it as a sale of one coin and a purchase of the other.

Is this tax advice?

No. It's an educational estimate. Tax rules and allowed methods differ by country, and can change, so check with your tax authority or a tax professional.

Sources

Try these free tools

More from the blog