Crypto Cost Basis Guide: FIFO, LIFO, HIFO & Tax Optimization
The cost basis method you choose can mean the difference between paying 0% and 37% on your crypto gains. This guide explains each method, when to use them, and how tax-loss harvesting can offset your gains across asset classes.
What Is Cost Basis?
Cost basis is the original value of an asset for tax purposes — usually what you paid for it, plus transaction fees. When you sell, your capital gain or loss is:
Proceeds - Cost Basis = Capital Gain/Loss
If you bought Bitcoin at different times and prices, the question is: which specific Bitcoin did you sell? That is what your cost basis method determines.
Cost Basis Methods Compared
FIFO (First In, First Out) — Default Method
The oldest coins you own are assumed to be sold first. This is the IRS default if you do not specify a method.
Pros: Simple, widely supported by tax software, compliant by default.
Cons: In a rising market, you sell your oldest (cheapest) coins first, maximizing your gains and tax bill.
Best for: Minimal record-keeping, small traders, long-term holders who want simplicity.
LIFO (Last In, First Out)
The most recently acquired coins are sold first.
Pros: In a rising market, you sell your newest (most expensive) coins first, minimizing gains.
Cons: Not all tax software supports it. The IRS has not explicitly approved LIFO for crypto (though many accountants argue it is allowed under the general identification rules).
Best for: Active traders in a bull market who want to minimize short-term gains.
HIFO (Highest In, First Out) / Highest Cost
The highest-cost-basis coins are sold first, minimizing the gain (or maximizing the loss).
Pros: Maximizes tax savings by selling the most expensive lots first. Supported by most crypto tax software.
Cons: Requires detailed lot tracking. May leave you holding only low-basis coins, creating future tax liability.
Best for: Tax-efficient traders who actively manage their portfolio.
Specific Identification (Specific ID)
You specifically identify which lot to sell at the time of the transaction.
Pros: Maximum flexibility. You can cherry-pick lots with losses or the smallest gains.
Cons: Requires you to specify at the time of sale which units you are selling — you cannot retroactively assign lots. Most exchanges do not support Specific ID natively. You need to track this yourself.
Best for: Sophisticated traders with detailed records and large portfolios.
Minimal Tax Method / "Lowest Tax"
Some tax software (e.g., Koinly, CoinTracker) offers an automated mode that selects the lot producing the lowest tax liability for each sale.
Warning: The IRS has not formally ruled on whether this is permissible if you do not specifically identify lots at the time of sale.
Impact of Method Choice — Example
You bought 1 BTC three times:
- Lot A: 0.5 BTC at $20,000 (2023)
- Lot B: 0.3 BTC at $40,000 (2024)
- Lot C: 0.2 BTC at $60,000 (2025)
You sell 0.5 BTC at $80,000 in 2026:
- FIFO: Sells Lot A (0.5 BTC). Gain = $40,000 - $10,000 = $30,000 gain
- LIFO: Sells Lot C (0.2 BTC) + part of Lot B (0.3 BTC). Gain = $16,000 - $12,000 + $24,000 - $12,000 = $16,000 gain
- HIFO: Sells Lot C (0.2 BTC) + Lot B (0.3 BTC). Same as LIFO here = $16,000 gain
- Spec ID: Could choose Lot B only (0.3 BTC) if you wanted to sell less, or mix lots. Most flexible.
The difference between FIFO ($30K gain) and HIFO ($16K gain) is $14K in taxable income — potentially thousands of dollars in tax.
Tax-Loss Harvesting for Crypto
You can sell crypto at a loss to offset gains elsewhere — including stock market gains. This is called tax-loss harvesting:
- Realize losses intentionally: If you hold a coin at a loss, sell it to capture the loss. The loss offsets capital gains from other sales. If losses exceed gains, you can deduct up to $3,000 per year against ordinary income, with excess carried forward.
- Wash sale rule: The wash sale rule (which disallows the loss if you repurchase the same security within 30 days) applies to securities but not to cryptocurrency — though there are ongoing legislative efforts to change this. As of 2026, crypto wash sales are still allowed.
- Strategic repurchase: You can sell at a loss and immediately buy back the same coin. Your cost basis resets lower, and you capture the tax loss. Check current law before relying on this — it may change.
How to Choose Your Method
- Check your tax software: Most crypto tax tools default to FIFO. You can usually switch to HIFO or LIFO in settings. Run the comparison — the difference in tax owed can be dramatic.
- Be consistent: You can use different methods for different wallets or exchanges, but you must be consistent within each account. Switching methods year-to-year without justification may raise IRS questions.
- Document your election: The IRS has not issued clear guidance on how to elect a cost basis method for crypto. A conservative approach: keep a contemporaneous written record (spreadsheet or tax software export) documenting which method you are using and that you are applying it consistently.
- Consult a CPA for large portfolios: If you have significant crypto holdings, the tax savings from optimal cost basis selection can justify professional advice. A crypto-specialized CPA can also advise on whether Specific ID is practical for your situation.
Software Support
- CoinTracker: FIFO, LIFO, HIFO, and Specific ID. Also supports trade-by-trade lot optimization.
- Koinly: FIFO, LIFO, HIFO, and "Minimal Tax" mode. Supports 7,000+ coins and 600+ exchanges.
- TaxBit: FIFO, LIFO, HIFO, Specific ID. Used by many professional traders.
- Cointelli: Supports HIFO, LIFO, FIFO. Good for DeFi-heavy portfolios.
Whichever software you use, export the annual report and keep it with your tax records. If the IRS audits you, the software report is your primary evidence of correct reporting.