When you sell part of your Bitcoin, which specific coins did you sell? You bought BTC at $30K in 2022, added more at $70K in 2023, more at $45K in 2024, more at $85K in 2025. Now you're selling half. Which purchase does the sale come from? The answer determines your capital gain (or loss) — and therefore your tax bill.
The rules that govern this — cost basis methods — vary by jurisdiction and by what you elect. Understanding them can save (or cost) you thousands to millions of dollars over a career of crypto trading.
**This is not tax advice. Consult a qualified tax professional for your specific situation.** The methods described here are illustrative of common frameworks. Rules vary by jurisdiction, change over time, and depend on your specific circumstances.
The core concept
Every purchase of crypto creates a "lot" — a batch with a specific cost basis (what you paid) and date. When you sell, you're disposing of specific lots, and the gain (or loss) on each lot is calculated separately.
For US taxes (and most jurisdictions):
- Selling a lot held less than 1 year: short-term capital gain (taxed at ordinary income rates, up to 37%)
- Selling a lot held 1+ year: long-term capital gain (taxed at 0%, 15%, or 20% depending on income)
The lot you "sell" determines both: 1. Your cost basis (what you paid — subtracted from sale price to get gain/loss) 2. Your holding period (short-term vs long-term treatment)
The four main methods
**FIFO (First In, First Out)**: sells your oldest lots first. If you bought BTC in 2022, 2023, and 2024, a sale in 2026 uses the 2022 lots first.
**LIFO (Last In, First Out)**: sells your newest lots first. That 2026 sale would use the 2024 (most recent) lots first.
**HIFO (Highest In, First Out)**: sells the lots with the highest cost basis first, regardless of when purchased.
**Specific ID**: you specify exactly which lot each sale corresponds to. Most flexibility, most record-keeping required.
Different jurisdictions permit different methods. In the US, FIFO is the default; Specific ID is allowed if you keep proper records. Many other jurisdictions require FIFO or have their own rules.
The math: FIFO vs HIFO example
Consider these buys:
- Buy 1 BTC in 2022 at $30K
- Buy 1 BTC in 2023 at $70K
- Buy 1 BTC in 2024 at $45K
- Buy 1 BTC in 2025 at $85K
Current price: $100K. You sell 1 BTC.
**FIFO**: sells the 2022 lot at $30K basis. Gain = $100K - $30K = $70K. Long-term (held 4 years).
**LIFO**: sells the 2025 lot at $85K basis. Gain = $100K - $85K = $15K. Short-term (held less than 1 year, taxed higher).
**HIFO**: sells the 2025 lot ($85K, highest basis). Gain = $15K. Short-term.
**Specific ID**: you pick. If you're trying to minimize this year's taxable gain, you'd specify the 2025 lot (short-term $15K gain) or the 2023 lot (long-term $30K gain, still much better than FIFO's $70K).
The difference: FIFO produces $70K in taxable gain; HIFO produces $15K but at short-term rates. Specific ID gives you flexibility to optimize.
Why each method exists
**FIFO** is the default and simplest. It matches inventory accounting principles. Requires minimal record-keeping.
**LIFO** is generally not allowed for crypto in the US but is elsewhere. It puts newer lots first, which in inflationary environments generally produces lower gains.
**HIFO** minimizes current-year taxable gains but delays the tax (you're still holding the low-basis lots for future recognition). Useful in years when you want to minimize tax bills.
**Specific ID** gives you the most flexibility. Best for sophisticated tax planning.
The record-keeping burden
Specific ID and HIFO require detailed lot tracking:
- Date of every purchase
- Amount and price
- The specific lot chosen for each sale
- Documentation to support the choice if audited
Manual tracking of this is painful. Crypto tax software (CoinTracker, Koinly, ZenLedger, TaxBit, etc.) automates much of it. For anyone with more than a few dozen transactions per year, software is essentially required.
Consistency requirement
You generally cannot flip between methods willy-nilly. In the US, you elect a method and use it consistently. Changing methods requires justification and may require IRS notification.
Some jurisdictions allow annual elections; others lock you in more strictly. Consult a tax professional for your specific rules.
Loss harvesting
If some of your lots are underwater (bought high, current price lower), you can realize losses to offset gains elsewhere.
Example: you have $50K in short-term gains from trading. You also have a lot of ETH bought at $4K that's now worth $2K (a $2K loss per ETH). Selling that ETH lot realizes the loss, which offsets $2K of your gains.
Crypto has one big advantage over traditional assets: as of 2026, the "wash sale rule" (which prevents claiming a loss if you re-buy within 30 days) does not apply to crypto in the US. You can sell for a loss and immediately re-buy without disqualifying the loss.
This makes loss harvesting extremely valuable for crypto — you can maintain your position while realizing tax losses. Whether this treatment continues depends on regulatory changes; watch for updates.
The long-term vs short-term threshold
Holding for 1 year+ crosses into long-term capital gains rates in the US. This is a huge tax benefit:
- Short-term: taxed at ordinary income rates, up to 37% federal (plus state)
- Long-term: taxed at 0%, 15%, or 20% (plus 3.8% NIIT for high earners)
A $100K gain taxed short-term could cost $37K+ in federal tax. The same gain taxed long-term costs $15K-20K.
This creates an incentive to hold winning positions past the 1-year mark. It also creates a specific tax-planning opportunity: identify positions that will cross the 1-year threshold soon and consider timing sales around that date.
Cost basis in DeFi
DeFi complicates cost basis significantly:
**Swaps**: A swap from ETH to USDC is a taxable event (disposal of ETH, acquisition of USDC). Both need cost basis tracking.
**LP tokens**: providing liquidity is a taxable event in some jurisdictions (disposal of the underlying tokens, acquisition of LP tokens). Different jurisdictions treat this differently.
**Yield rewards**: tokens received as staking or LP rewards are typically taxed as income at receipt (fair market value at that time), with that value becoming the cost basis for later sales.
**Rebases and wraps**: wrapping ETH to WETH may or may not be a taxable event depending on jurisdiction. Rebases (like stETH increasing in balance) create income each rebase in some interpretations.
DeFi tax is complicated enough that dedicated software is essentially required for anyone with meaningful DeFi activity.
The jurisdictional variance
Cost basis rules vary significantly by country:
- **US**: FIFO default, Specific ID allowed with records
- **UK**: 30-day rule (bed-and-breakfasting) plus "same-day rule" and pooling for other lots
- **Germany**: FIFO required, 1-year hold makes gains tax-free
- **Portugal**: (until 2023) tax-free on gains; changing
- **Singapore**: no capital gains tax at all
- **Australia**: FIFO or Specific ID, plus CGT discount for 12-month holds
If you're a tax resident of a specific country, learn that country's rules. What works in the US may not apply elsewhere.
Practical guidance
Even without tax expertise:
1. Use crypto tax software from your first transaction. Retroactive reconstruction is painful. 2. If you're in a jurisdiction that allows Specific ID (like the US), use it — flexibility saves money over time. 3. Consider tax implications before large sales. Sometimes waiting a few weeks moves a lot from short-term to long-term treatment. 4. Track your DeFi activity, not just CEX. DeFi transactions are taxable events too. 5. When in doubt, consult a crypto-specialized tax professional. Rules change, and specifics matter.
The takeaway
Cost basis methodology sounds like arcane accounting. It's actually one of the highest-leverage decisions you make as a crypto investor. Choosing HIFO or Specific ID vs default FIFO can save you many thousands of dollars per year at moderate portfolio sizes.
The details are jurisdictional and specific. But the principle is universal: which lots you're treating as "sold" determines your taxable gains, and you generally have some choice in that decision. Use it wisely.
**Reminder**: this article is not tax advice. Consult a qualified professional for your specific situation.


