Crypto Cost Basis: FIFO, LIFO, HIFO & Average

Crypto Cost Basis: FIFO, LIFO, HIFO & Average

By the Coinfolytics team · Tax rules last checked · Information only, not tax advice

Quick answer

Your cost basis method decides which coins you sold when you sell part of a holding. FIFO sells your oldest coins first, LIFO your newest, HIFO the ones you paid most for, and average cost gives every coin the same average price. In the example below, the same sale produces a gain anywhere from $5,500 to $16,000, yet the total profit over time is identical: the method changes when profit is taxed, not how much you make. Where you pay tax often decides the method for you.

Key takeaways

  • Gain = proceeds − cost basis of the coins sold. The method decides which coins those are.
  • Same trades, four methods: FIFO $16,000, average cost $11,200, LIFO $7,000, HIFO $5,500.
  • Every method ends at the same $28,000 total. A smaller gain now means a bigger one later.
  • The method also decides which coins count as long-term, which can change the tax rate.
  • US: FIFO by default, specific identification allowed with records. UK: pooled average cost. Canada: adjusted cost base (average).

If you've bought the same coin more than once at different prices and then sold part of it, your profit depends on a question most people never think about: which coins did you sell?

The answer is set by your cost basis method. This guide works through one example with real numbers, compares the four common methods side by side, and explains which methods the US, UK and Canada allow.

What is cost basis in crypto?

Cost basis is what you paid to acquire a coin, including fees. When you sell, your gain or loss is:

Proceeds (what you received, minus selling fees) − cost basis of the coins sold = gain or loss

With one purchase, that's simple. With several purchases at different prices, you need a rule to decide which purchase each sold coin came from. That rule is the cost basis method.

The example: three Bitcoin purchases, one sale

To keep the math clear, we'll ignore fees. Suppose you bought Bitcoin three times in the same year:

PurchaseDateAmountPrice per BTCCost
Lot 110 January0.5 BTC$30,000$15,000
Lot 25 April0.3 BTC$60,000$18,000
Lot 320 August0.2 BTC$45,000$9,000
Total1.0 BTC$42,000

On 1 November you sell 0.4 BTC at $70,000 and receive $28,000.

The worked example: three Bitcoin purchases of 0.5 BTC at $30,000, 0.3 BTC at $60,000 and 0.2 BTC at $45,000, followed by a sale of 0.4 BTC at $70,000
Three purchases at three prices, then one partial sale. Which coins were sold?

How does FIFO work for crypto?

FIFO (first in, first out) assumes you sell your oldest coins first.

  • All 0.4 BTC sold comes from Lot 1, bought at $30,000.
  • Cost basis: 0.4 × $30,000 = $12,000
  • Gain: $28,000 − $12,000 = $16,000

Still held: 0.1 BTC from Lot 1 plus all of Lots 2 and 3, with a remaining cost of $3,000 + $18,000 + $9,000 = $30,000.

How does LIFO work?

LIFO (last in, first out) assumes you sell your newest coins first.

  • First all 0.2 BTC of Lot 3: 0.2 × $45,000 = $9,000
  • Then 0.2 BTC of Lot 2: 0.2 × $60,000 = $12,000
  • Cost basis: $21,000. Gain: $28,000 − $21,000 = $7,000

Still held: all 0.5 BTC of Lot 1 and 0.1 BTC of Lot 2, with a remaining cost of $15,000 + $6,000 = $21,000.

How does HIFO work?

HIFO (highest in, first out) sells the coins with the highest purchase price first, whenever they were bought.

  • First all 0.3 BTC of Lot 2, the highest price: 0.3 × $60,000 = $18,000
  • Then 0.1 BTC of Lot 3, the next highest: 0.1 × $45,000 = $4,500
  • Cost basis: $22,500. Gain: $28,000 − $22,500 = $5,500

Still held: all 0.5 BTC of Lot 1 and 0.1 BTC of Lot 3, with a remaining cost of $15,000 + $4,500 = $19,500.

How does the average cost method work?

Average cost ignores individual lots. Every coin you hold has the same cost: the total you paid divided by the total amount.

  • Average cost: $42,000 ÷ 1.0 BTC = $42,000 per BTC
  • Cost basis of the coins sold: 0.4 × $42,000 = $16,800
  • Gain: $28,000 − $16,800 = $11,200

Still held: 0.6 BTC at $42,000 each, a remaining cost of $25,200.

Which coins each method sells for the same 0.4 BTC sale: FIFO takes 0.4 from Lot 1; LIFO takes 0.2 from Lot 3 and 0.2 from Lot 2; HIFO takes 0.3 from Lot 2 and 0.1 from Lot 3; average cost uses 0.4 BTC at the $42,000 average
Same 0.4 BTC sale, four different answers to "which coins did you sell?"

FIFO vs LIFO vs HIFO vs average cost: side by side

MethodCost of BTC soldGain this yearCost of BTC still held
FIFO$12,000$16,000$30,000
LIFO$21,000$7,000$21,000
HIFO$22,500$5,500$19,500
Average cost$16,800$11,200$25,200
Bar chart of the gain reported this year for the same sale: FIFO $16,000, average cost $11,200, LIFO $7,000, HIFO $5,500
Same trades, same sale: the reported gain ranges from $5,500 to $16,000.

