When you sell crypto, the IRS needs to know how much you paid for it. Simple, right? Except you probably bought the same asset multiple times at different prices. Which purchase counts against your sale? That choice—your cost basis method—can mean thousands of dollars in tax differences.
This guide breaks down your options and shows you how to legally minimize your tax bill.
Why Cost Basis Method Matters
Consider this scenario:
You bought 2 BTC over time:
- January 2023: 1 BTC at $16,000
- December 2024: 1 BTC at $98,000
Now in February 2026, BTC is at $102,000, and you sell 1 BTC.
Which Bitcoin did you sell?
If you sold the January 2023 BTC:
- Proceeds: $102,000
- Basis: $16,000
- Gain: $86,000
- Tax rate: Long-term capital gains (15-20%)
If you sold the December 2024 BTC:
- Proceeds: $102,000
- Basis: $98,000
- Gain: $4,000
- Tax rate: Long-term capital gains (15-20%)
Same sale. Same proceeds. But the taxable gain ranges from $4,000 to $86,000 depending on which lot you designate. That's an $82,000 difference in taxable income.
The Four Main Cost Basis Methods
FIFO (First In, First Out)
Under FIFO, your oldest holdings are sold first. The crypto you bought longest ago is what you're selling.
How it works:
- List all acquisitions in chronological order
- When you sell, apply the oldest unsold lot first
- Continue through newer lots until the sale quantity is covered
Example (FIFO):
- Buy 1 BTC at $20,000 (Lot A)
- Buy 1 BTC at $40,000 (Lot B)
- Buy 1 BTC at $30,000 (Lot C)
- Sell 1.5 BTC
FIFO sells: All of Lot A (1 BTC @ $20,000 basis) + 0.5 of Lot B (0.5 BTC @ $40,000 basis)
Total basis for 1.5 BTC: $20,000 + $20,000 = $40,000
Advantages:
- Simple to implement
- Default method if you don't specify another
- Easy to document and audit
Disadvantages:
- In rising markets, sells your lowest-cost (oldest) lots first
- Often results in higher taxable gains
- No flexibility to optimize
LIFO (Last In, First Out)
Under LIFO, your most recent purchases are sold first.
Example (LIFO with same lots):
- Sell 1.5 BTC
LIFO sells: All of Lot C (1 BTC @ $30,000 basis) + 0.5 of Lot B (0.5 BTC @ $40,000 basis)
Total basis for 1.5 BTC: $30,000 + $20,000 = $50,000
Advantages:
- In rising markets, higher basis means lower gains
- More recent holding periods (often short-term though)
Disadvantages:
- May create short-term gains (taxed higher)
- Less common, requires clear documentation
HIFO (Highest In, First Out)
HIFO sells your highest-cost lots first, regardless of when acquired.
Example (HIFO with same lots):
- Sell 1.5 BTC
HIFO sells: All of Lot B (1 BTC @ $40,000 basis) + 0.5 of Lot C (0.5 BTC @ $30,000 basis)
Total basis for 1.5 BTC: $40,000 + $15,000 = $55,000
Advantages:
- Minimizes immediate taxable gain
- Useful for tax-loss harvesting
Disadvantages:
- May create short-term gains
- Requires tracking individual lots
- Must document lot selection clearly
Specific Identification
Specific identification lets you choose exactly which lots to sell, transaction by transaction.
Example (Specific ID with same lots):
- Sell 1.5 BTC
- You choose: Lot B (1 BTC) + 0.5 of Lot A (0.5 BTC)
Total basis: $40,000 + $10,000 = $50,000
Advantages:
- Maximum flexibility
- Can optimize for both gain amount AND holding period
- Balance short-term vs long-term treatment
Disadvantages:
- Requires meticulous record-keeping
- Must identify lots BEFORE or AT THE TIME of sale
- Subject to IRS requirements (Rev. Proc. 2024-28)
How Rev. Proc. 2024-28 Changed Everything
In 2024, the IRS issued Revenue Procedure 2024-28, which finally clarified specific identification rules for crypto. Here's what it requires:
Adequate Identification Requirements
To use specific identification, you must:
- Identify the specific units being sold BEFORE or AT THE TIME of the transaction
- Document the identification in your records
- Keep records showing:
- Date each unit was acquired
- Amount paid (including fees)
- Date and time of sale
- Identification of which units were sold
The Wallet-by-Wallet Rule
Rev. Proc. 2024-28 introduced something important: if you transfer crypto to a broker/exchange, you can maintain separate basis pools per wallet or account. This means:
- BTC in your Coinbase account = one pool
- BTC in your Ledger wallet = separate pool
- BTC in your Kraken account = separate pool
When you sell from a specific platform, you're selling from that platform's pool. This creates natural segregation that simplifies specific identification.
Default to FIFO
If you don't adequately identify specific units, the IRS defaults to FIFO. This isn't optional—you can't retroactively apply HIFO or specific identification to past transactions where you didn't document your method at the time.
Which Method Should You Use?
The optimal choice depends on your situation:
Use FIFO When:
- You don't want to track individual lots
- Your purchases were made at similar prices
- You want simplicity over optimization
- You're risk-averse about IRS scrutiny
Use HIFO When:
- Minimizing current-year taxes is priority
- You're comfortable with potentially more short-term gains
- You have automated software tracking lots
- Your highest-cost lots are already long-term
Use Specific Identification When:
- You want maximum control
- Your holdings vary significantly in both price and holding period
- You need to balance gain amount against tax rate (short vs long-term)
- You have software that tracks and documents lot selection
Real-World Optimization Scenarios
Scenario 1: Minimize This Year's Tax Bill
Situation: You need to sell some crypto and want to minimize taxes this year.
Strategy: Use HIFO or specific identification to sell highest-cost lots.
Watch out for: If your highest-cost lots are held less than a year, you'll pay short-term rates (up to 37%) instead of long-term rates (15-20%). Sometimes selling a lower-gain long-term lot beats a high-basis short-term lot.
Example:
- Lot A: Basis $50,000, held 2 years (long-term)
- Lot B: Basis $90,000, held 6 months (short-term)
- Sell for $100,000
Selling Lot A: $50,000 gain Ă— 20% = $10,000 tax
Selling Lot B: $10,000 gain Ă— 37% = $3,700 tax
In this case, the short-term lot saves money despite the higher rate.
Scenario 2: Tax-Loss Harvesting
Situation: You have unrealized losses and want to harvest them.
Strategy: Sell highest-cost lots that are currently underwater.
Watch out for: Wash sale rules may apply to securities in the future. Also, you can only deduct $3,000 of net capital losses against ordinary income per year (excess carries forward).
Scenario 3: Long-Term Status About to Hit
Situation: You bought crypto 10 months ago. If you wait 2 more months, it becomes long-term.
Strategy: Use specific identification to sell older long-term lots now, preserving the newer lots until they hit 12 months.
Scenario 4: Gifting and Estate Planning
Situation: You plan to gift crypto to a family member in a lower tax bracket.
Strategy: Gift the highest-gain lots. The recipient inherits your basis but may be in a lower bracket when they sell.
Watch out for: Gift tax rules apply to gifts over $18,000 per recipient per year (2024 limit).
Implementing Cost Basis Methods in Practice
Step 1: Choose Your Method
Decide which method you'll use BEFORE your first sale of the year. While you can use different methods for different assets, consistency makes documentation easier.
Step 2: Document Lot Selection
For FIFO/LIFO/HIFO: Your software or spreadsheet should automatically apply the method consistently.
For Specific Identification: Record your lot selection before or at the time of each sale. This could be:
- A note in your trading journal
- A selection in your crypto tax software
- A timestamped record showing which lots you designated
Step 3: Maintain Complete Records
Keep records of:
- Every acquisition (date, amount, price, fees)
- Every disposition (date, amount, price, fees)
- Lot assignments for each sale
- Your chosen method
Step 4: Generate Tax Reports
Your Form 8949 must show:
- Description of property (e.g., "1.5 BTC")
- Date acquired (may be "VARIOUS" if multiple lots)
- Date sold
- Proceeds
- Cost basis
- Gain or loss
Common Mistakes to Avoid
Mistake 1: Retroactive Method Switching
Wrong: "I'll figure out which method saves the most tax and apply it retroactively."
Right: Choose and document your method before or at the time of sale. You cannot change methods after the fact.
Mistake 2: Inconsistent Application
Wrong: Using FIFO for gains and HIFO for losses within the same asset.
Right: Apply your chosen method consistently. You can use different methods for different assets (BTC vs ETH), but be consistent within each asset.
Mistake 3: Ignoring Transfer Basis
Wrong: Treating a transfer from Coinbase to Ledger as creating new basis.
Right: Transfers carry over your original basis. Moving crypto between your own wallets doesn't create a taxable event or new basis.
Mistake 4: Forgetting Gas Fees
Wrong: Only counting the purchase price as basis.
Right: Include all acquisition costs: purchase price + gas fees + exchange fees. These increase your basis and reduce your gain.
Mistake 5: Poor Documentation
Wrong: "I use specific identification" with no records.
Right: Maintain timestamped records showing exactly which lots you selected for each sale.
Software and Automation
Manual tracking becomes impractical beyond a handful of transactions. Here's what to look for in crypto tax software:
Must-Have Features:
- Automatic lot tracking across exchanges and wallets
- Support for FIFO, LIFO, HIFO, and specific identification
- "What-if" scenarios to compare methods
- Compliant record generation for specific identification
Moonscape specifically:
- Imports transactions from 100+ exchanges and blockchains
- Calculates basis using your chosen method
- Identifies optimal lot selection to minimize taxes
- Generates IRS-ready Form 8949 with correct documentation
- Maintains audit trail for specific identification claims
When to Consult a Tax Professional
Consider professional advice if:
- Your crypto transactions are complex (DeFi, staking derivatives, cross-chain bridges)
- You're switching methods and unsure about transition rules
- You have significant gains or losses that could trigger audit risk
- You received 1099-DAs that don't match your records
- You're doing tax planning across multiple years
Key Takeaways
- Cost basis method materially affects your tax bill – The same sale can result in vastly different gains
- FIFO is the default – If you don't document another method, FIFO applies
- Specific identification offers maximum control – But requires documentation at time of sale
- Rev. Proc. 2024-28 formalized the rules – Wallet-by-wallet accounting is now explicitly allowed
- Consider both gain amount AND holding period – Sometimes lower-gain short-term beats higher-gain long-term
- Document everything – The IRS can challenge method selections without adequate records
- Use software – Manual tracking is error-prone and impractical at scale
The right cost basis method is one of the few legal ways to reduce your crypto tax bill. Take the time to understand your options and implement them correctly.
Further Reading
Try Moonscape free to see how different cost basis methods affect your tax liability.