Limited time: $9 launch price · Get the full ebook
Taxes

FIFO vs LIFO vs HIFO: Bitcoin Cost Basis Methods Explained for Beginners

When you sell some Bitcoin and you bought several lots at different prices, which lots count toward your gain? The answer is your cost basis method, and the wrong choice can cost you thousands in needless taxes.

By The BitcoinHomeBase Team · Updated 2026-05-08 · 10 min read

Picture this. You have been DCAing Bitcoin for two years. Your average buy price is $48,000, but you bought some lots at $30,000 and some at $90,000. This year you sell 0.1 BTC. The IRS asks: what was the cost basis of the Bitcoin you sold? You have to pick one of those lots. Which one?

The answer is your cost basis method. It is one of the highest-leverage decisions in your Bitcoin tax situation, because the wrong choice can cost you thousands of dollars in needless capital gains tax. The right choice can legally save you the same amount.

This article is the plain-English explanation of FIFO, LIFO, HIFO, and Specific Identification — what they are, how they differ, what the IRS allows in 2026, and how to pick the right one for you. Worked examples included. None of this is tax advice; talk to a CPA before filing.

The setup: why cost basis matters

In the US, Bitcoin is taxed as property. When you sell or spend it, you owe capital gains tax on the difference between what you sold for and what you originally paid — the cost basis. If your cost basis is high, your gain is low, your tax is low. If your cost basis is low, your gain is high, your tax is high.

When you have only ever bought one lot, this is trivial: the cost basis is what you paid. When you have bought 47 lots over four years at 47 different prices, you need a method to assign one of those purchase prices to whatever you sell. Different methods produce wildly different tax bills on the same trade.

Our broader piece on Bitcoin taxes for beginners covers the basics of what gets taxed and when. This article is specifically about the lot-assignment problem.

FIFO: First In, First Out

The default. The IRS assumes FIFO unless you specifically elect otherwise. FIFO means: the first Bitcoin you bought is the first Bitcoin you sell. The oldest lot leaves first.

Worked example. You bought 0.1 BTC at $30,000 in 2023 and 0.1 BTC at $90,000 in 2025. In 2026 you sell 0.1 BTC at $100,000. Under FIFO, the lot you sold is the 2023 lot. Cost basis: $30,000. Sale price: $100,000. Capital gain: $70,000.

Two notes. First, because the 2023 lot was held more than 12 months before the 2026 sale, this is a long-term capital gain (taxed at 0%, 15%, or 20% federal depending on income), not a short-term one. Second, FIFO almost always produces the largest gain in a rising market because your oldest, cheapest coins are the ones being attributed to your sale.

LIFO: Last In, First Out

The opposite of FIFO. The most recent Bitcoin you bought is the first Bitcoin you sell.

Worked example using the same setup. 0.1 BTC bought 2023 at $30,000, 0.1 BTC bought 2025 at $90,000, sell 0.1 BTC in 2026 at $100,000. Under LIFO, the lot you sold is the 2025 lot. Cost basis: $90,000. Sale price: $100,000. Capital gain: $10,000.

That is a $60,000 lower reported gain than FIFO produced — on the exact same sale. At a 20% long-term capital gains rate, that is a $12,000 difference in tax. (Caveat: the 2025 lot might have been held less than 12 months by the time of the sale, which would make this a short-term gain, taxed at ordinary income rates — potentially higher than the long-term rate. The math gets situation-specific quickly.)

HIFO: Highest In, First Out

The tax-optimization favorite. HIFO means the lot with the highest cost basis is sold first, regardless of when you bought it.

Worked example with three lots. Bought 0.1 BTC in 2023 at $30,000, 0.1 BTC in 2024 at $60,000, 0.1 BTC in 2025 at $90,000. Sell 0.1 BTC in 2026 at $100,000. HIFO picks the $90,000 lot first. Cost basis: $90,000. Capital gain: $10,000.

HIFO will always produce the smallest gain (or largest loss) on any given sale, because by definition it picks your most expensive coins to attribute to the sale. This is why most Bitcoin investors who optimize for taxes use HIFO when they are eligible to.

Specific Identification: pick lot by lot

FIFO, LIFO, and HIFO are formulas. Specific Identification (‘SpecID’) is the manual version. You explicitly tell the IRS which specific lot you sold. Done correctly, this is the most flexible method — you can pick any lot for any sale, optimizing for gain harvesting, loss harvesting, holding period, or whatever else.

The catch: you have to be able to actually identify the lot. The IRS rules require ‘adequate identification’ at the time of the sale, including the date acquired, the cost basis, and the specific units sold. In practice, this means: the records have to be in your tax software or your CPA's spreadsheet at the moment of sale, not reconstructed afterward.

Most modern Bitcoin tax software (CoinTracker, Koinly, ZenLedger) supports SpecID and will automatically pick the lot that minimizes tax for each sale. This effectively gives you HIFO without you having to think about it. Our piece on Bitcoin tax software in 2026 compares which tools support which methods.

What changed in 2025: the per-wallet rule

Through 2024, you could pool all of your Bitcoin across all your wallets and exchanges into one universal cost basis pool. Starting January 1, 2025, the IRS requires per-wallet (or per-account) accounting. Now each wallet and each exchange account is its own separate pool. If you sell from Coinbase, you can only choose lots that came from Coinbase. If you sell from your hardware wallet, you can only choose lots that came from your hardware wallet.

This matters because your most expensive lots may be sitting on Wallet A while your cheapest lots are on Wallet B. Under per-wallet accounting, you cannot use HIFO across the boundary. The cheapest place to sell tax-wise is now whatever account holds your most-expensive lots.

Practical implications: be deliberate about which wallet you sell from. If you have a high-cost-basis lot you want to harvest, it has to be in the wallet you sell from. Many tax pros now recommend keeping each tranche of buying in its own wallet so you can address them individually.

Which method should you actually pick?

For most Bitcoin holders in a rising market, HIFO (or Specific Identification configured to behave like HIFO) minimizes tax. But three caveats:

  1. Holding period matters. Long-term gains (held over 12 months) are taxed at much lower rates than short-term gains. If HIFO would force you to sell a recent lot at short-term rates, you might prefer to sell an older long-term lot instead, even if its cost basis is lower. Our piece on tax-loss harvesting in 2026 goes deeper on this tradeoff.
  2. State taxes vary. A few states do not allow HIFO. Check your state's rules.
  3. Once you pick, stay consistent. The IRS expects you to use one method per filing year for a given asset. Hopping between methods to gain and loss harvest in the same year invites questions.

Default position for most beginners: enable Specific Identification (or HIFO) in your tax software. Set it. Forget it. Confirm with a CPA before filing if your gains exceed five figures.

Common beginner mistakes

The shortest possible summary

  1. FIFO sells your oldest, cheapest coins first — usually the highest tax bill.
  2. LIFO sells your newest coins first — sometimes lower tax, but careful with short-term holding periods.
  3. HIFO sells your most expensive coins first — almost always the lowest tax in a rising market.
  4. Specific Identification lets you manually pick — the most flexible, requires good records.
  5. Since 2025, accounting is per-wallet — you can only pick lots from the wallet you sell out of.
  6. Default for most beginners: HIFO via tax software, double-check with a CPA before filing.

None of this is tax advice. The numbers above will be different in your situation. The point is just to know that you have a choice, and that the default choice is usually not the cheapest one. Spending an hour with your tax software's settings can save you a four-figure check next April.