Crypto Cost Basis Calculator
Multiple buys, one sell — which cost basis method saves you the most on taxes? Compare FIFO, LIFO, and HIFO side by side.
Buy Transactions
Sell Transaction
Understanding Cost Basis Methods
FIFO (First In, First Out)
Sells your earliest purchased lots first. The IRS default method. Often results in long-term gains if you have been holding for a while.
LIFO (Last In, First Out)
Sells your most recently purchased lots first. Can be useful in a rising market to realize smaller gains or even losses on recent high-cost purchases.
HIFO (Highest In, First Out)
Sells your highest-cost lots first, maximizing cost basis and minimizing taxable gain. Often the most tax-efficient but requires specific identification.
Crypto Cost Basis & Tax Reporting: The Complete Guide
Everything you need to know about calculating crypto cost basis, choosing an accounting method, and minimizing your tax bill.
Cost basis is the original value of a crypto asset for tax purposes, typically the purchase price plus any fees paid to acquire it. When you sell, swap, or otherwise dispose of cryptocurrency, the IRS requires you to calculate your capital gain or loss as the difference between your sale proceeds and your cost basis.
Why it matters:
- Tax liability depends on it — A higher cost basis means a smaller taxable gain (or a larger deductible loss). Getting your cost basis right can mean the difference between owing thousands in taxes and owing nothing.
- Multiple purchases complicate things — If you bought Bitcoin at $20,000, then again at $40,000, and then again at $60,000, which purchase price do you use when you sell? The accounting method you choose determines which lots get sold first and therefore your taxable gain.
- The IRS is paying attention — Cryptocurrency exchanges are now required to issue 1099 forms, and the IRS has made crypto tax enforcement a priority. Failure to accurately report cost basis can result in penalties and audits.
- Fees are included — Transaction fees, gas fees, and exchange commissions paid when buying crypto are added to your cost basis, reducing your taxable gain when you sell.
This calculator helps you determine your cost basis under three different accounting methods so you can choose the one that minimizes your tax bill legally.
When you have multiple buy lots of the same cryptocurrency, the accounting method determines which lots are considered "sold" first. Each method can produce a different cost basis and therefore a different taxable gain or loss.
FIFO (First In, First Out):
- Sells your earliest purchased lots first.
- This is the IRS default method if you do not specify another. Most exchanges use FIFO unless you opt out.
- In a generally rising market, FIFO tends to produce larger gains because your cheapest (oldest) lots are sold first.
- However, FIFO is more likely to qualify gains as long-term (held over 1 year), which are taxed at lower rates.
LIFO (Last In, First Out):
- Sells your most recently purchased lots first.
- Useful when recent purchases were at higher prices than earlier ones, because selling high-cost lots produces smaller gains.
- The downside is that recent purchases are usually short-term (held under 1 year), so gains are taxed at your ordinary income rate.
HIFO (Highest In, First Out):
- Sells your highest-cost lots first, regardless of when they were purchased.
- This maximizes your cost basis and therefore minimizes your taxable gain. It is often the most tax-efficient method.
- Requires specific identification of lots, meaning you must be able to identify exactly which lots you are selling. Good record-keeping is essential.
Key insight: HIFO is generally the best for minimizing taxes on a per-transaction basis, but FIFO may produce more long-term gains taxed at lower rates. This calculator shows both the total gain and the short-term vs long-term split so you can make the optimal choice.
The IRS treats cryptocurrency as property, not currency. This means every sale, swap, or use of crypto to buy goods is a taxable disposal event that triggers a capital gain or loss.
Taxable events include:
- Selling crypto for fiat (USD, EUR, etc.)
- Swapping one crypto for another (e.g., trading BTC for ETH is a taxable sale of BTC)
- Using crypto to buy goods or services
- Receiving crypto as payment for work or services (taxed as ordinary income at fair market value)
- Mining or staking rewards (taxed as ordinary income when received, then capital gains on later sale)
Non-taxable events:
- Buying crypto with fiat — No tax until you sell or dispose of it.
- Transferring between your own wallets — Moving BTC from Coinbase to your hardware wallet is not a taxable event.
- Gifting crypto (under the annual gift tax exclusion) — The recipient inherits your cost basis.
Tax rates: Short-term capital gains (held under 1 year) are taxed at your ordinary income rate, which can be as high as 37%. Long-term capital gains (held over 1 year) are taxed at preferential rates of 0%, 15%, or 20% depending on income level.
The holding period — how long you held the crypto before selling — determines whether a gain or loss is classified as short-term or long-term. This distinction has a significant impact on your tax rate.
Short-term capital gains (held 1 year or less):
- Taxed at your ordinary income tax rate, which ranges from 10% to 37% depending on your total taxable income.
- For a high earner in the 35-37% bracket, short-term crypto gains can cost nearly 4x as much in taxes compared to long-term rates.
- Active traders who buy and sell frequently will typically have all short-term gains.
Long-term capital gains (held more than 1 year):
- Taxed at preferential rates: 0% (for lower income), 15% (for most taxpayers), or 20% (for high earners).
- In 2024, a single filer pays 0% on long-term gains up to about $47,025 in taxable income, 15% up to $518,900, and 20% above that.
- There is also a potential 3.8% Net Investment Income Tax (NIIT) on top for high earners (AGI above $200,000 single / $250,000 married).
Why the cost basis method matters: FIFO tends to sell older lots first, making them more likely to be long-term. LIFO sells newer lots first, which are often short-term. HIFO sells the highest-cost lots regardless of date. The calculator shows the short-term vs long-term split for each method so you can weigh the trade-off between total gain and the tax rate applied to it.
Specific identification is an IRS-approved method that allows you to choose exactly which lots of an asset to sell in a given transaction. HIFO (Highest In, First Out) is one strategy you can implement under specific identification — it just means you always pick the highest-cost lots first.
How specific identification works:
- You must be able to identify each lot by its acquisition date, quantity, and cost at the time of sale.
- You need adequate records showing which specific lot you intended to sell. This can be transaction records, wallet addresses, or exchange lot reports.
- Once you sell using specific identification, you cannot retroactively change which lots you assigned to that sale.
Practical considerations:
- Most crypto tax software (CoinTracker, Koinly, TaxBit) supports HIFO/specific identification automatically. You just select the method and the software assigns lots.
- If you use a centralized exchange like Coinbase, they report using their default method (usually FIFO). You may need to override this on your tax return if you want to use HIFO.
- For DeFi and self-custody transactions, maintaining your own records is critical since there is no exchange to track lots for you.
Bottom line: Specific identification gives you the most flexibility and the best tax outcomes. If you keep good records, there is no reason not to use it.
As of 2024, the wash sale rule does not apply to cryptocurrency under current IRS guidance. However, this is widely expected to change, and proposed legislation could extend wash sale rules to digital assets.
What is the wash sale rule?
- For stocks and securities, the wash sale rule (IRS Section 1091) disallows a capital loss deduction if you buy a "substantially identical" security within 30 days before or after the sale.
- The disallowed loss is added to the cost basis of the replacement purchase, deferring (not eliminating) the tax benefit.
Why crypto is currently exempt:
- The IRS classifies cryptocurrency as property, not a security. The wash sale rule technically only applies to "stock or securities."
- This means you can currently sell crypto at a loss and immediately buy it back to claim the loss on your taxes — a strategy called tax-loss harvesting.
What could change:
- The Biden administration's proposed budget and several Congressional bills have included provisions to extend wash sale rules to digital assets.
- The new IRS crypto broker reporting rules (effective for 2025+ tax years) may lay the groundwork for applying wash sale tracking to crypto transactions.
- Many tax professionals recommend keeping records as if wash sales apply so you are prepared if the rules change retroactively.
Pro tip: While the window is open, tax-loss harvesting crypto is one of the best legal tax optimization strategies available. Sell your losing positions, immediately repurchase, and claim the loss against other gains.
There are several legal strategies to reduce the tax impact of crypto gains. The right approach depends on your income level, holding patterns, and overall tax situation.
Key strategies:
- Use HIFO accounting — As this calculator shows, selling your highest-cost lots first minimizes your taxable gain. This is often the single most impactful choice you can make.
- Hold for over 1 year — Long-term capital gains rates (0-20%) are dramatically lower than short-term rates (10-37%). If you are close to the 1-year mark, consider waiting.
- Tax-loss harvest aggressively — Sell losing positions to offset gains. Since wash sale rules do not yet apply to crypto, you can immediately rebuy the same asset.
- Offset with capital losses — Up to $3,000 in net capital losses can offset ordinary income each year, and unused losses carry forward indefinitely.
- Donate appreciated crypto — Donating crypto held over 1 year to a qualified charity lets you deduct the full fair market value without paying capital gains tax.
- Use tax-advantaged accounts — Some platforms offer crypto trading within self-directed IRAs, which can defer or eliminate taxes on gains.
- Time your sales strategically — If you expect lower income next year (retirement, sabbatical, career change), deferring sales to a lower-income year can reduce your tax rate.
Important: Tax optimization should be one factor in your investment decisions, not the only one. Do not let the tax tail wag the investment dog. Selling a winning position to avoid taxes may cost you more in foregone gains than the taxes would have.
The IRS requires taxpayers to maintain adequate records to substantiate the cost basis, holding period, and gain or loss on each crypto transaction. Good record-keeping is essential, especially if you use specific identification (HIFO) for lot selection.
Essential records to keep:
- Transaction date and time — The exact date and time of each buy, sell, swap, or transfer.
- Quantity and price — How much crypto was involved and the fair market value in USD at the time of the transaction.
- Fees paid — Exchange fees, gas fees, network fees. These are added to cost basis on buys or subtracted from proceeds on sells.
- Wallet addresses — Sending and receiving addresses for on-chain transactions, which help prove transfers between your own wallets are not taxable events.
- Exchange statements — Download transaction history CSVs from every exchange you use. Exchanges can go down, get hacked, or delist your account.
- Lot identification records — If using specific identification, document which lots you selected for each sale at the time of sale (not after the fact).
Best practices:
- Use crypto tax software (CoinTracker, Koinly, CoinLedger, TaxBit) to automatically import and categorize transactions across exchanges and wallets.
- Export records regularly — Do not wait until tax season. Export and back up your exchange data quarterly.
- Keep records for at least 7 years after filing the related tax return (3 years is the standard audit window, but 6 years applies if income is underreported by 25%+).
- Track DeFi and airdrops separately — Decentralized exchanges, liquidity pools, and airdrops often have complex tax treatment. Record the fair market value at the time of receipt for any income events.
The effort you put into record-keeping now can save you thousands in overpaid taxes and protect you if you are ever audited.
Ready to build a professional valuation model?