Venturers Cove

FIFO, LIFO, and HIFO: How Your Cost Basis Method Changes Your Tax Bill

Updated November 14, 2026

When you sell part of a position you bought at different times and prices, the lots you sell decide your gain and your tax. This guide explains the main cost basis methods and the tradeoffs between them.

Key takeaways

  • The cost basis method decides which purchase lots count as sold, which changes your gain, loss, and tax.
  • FIFO sells oldest first, LIFO sells newest first, and HIFO sells highest cost first.
  • A method that lowers your tax now can leave lower-basis lots that create bigger gains later.
  • You generally must identify the lots when you sell and keep records, or your broker’s default applies.
  • Crypto basis is tracked separately for each wallet or account.

Why the method matters

If you buy the same investment several times at different prices, each purchase is its own lot, with its own cost basis and its own purchase date. When you sell only part of your position, the lots you say you sold decide your gain or loss, and whether it’s short-term or long-term. The rule for picking lots is your cost basis method.

An example. You bought 10 shares of a stock three times: in January 2024 at $50, in March 2025 at $120, and in March 2026 at $90. In November 2026 you sell 10 shares at $110, for $1,100. Here is what each method does, assuming a 24% short-term rate and a 15% long-term rate:

MethodLot soldCost basisGain or lossTermEstimated tax
FIFOJanuary 2024 lot$500$600 gainLong-term$90
LIFOMarch 2026 lot$900$200 gainShort-term$48
HIFOMarch 2025 lot$1,200$100 lossLong-term$0

Same sale, same price, three different results, from a $600 gain to a $100 loss. You can run your own numbers in our cost basis comparison.

The main methods

What the rules require

The common thread is documentation. If you can’t show which lots you sold, the default method applies.

The tradeoffs

Questions to ask before you choose

  1. Which lots are short-term and which are long-term?
  2. Do I have losses I could use, or gains I’d like to avoid?
  3. What’s my tax rate this year compared with the future?
  4. Does my broker or exchange let me pick lots, and by when?
  5. Can I document the choice?

A common approach people discuss is to sell long-term lots with the highest basis first, which tends to keep the gain small without triggering short-term treatment. It isn’t right for everyone, so run the numbers and, if the amounts are large, talk to a tax professional.

How this works for crypto

The same methods apply to crypto, with the per-wallet rule on top. A sale from one exchange can’t use lots bought in another wallet. Our crypto trade log matches sales to lots using FIFO within each wallet and shows each piece as short-term or long-term, and you can compare methods on a specific sale with the cost basis tool. For the full picture, read how crypto is taxed.

Common mistakes

Frequently asked questions

Can I change methods each time I sell?

For stocks and crypto, you can generally choose a method, or specific lots, for each sale, as long as you identify the lots at the time of sale and keep records. Mutual fund average cost has its own rules for switching, so ask your provider.

Does the method matter inside an IRA?

No. Trades inside an IRA or 401(k) aren’t taxed as they happen, so the lots you sell don’t change your tax bill there.

Which method is best?

There’s no single best method. It depends on your lots, your tax bracket, and your plans. The method that gives the lowest tax today isn’t always the lowest over several years.

Can I use HIFO for crypto?

Yes, if you can identify the specific units you sold and document it. Without that, FIFO within the wallet or account applies.

Tools that can help

Keep reading

This article is for education only and isn’t financial, investment, tax, or legal advice. Tax rules and limits change, so check IRS guidance or a qualified tax professional about your situation. See our disclaimer.