What Are FIFO and LIFO?
When you sell shares of a stock or fund that you purchased at different times and prices, you need a method to determine which shares you are selling and therefore what your cost basis is. FIFO (First In, First Out) assumes you sell the oldest shares first, while LIFO (Last In, First Out) assumes you sell the most recently purchased shares first. The choice between these methods can produce dramatically different tax outcomes from the exact same set of transactions.
A Concrete Numerical Example
Suppose you made three purchases of the same stock: 100 shares at $40 in January, 100 shares at $50 in June, and 100 shares at $60 in November. In December, you sell 100 shares at $55. Under FIFO, you sell the January shares (cost $40), realizing a gain of $15 per share, or $1,500 total. Under LIFO, you sell the November shares (cost $60), realizing a loss of $5 per share, or a $500 loss. The difference is $2,000 in taxable income from the same economic transaction. At a 20% capital gains rate, FIFO produces a $300 tax bill while LIFO generates a $100 tax benefit.
U.S. Tax Rules and Specific Identification
In the United States, FIFO is the default method for securities if you do not specify otherwise. However, the IRS allows 'specific identification,' where you designate exactly which lot you are selling at the time of the trade. This gives you maximum flexibility to manage your tax liability. Most online brokerages now support specific identification through their platforms, letting you select the highest-cost lots to minimize gains or the lowest-cost lots to maximize gains depending on your tax situation. Mutual funds also offer the average cost method, which divides your total cost basis equally across all shares.
FIFO vs LIFO vs Average Cost: When to Use Each
FIFO tends to produce larger gains in a rising market because you sell the cheapest shares first, which means higher tax bills but also a higher remaining cost basis. LIFO is advantageous when you want to harvest losses or minimize current-year gains, but it is not permitted for mutual funds under IRS rules. The average cost method simplifies record-keeping and is popular for mutual fund investors who make regular contributions. For ETF and individual stock investors, specific identification offers the most control and is generally the optimal choice if your brokerage supports it. Accounting and tax planning guides explain cost basis methods in detail
Practical Considerations for Investors
Whichever method you choose, consistency and record-keeping are essential. Once you elect a method for a particular account, switching mid-year can create complications. Keep records of every purchase lot including date, quantity, and price. If you use tax-loss harvesting, coordinate your cost basis method with your harvesting strategy: specific identification lets you cherry-pick the highest-cost lots to sell at a loss while retaining lower-cost lots for future appreciation. Also be aware that in some jurisdictions, such as Japan, the average cost method is mandatory for listed securities, removing the choice entirely.