Crypto Cost Basis Calculator: FIFO, LIFO, and HIFO Compared
Calculate your crypto cost basis using different accounting methods and see how each affects your tax liability.
What Is Cost Basis in Crypto?
Cost basis is the original value of a cryptocurrency asset for tax purposes, including the purchase price plus any fees or commissions paid to acquire it. When you sell, swap, or otherwise dispose of crypto, your taxable gain or loss equals the difference between the sale proceeds and the cost basis of the specific units you sold.
The complication: most crypto holders accumulate tokens through multiple purchases at different prices over time, especially when using a dollar-cost averaging strategy. Each purchase creates a distinct "tax lot" with its own basis and acquisition date. When you sell a portion of your holdings, the accounting method you use to determine which lots were sold directly affects your reported capital gain or loss.
Cost Basis Methods Compared
The table below summarizes the four primary methods used to assign cost basis when disposing of cryptocurrency.
| Method | Which Lots Are Sold First | Tax Impact (Rising Market) | IRS Status (US) | Record-Keeping Burden |
|---|---|---|---|---|
| FIFO (First-In, First-Out) | Earliest acquired | Highest gains (oldest, cheapest lots sold) | Default method | Low |
| LIFO (Last-In, First-Out) | Most recently acquired | Lower gains (newer, higher-cost lots sold) | Via Specific Identification | Medium |
| HIFO (Highest-In, First-Out) | Highest cost basis | Lowest current-year gains | Via Specific Identification | High |
| Specific Identification | Taxpayer selects exact lots | Varies (optimized per transaction) | Allowed with adequate records | Highest |
In the United States, the IRS formally recognizes two methods: FIFO (the default) and Specific Identification. LIFO and HIFO are not standalone IRS-approved methods: they are lot-selection strategies executed through valid Specific Identification documentation. If you cannot identify which specific units you sold, the IRS defaults to FIFO per FAQ Q41 of its Virtual Currency FAQ.
Worked Example: Same Trades, Different Tax Outcomes
Consider a trader who made three Bitcoin purchases and then sold 1.5 BTC when the price reached $95,000:
- Lot 1: 1.0 BTC purchased at $30,000 on January 15, 2023
- Lot 2: 0.5 BTC purchased at $60,000 on March 10, 2024
- Lot 3: 1.0 BTC purchased at $85,000 on November 5, 2024
The sale on February 1, 2025 generates $142,500 in proceeds (1.5 BTC × $95,000). Here is how each method allocates the lots:
| Method | Lots Sold | Total Basis | Capital Gain | Holding Period |
|---|---|---|---|---|
| FIFO | 1.0 BTC (Lot 1) + 0.5 BTC (Lot 2) | $30,000 + $30,000 = $60,000 | $82,500 | Lot 1: long-term, Lot 2: short-term |
| LIFO | 1.0 BTC (Lot 3) + 0.5 BTC (Lot 2) | $85,000 + $30,000 = $115,000 | $27,500 | Both short-term |
| HIFO | 1.0 BTC (Lot 3) + 0.5 BTC (Lot 2) | $85,000 + $30,000 = $115,000 | $27,500 | Both short-term |
| Specific ID (optimized) | 1.0 BTC (Lot 3) + 0.5 BTC (Lot 1) | $85,000 + $15,000 = $100,000 | $42,500 | Lot 3: short-term, Lot 1 portion: long-term |
FIFO produces the highest gain ($82,500) because it sells the cheapest lot first. LIFO and HIFO produce identical results in this example ($27,500), but the entire gain is short-term, taxed at ordinary income rates. Specific Identification allows the trader to strategically mix lots: selling the high-basis Lot 3 to reduce the gain while also selling a portion of Lot 1 to capture the favorable long-term capital gains rate on that portion.
For US taxpayers, long-term capital gains (assets held over 12 months) are taxed at 0%, 15%, or 20% depending on income. Short-term gains are taxed at ordinary income rates up to 37%. This rate differential means the holding period of the lots you sell matters as much as the basis itself. Use our crypto tax calculator to estimate your liability under each method.
How Each Method Works
FIFO: First-In, First-Out
FIFO sells your oldest lots first. It is the IRS default: if you do not designate specific lots before or at the time of sale, you are using FIFO. FIFO is straightforward to implement and requires no special record-keeping beyond a chronological transaction history.
The downside in a rising market: FIFO consistently assigns the lowest basis to your disposals, producing the largest taxable gains. However, because older lots are more likely to qualify as long-term holdings, FIFO can be advantageous when the long-term rate is significantly lower than the short-term rate.
LIFO: Last-In, First-Out
LIFO sells your most recently acquired lots first. In a rising market, recent purchases tend to have higher cost bases, resulting in smaller gains. LIFO is commonly used in traditional accounting for inventory (particularly under US GAAP), but for crypto, it must be implemented through Specific Identification with contemporaneous documentation.
The tradeoff: LIFO lots are almost always short-term, meaning gains are taxed at ordinary income rates. Additionally, LIFO preserves your oldest, lowest-basis lots indefinitely, creating a growing deferred tax liability.
HIFO: Highest-In, First-Out
HIFO sells the lots with the highest cost basis first, regardless of when they were acquired. This minimizes the current-year capital gain. Like LIFO, HIFO is executed through Specific Identification and requires per-lot documentation.
HIFO is often the most tax-efficient method in the short term, but it leaves behind a portfolio of low-basis lots. If you eventually sell those remaining lots, the deferred gains will come due. HIFO is tax deferral, not tax elimination.
Specific Identification
Specific Identification gives the taxpayer full control over which lots are sold in each transaction. Per IRS FAQ Q39, you must be able to identify the exact units involved and substantiate your basis with records showing: (1) the date and time each unit was acquired, (2) the basis and fair market value at acquisition, (3) the date and time of each disposition, and (4) the fair market value at disposition.
The identification must occur before or at the time of the disposal. Retroactively selecting the most favorable lots at tax-filing time does not satisfy the IRS requirement. You can establish standing instructions (for example, "always sell highest-basis lots first"), but these must be documented with the exact rule, the wallet or account scope, the date adopted, and a revocation protocol.
2025 IRS Rule Changes
Revenue Procedure 2024-28 introduced significant changes effective January 1, 2025. The IRS now requires wallet-by-wallet, account-by-account cost basis tracking. The previous practice of pooling cost basis across all wallets and exchanges (the "universal method") is no longer permitted.
Starting with the 2025 tax year, brokers and exchanges must file Form 1099-DA reporting gross proceeds from digital asset sales. Cost basis reporting begins with the 2026 tax year, but only for "covered securities": assets acquired after December 31, 2025, for cash or other digital assets, in a custodial account, and held in that same account until disposition. Assets acquired before 2026 or transferred between platforms are "noncovered": brokers will not report their basis, and taxpayers must supply it themselves.
Notice 2025-7 (extended by Notice 2026-20) provides temporary relief through December 31, 2026: taxpayers are not required to notify their broker of specific identification instructions and may maintain identification records privately. The per-wallet tracking requirement, however, remains in full effect with no relief.
Cost Basis Rules by Country
The method you can use depends on your tax jurisdiction. Most countries do not allow free choice: they mandate a specific approach. Check our crypto tax rules by country tool for jurisdiction-specific details.
| Country | Required Method | Key Rule |
|---|---|---|
| United States | FIFO (default) or Specific Identification | Per-wallet tracking required from 2025; Form 1099-DA reporting begins 2025 |
| United Kingdom | Share pooling (Section 104 pool) | Same-day and 30-day matching rules apply before pooling; no FIFO/LIFO choice |
| Canada | Adjusted Cost Base (weighted average) | Superficial loss rule disallows losses if repurchased within 61-day window |
| Australia | FIFO (default) or Specific Identification | 50% CGT discount for assets held over 12 months |
| Germany | FIFO (preferred per BMF guidance) | Tax-free if held over one year; EUR 1,000 annual threshold for short-term gains |
| Japan | Total Average (default) or Moving Average | Gains taxed as miscellaneous income at rates up to 55% |
| France | Proportional portfolio formula | Calculated at household level under Article 150 VH bis; not FIFO |
How DCA Purchases Affect Cost Basis
Dollar-cost averaging creates a new tax lot with every purchase. Buying $100 of Bitcoin weekly for a year produces 52 separate lots, each with its own acquisition date and basis. This has several implications:
- Under FIFO, your oldest (typically lowest-basis) lots sell first, maximizing gains in a rising market
- Under HIFO, you can cherry-pick the highest-basis lots to minimize current gains
- Each lot starts its own 12-month holding period for long-term capital gains eligibility
- The large number of lots creates opportunities for selective tax-loss harvesting by identifying specific underwater lots
The IRS does not allow the average cost method for cryptocurrency. Unlike mutual fund shares, which can use average cost under IRS regulations, each crypto lot must be tracked individually. Some tax software displays an "average cost basis" for reference, but this cannot be used on your tax return.
Common Cost Basis Mistakes
Errors in cost basis tracking compound over time and can result in significant over- or under-reporting of gains. These are the most frequent mistakes:
Forgetting Transaction Fees
Per IRS FAQ Q8, cost basis includes all fees, commissions, and acquisition costs. Trading fees, gas fees, and network fees paid to acquire crypto should be added to your basis. Fees paid on the sell side reduce your proceeds. Omitting fees understates your basis and overstates your taxable gain.
Missing Airdrops and Staking Rewards
Under Revenue Ruling 2023-14, staking rewards are taxable as ordinary income at fair market value when the taxpayer gains dominion and control. If you fail to record the FMV at receipt, the lot has a zero basis: you pay income tax on receipt and then pay capital gains tax on the full sale price, effectively being taxed twice. Airdrops follow similar treatment: they are income at FMV on receipt.
Treating Wallet Transfers as Sales
Moving crypto between your own wallets is not a taxable event. But if your tracking software or exchange does not recognize the transfer, it may assign a zero basis to the receiving wallet and treat the outgoing transaction as a sale. The result is phantom gains. One common example: transferring BTC from an exchange to a hardware wallet, then selling from the hardware wallet, results in the sale being reported with zero basis if the transfer was not properly reconciled.
Retroactive Lot Selection
Some tax software offers "optimization" features that retroactively select the most tax-favorable lots after the fact. This does not satisfy the IRS Specific Identification requirement, which demands contemporaneous designation at or before the time of sale. Algorithmic methods like "OPTI" or "ZERO" that select lots post-transaction are not IRS-recognized and create audit risk.
Ignoring the Wash Sale Question
The US wash sale rule (IRC Section 1091) does not currently apply to cryptocurrency: crypto is classified as "property," not "stock or securities." This means you can sell at a loss and immediately repurchase. However, crypto held through certain vehicles like ETFs may trigger wash sale rules. Canada's superficial loss rule already covers crypto within a 61-day window, and the UK's 30-day matching rule functions similarly. Multiple US legislative proposals have attempted to extend wash sale rules to digital assets, though none have passed as of mid-2026.
Tracking Cost Basis Across Multiple Exchanges
Each exchange only knows what happened on its platform. When you transfer crypto between platforms, the receiving exchange has no record of your original purchase price. Starting with the 2026 tax year, brokers will report cost basis on Form 1099-DA, but only for covered securities that were both acquired and sold on that same platform. Transferred assets are noncovered: you must supply the basis yourself.
The 2025 per-wallet tracking requirement adds another layer of complexity. You must maintain separate cost basis pools for each wallet and account. Selling from a specific wallet means using the basis of units held in that wallet, not units held elsewhere. This makes reconciling transfers between wallets critical: you need to match withdrawal timestamps to deposit timestamps, confirm addresses, and ensure each transfer is classified as a non-taxable movement rather than a disposal.
For a comparison of software that automates this process, see our crypto accounting software comparison. For a broader view of how crypto taxation interacts with traditional accounting, read our stablecoin accounting and tax guide.
Which Method Should You Use?
The optimal method depends on your portfolio composition, holding periods, and tax situation:
- FIFO works best when your oldest lots qualify for long-term capital gains rates and the rate differential outweighs the higher basis of newer lots
- HIFO (via Specific Identification) minimizes current-year tax liability, useful for active traders who want to defer gains
- LIFO (via Specific Identification) is similar to HIFO in rising markets but may produce different results when prices are volatile
- Specific Identification with per-transaction lot selection gives maximum flexibility but demands the most rigorous record-keeping
Remember that HIFO and LIFO defer taxes rather than eliminate them. Your remaining portfolio will consist of low-basis lots, and those gains will eventually be realized. For high-volume traders, the crypto profit calculator can help model the impact of different methods on your overall position.
Frequently Asked Questions
What is the best cost basis method for crypto?
There is no universally best method. HIFO (via Specific Identification) minimizes current-year tax liability, making it popular with active traders. FIFO is the simplest and is the IRS default. If your oldest lots qualify for long-term capital gains rates, FIFO may produce a lower effective tax rate despite showing a higher nominal gain. The right choice depends on your holding periods, income bracket, and whether you prioritize simplicity or tax optimization.
Does the IRS allow LIFO for cryptocurrency?
Not as a standalone method. The IRS recognizes only FIFO and Specific Identification for digital assets. You can achieve LIFO-equivalent results by using Specific Identification to designate your most recently acquired lots at or before the time of each sale. This requires maintaining records that identify the exact units sold, including acquisition date, basis, and fair market value.
What happens if I do not track my crypto cost basis?
Without cost basis records, your entire sale proceeds may be treated as taxable gain (effectively a zero basis). Starting with the 2025 tax year, exchanges report gross proceeds on Form 1099-DA. If you cannot substantiate your basis, the IRS may assess tax on the full reported amount. Reconstructing historical cost basis from exchange records, blockchain data, and wallet histories is possible but increasingly difficult as exchanges shut down or deprecate APIs.
Can I change my cost basis method between tax years?
In the US, you can switch between FIFO and Specific Identification for new transactions. However, you cannot retroactively change the method used for prior disposals. If you used FIFO for a sale in 2024, you cannot reclassify that sale as Specific Identification on an amended return. For future transactions, you can adopt a different approach by establishing new standing instructions and documenting the change.
How do I calculate cost basis for crypto received as income?
For crypto received as payment for goods or services, the cost basis equals the fair market value at the time of receipt. This applies to mining rewards, staking rewards, airdrops, and compensation paid in cryptocurrency. You report the FMV as ordinary income in the year received, and that same FMV becomes your cost basis for calculating capital gains when you later sell.
Do I need to track cost basis for stablecoin transactions?
Yes. Stablecoins are treated as property by the IRS, and every disposal is a taxable event. While gains and losses on stablecoin transactions are typically minimal (since price stays near $1), they still must be tracked and reported. The 2025 Form 1099-DA regulations include a $10,000 de minimis threshold for stablecoin reporting by brokers, but this does not eliminate the taxpayer's obligation to report.
What is the per-wallet tracking rule?
Effective January 1, 2025, the IRS requires cost basis to be tracked separately for each wallet and account. You can no longer pool cost basis across all your holdings. When you sell from a specific exchange account, you must use the basis of lots held in that account. This means transferring crypto between wallets does not carry over the "queue position" from your global FIFO order: each wallet maintains its own independent lot sequence.
This tool is for informational purposes only and does not constitute financial, tax, or legal advice. Tax rules vary by jurisdiction and change frequently. Always consult a qualified tax professional before making decisions about cost basis methods. Data is based on publicly available IRS guidance and international tax authority publications as of mid-2026.
Build with Spark
Integrate bitcoin, Lightning, and stablecoins into your app with a few lines of code.
Read the docs →
