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

June 20, 2026 3 min read

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)

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.

← Back to Crypto Tax Search all articles
This content is for educational purposes only. Not financial advice. Do your own research before investing.