Does the cost basis method change your total profit?

No. It changes when profit shows up, not how much you make. Suppose BTC is still $70,000, so the 0.6 BTC you kept is worth $42,000. Add this year's gain to the profit still sitting in your remaining coins:

MethodGain this yearUnrealized profit ($42,000 − remaining cost)Total
FIFO$16,000$12,000$28,000
LIFO$7,000$21,000$28,000
HIFO$5,500$22,500$28,000
Average cost$11,200$16,800$28,000
Stacked bars showing realized gain this year plus unrealized profit for each method, all adding up to the same $28,000 total
Every method adds up to $28,000: $70,000 for the whole bitcoin minus the $42,000 you paid.

A method that shows a smaller gain now leaves your remaining coins with a lower cost, so more of the gain appears when you sell them later.

Does the method affect long-term vs short-term gains?

Yes. In many countries, coins held longer than a set period (one year in the US) are taxed differently from coins sold quickly. Your method decides which coins you sold, so it also decides how long you'd held them.

Imagine Lot 1 had been bought two years before the sale. FIFO would sell those older, long-term coins, while HIFO would still sell Lot 2, bought only seven months earlier. The two methods would then differ not just in the size of the gain but in how it's taxed. Always look at both together.

Which cost basis methods are allowed in the US, UK and Canada?

Tax rules decide which methods you can use, and in several countries there's no free choice. This is a summary, not tax advice.

CountryWhat the rules sayOfficial source
United StatesFIFO is the default. You can use specific identification (how HIFO- or LIFO-style choices are made) only if you identify the units sold no later than the time of the sale and your records support it. Since 1 January 2025, cost basis is tracked wallet by wallet or account by account. Average cost isn't generally available for crypto.IRS: Digital assets · Rev. Proc. 2024-28
United KingdomHMRC uses pooling: one pool per token with an average cost (a "section 104 pool"). Two matching rules apply first: coins bought and sold on the same day, then coins bought back within 30 days after a sale. FIFO, LIFO and HIFO aren't used.HMRC: CRYPTO22200
CanadaThe CRA requires the adjusted cost base (ACB), an average cost method, for identical properties such as units of the same cryptocurrency. FIFO, LIFO and HIFO aren't allowed.CRA: Crypto-asset guide

Rules last checked: 7 October 2026. Other countries have their own rules; check your tax authority's guidance before choosing a method.

How do fees and swaps affect cost basis?

  • Fees. Purchase fees are generally added to your cost basis, and selling fees reduce your proceeds. Both lower your gain, so record every fee.
  • Swaps. In the US, UK, Canada and many other countries, swapping one crypto for another counts as selling the first and buying the second at market value. A swap from ETH to SOL can create a gain on the ETH even though you never received cash. See are crypto swaps taxable? for a worked example.

How do you choose a cost basis method?

  1. Start with your country's rules. If they require one method, as in the UK and Canada, that's your answer.
  2. If you have a choice, weigh timing. A method that lowers this year's gain usually means a larger gain later.
  3. Be consistent. Switching back and forth makes your records hard to follow and hard to defend.
  4. Keep records that support your method. Specific identification only holds up if you can show which units you sold.
  5. Ask a professional before you file, especially with large gains or many trades.

How to apply a cost basis method automatically

Working this out by hand for one sale is manageable. For dozens of trades, swaps and partial sells, it isn't.

In Coinfolytics you choose the cost basis method (average cost, FIFO, LIFO or HIFO) for each portfolio. Realized profit, unrealized profit and the yearly tax report all follow the method you pick, and swaps are recorded as a sale and a purchase automatically.

Choosing a cost basis method (average cost, FIFO, LIFO or HIFO) for a portfolio in Coinfolytics
Pick the method once per portfolio; every profit figure follows it.

Which plan do you need?

  • Choosing a method, recording trades and your yearly tax totals are free on the Market plan.
  • The full tax report, listing every sale split into short-term and long-term with a CSV for your accountant, is on Investor and above. See pricing.
  • UK users: Coinfolytics' average cost uses one average per coin and doesn't apply HMRC's same-day and 30-day rules, so have your figures checked against them.

You can start a free portfolio and add your trades first. For setup steps, see how to track your crypto portfolio without a spreadsheet.

FAQ

Which cost basis method gives the lowest tax?

In a single year, HIFO often shows the smallest gain because it sells the most expensive coins first. Over time the total profit is the same with every method; only the timing changes. And many countries don't let you choose.

Can I change my cost basis method?

It depends on your country. Changing methods without a good reason makes your records inconsistent, so speak to a tax professional first.

Does cost basis include fees?

Generally, yes. Purchase fees add to your cost basis, and selling fees reduce your proceeds.

Is FIFO required for crypto in the US?

FIFO is the default. You can use specific identification instead if you identify the units sold by the time of the sale and your records support it.

Why does my exchange show a different profit than my tracker?

An exchange only sees the trades made on that exchange. If you moved coins in from elsewhere, it may not know their real cost. A tracker that holds all your transactions can apply one method across everything.


This article is for information only and isn't financial or tax advice. Tax rules depend on where you live and your circumstances; check with a qualified tax professional before you file.

Share the article:

Notifications Login to see

Today

No Notifications

↑