Highest In, First Out (HIFO)
Highest In, First Out (HIFO) is a tax lot selection strategy, implemented through specific lot identification, in which the shares with the highest cost basis are sold first whenever a position is reduced, minimizing the taxable gain recognized on each sale and thereby deferring tax liability as long as possible.
HIFO is not a separately recognized IRS accounting method in the same way that FIFO and average cost are. Rather, it is a systematic application of the specific lot identification method in which the investor always designates the highest-cost lot available as the one being sold. Because the IRS permits investors using specific lot identification to choose any lot they wish — subject to adequate identification requirements — consistently choosing the highest-basis lot produces the outcome that HIFO describes.
The tax benefit of HIFO is straightforward: selling the highest-cost lot minimizes the realized gain (or maximizes the realized loss) on each transaction. For a security trading at $100 per share, selling a lot with a $95 cost basis generates a $5 taxable gain per share, while selling a lot with a $60 cost basis generates a $40 gain. HIFO ensures the smaller gain is recognized now and the larger gain is deferred until a future sale — or potentially eliminated entirely if the investor holds those low-basis shares until death and benefits from the stepped-up cost basis rule under IRC Section 1014.
HIFO is most valuable for investors who expect to hold a position indefinitely or who anticipate being in a lower tax bracket in future years. It is the dominant selection strategy used by tax-loss harvesting algorithms in direct indexing platforms and robo-advisors, because it systematically minimizes current taxable income across thousands of daily trading decisions.
However, HIFO is not always optimal in every situation. When an investor has accumulated large capital losses that can absorb gains without tax consequence, realizing low-basis lots to utilize those loss carryforwards may be preferable to HIFO. Similarly, investors who expect their tax rates to rise substantially in future years might prefer to recognize gains now at current rates rather than deferring them. Additionally, HIFO may produce more short-term gains than FIFO if the highest-cost lots were purchased recently, and short-term gains are taxed at higher ordinary income rates. Balancing cost basis with holding period considerations requires analysis that pure HIFO does not address, which is why comprehensive tax lot optimization tools consider both dimensions simultaneously.