Skip to main content
DigitalFinances

Glossary · Investing & tax

What is Cost basis?

The original purchase price of an asset, used to calculate capital gain or loss when you sell. For crypto, it includes the price plus any fees paid at purchase.

Last updated April 30, 2026

How it works

When you sell an asset, the IRS (or your country's tax authority) needs two numbers to compute your gain:

  • Sale price — what you got for it
  • Cost basis — what you originally paid

Capital gain = sale price − cost basis

For a single buy and a single sell, this is straightforward. For multiple buys at different prices, you need a method to decide which "shares" you're selling:

  • FIFO (first in, first out) — sell the oldest lots first. Default for many tax authorities. Often produces the highest gains in a rising market.
  • LIFO (last in, first out) — sell the newest lots first. Good for short-term tax planning but not always allowed; US crypto rules historically defaulted to FIFO.
  • HIFO (highest in, first out) — sell the most expensive lots first to minimize gains. Generally allowed for crypto under specific identification rules. The most tax-efficient when you have varied cost bases.
  • Specific identification — pick exactly which lots to sell. The IRS allows this if records are sufficient.

Fees also matter. If you bought 1 ETH for $3,400 and paid a $20 trading fee, your cost basis is $3,420 — not $3,400.

Example

You make three Bitcoin buys over two years:

  • 0.5 BTC @ $30,000 (Jan 2023, fee $50) — basis $15,050
  • 0.3 BTC @ $40,000 (Jul 2023, fee $30) — basis $12,030
  • 0.2 BTC @ $60,000 (Jan 2024, fee $20) — basis $12,020

Total: 1.0 BTC, total basis $39,100, average basis $39,100/BTC.

You sell 0.4 BTC at $75,000 ($30,000 sale price). Your gain depends on the method:

  • FIFO: sell 0.4 of the first lot. Basis = 0.4 × $15,050 / 0.5 = $12,040. Gain = $30,000 − $12,040 = $17,960.
  • HIFO: sell the 0.2 BTC at $60k basis (full lot) + 0.2 BTC at $40k basis. Basis = $12,020 + (0.2 × $12,030/0.3) = $12,020 + $8,020 = $20,040. Gain = $30,000 − $20,040 = $9,960.

HIFO saves $8,000 in taxable gain — not the actual tax (depends on your bracket and holding period), but the gain figure that gets multiplied by your rate.

Why it matters

Cost basis tracking gets complicated fast in crypto:

  • Crypto-to-crypto trades trigger gains. Swapping ETH for SOL is a sale of ETH at the moment's price, even if you never touched USD.
  • Forks, airdrops, staking rewards all become taxable events with their own cost basis (typically the asset's value at receipt).
  • Cross-platform tracking is brutal. Buy on Coinbase, transfer to a self-custody wallet, swap on Uniswap, deposit into Aave — by the time you sell, your tax software needs the entire trail.
  • Bad records cost real money. Without specific records, the IRS can default you to a $0 cost basis (worst case), making the entire sale a gain.

Tools like CoinTracker, Koinly, TokenTax, and Cointracking auto-aggregate transactions and compute basis with the method you choose. For active crypto users, paying for one of these is usually cheaper than the time you'd spend tracking manually — and far cheaper than the tax mistake of not tracking at all.

The Crypto Tax Estimator on this site gives a ballpark for federal capital-gains tax on a planned sale; for actual filing, use a real tax-tracking tool and a CPA familiar with crypto.

Related terms

Read more