How to Calculate Crypto Cost Basis: FIFO, LIFO, HIFO, and Specific Identification

June 20, 2026 3 min read

Key Takeaways

  • FIFO (First In, First Out) is the default method in most countries — your earliest purchases sell first.
  • HIFO (Highest In, First Out) minimizes taxes by selling your most expensive purchases first.
  • Pick one method and stick with it — switching between methods can create audit risks.
  • Track every transaction from day one — cost basis tracking is impossible to reconstruct later.
  • Tax software like Koinly or CoinTracker can automate cost basis calculations across exchanges.

When you sell crypto, you need to calculate your cost basis — what you originally paid. The method you choose can significantly affect your tax bill.

What Is Cost Basis?

Cost basis is the original value of an asset for tax purposes. When you sell:

Capital gain = Proceeds - Cost basis

A higher cost basis = lower gain = less tax.

The Four Main Methods

FIFO (First In, First Out)

You sell the oldest coins first.

TransactionActionPrice
Jan 2025Buy 1 BTC$30,000
Jun 2025Buy 1 BTC$50,000
Jul 2026Sell 1 BTC$80,000

FIFO result: You sell the Jan 2025 BTC. Gain = $80,000 - $30,000 = $50,000.

LIFO (Last In, First Out)

You sell the newest coins first.

LIFO result: You sell the Jun 2025 BTC. Gain = $80,000 - $50,000 = $30,000.

HIFO (Highest In, First Out)

You sell the coins with the highest cost basis first.

If you bought BTC at various prices, HIFO selects the most expensive purchase. This minimises your gain (and tax).

Specific Identification

You choose exactly which coins to sell. This gives you the most control but requires the best record keeping.

Comparison Example

MethodCost Basis UsedGainTax (at 20%)
FIFO$30,000$50,000$10,000
LIFO$50,000$30,000$6,000
HIFO$50,000$30,000$6,000
Specific IDYou chooseVariableVariable

In this example, FIFO produces the highest tax. LIFO and HIFO produce the lowest.

Which Method Is Best?

If you expect…Use…Reason
Prices to rise long-termHIFOMinimise gains now
Prices to fallLIFOCapture losses now
Simple record keepingFIFOEasiest to track
Maximum controlSpecific IDChoose optimal lots

Country Restrictions

Not all methods are available in all countries:

CountryAllowed Methods
USFIFO, LIFO, HIFO, Specific ID
UKSection 104 pooling (average cost basis)
CanadaAdjusted cost base (average)
AustraliaFIFO (default)
GermanyFIFO
FranceProportionate method
JapanMoving average (総平均法)

Impact of Frequent Trading

Every trade creates a new “lot” that must be tracked. If you trade frequently, you’ll have hundreds or thousands of lots.

Without good software, this becomes unmanageable. Use crypto tax software that supports your chosen method.

Same-Day and Bed-and-Breakfast Rules

Some countries have anti-avoidance rules:

  • UK: Same-day rule (same-day trades matched first) and 30-day bed-and-breakfast rule
  • US: Wash sale rules (not yet applied to crypto, but proposed)
  • Australia: Same-day trading matched first

How to Choose

  1. Check your country’s allowed methods first
  2. Start with FIFO if you’re new — it’s simple and universally accepted
  3. Switch to HIFO if you have large gains and want to minimise tax
  4. Use Specific ID only if you have excellent record keeping and tax software

Record Keeping for Cost Basis

You need to track for each transaction:

  • Date and time
  • Asset type
  • Amount
  • Price in your local currency
  • Exchange or platform
  • Transaction ID (hash)
  • Wallet address (sender and receiver)

Choosing in practice

For most people, the decision between methods comes down to how much record-keeping they can sustain. FIFO is the default in most countries precisely because its logic is intuitive — the first coin bought is the first coin sold — and it is universally accepted by tax authorities. If you are new to crypto or holding a modest number of positions, FIFO keeps your accounting simple and your audit risk low.

If you are sitting on large gains and want to reduce your immediate tax bill, HIFO is often the better choice, provided your country allows it. Selling your most expensive lots first lowers the gain you must report today. The trade-off is that it deliberately defers appreciation into your cheaper lots, which may crystallise larger gains later. That can be a sensible strategy in a rising market, but it assumes you will remain in a position to absorb those future taxes.

LIFO sits between the two. It tends to produce a lower gain than FIFO in rising markets, but it can create unusual tax results if prices fall sharply. Specific identification offers the most precise control of all, but it demands careful lot-level records and is impractical for anyone trading actively without dedicated software.

Whichever method you land on, the single most durable advice is to pick one and stay consistent. Switching methods between years, or cherry-picking lots without documentation, is a classic audit trigger. Locking in a method, keeping clean lot-level records, and reviewing the figures with crypto tax software before you file are the practical steps that keep your cost-basis calculation accurate and defensible.

Bottom Line

Your cost basis method has a massive impact on your crypto tax bill. HIFO and LIFO generally produce the smallest gains in rising markets. But not all methods are available everywhere — check your local rules. Use specialised crypto tax software to track lots accurately and run scenarios with different methods before filing.

Frequently Asked Questions

Which cost basis method results in the lowest tax bill?

HIFO (Highest In, First Out) typically produces the lowest tax bill because it sells your most expensive purchases first, minimizing gains. However, not all countries allow HIFO — check your local rules before relying on it.

Can I switch between FIFO and HIFO from year to year?

In the US, you can change methods with IRS permission, but doing so frequently may draw scrutiny. Most tax professionals recommend picking one method and using it consistently to reduce audit risk.

What happens if I don't choose a cost basis method?

Your tax authority will typically default to FIFO, which is the most widely accepted method globally. In the UK and Canada, average cost is used instead. Failing to specify a method does not mean you avoid the calculation — the default applies automatically.

Do crypto-to-crypto trades trigger a cost basis calculation?

Yes. When you trade one crypto for another (for example BTC to ETH), that is a taxable disposal. You must calculate the gain or loss on the crypto you gave up, using your chosen cost basis method.

PP
PaisayehPaisa Editorial Team
Financial education in plain language. Our team reviews every article for accuracy and clarity.
← Back to Crypto Tax Search all articles
This content is for educational purposes only. Not financial advice. Do your own research before investing.