Cost Basis Methods: FIFO LIFO and Specific ID
Your cost-basis method is one of the few legal levers that directly lowers your tax bill. Choosing specific-ID over the FIFO default can save real money.
Don't have time? Here's what you need to know:
- 1Cost-basis method only matters when you've bought a fund at different prices and sell part of the position; it sets which shares are sold.
- 2FIFO (the broker default) sells oldest, usually lowest-basis lots first and tends to maximize taxable gains.
- 3Specific identification gives full control to minimize gains or harvest losses and is the best default for tax-aware investors.
- 4You must choose your method before the sale settles, and average cost may lock you in once used.
Why the Method You Pick Changes Your Tax Bill
If you have only ever bought an ETF once and sell all of it, cost basis is trivial: proceeds minus what you paid. The method matters the moment you have bought the same fund at different prices and sell only part of the position. Now there is a choice about which shares are considered sold, and that choice determines the size of your taxable gain. Selling your lowest-basis shares produces a large gain; selling your highest-basis shares produces a small one or even a loss.
This is one of the few tax levers entirely within your control and fully legal. The IRS lets you pick a method, but you must do so by the time the sale settles, not at filing. Default behavior at most brokers is FIFO, which is rarely the most tax-efficient choice, so understanding the alternatives is worth real money over a lifetime of taxable investing.
FIFO: The Default You Probably Didn't Choose
First-in, first-out sells your oldest shares first. Because markets tend to rise over long periods, your oldest lots are often your lowest-cost ones, so FIFO tends to realize the largest gains. There is a silver lining: those oldest lots are also the most likely to be long-term, qualifying for the lower 0/15/20% rates rather than ordinary short-term rates.
FIFO is simple and requires no instructions, which is exactly why brokers default to it. But simplicity is not the same as tax efficiency. If your goal is to minimize the gain on a partial sale, FIFO usually works against you. It is a reasonable default for someone who wants no decisions, and a poor one for anyone actively managing their tax exposure.
Specific Identification: The Power Tool
Specific identification lets you tell your broker exactly which lots to sell. This is the most flexible method and the one tax-aware investors use. Want to minimize a gain? Sell your highest-basis lots. Want to harvest a loss to offset other gains? Sell the lots that are underwater. Want to deliberately realize a long-term gain in a low-income year to reset your basis higher? Pick the lots that accomplish exactly that.
The catch is process: you must specify the lots at the time of sale and get written confirmation from the broker. Most online brokers let you select lots in the order ticket or set a default lot-selection rule. Specific-ID pairs naturally with tax-loss harvesting on funds like VTI, where you can sell a losing lot, capture the loss, and rotate into a similar-but-not-identical fund to stay invested while sidestepping the wash-sale rule.
Tip: Set your account's default disposal method to specific identification (or highest-cost-first) so you never accidentally sell low-basis shares under FIFO when you meant to harvest a loss.
Ready to invest? Open an IBKR account in 10 minutes and get free stock. $0 commissions on US ETFs • Fractional shares from $1 • 150+ global markets.
Average Cost and How the Methods Compare
Average cost blends all your lots into a single per-share basis. It is available for mutual funds and, at some brokers, for ETFs in dividend-reinvestment plans, and it is appealingly simple. The downside is that it strips away your ability to choose high- or low-basis lots, surrendering the control that specific-ID gives you. Once you sell using average cost on a fund, you may be locked into that method for existing shares.
The example below shows how the same partial sale produces very different gains depending on the method. Assume you own three lots of the same ETF and sell 100 shares while it trades around $200. The proceeds are identical; only the basis applied differs.
| Method | Lot sold (basis/share) | Basis on 100 shares | Gain at $200/share |
|---|---|---|---|
| FIFO | Oldest lot @ $100 | $10,000 | $10,000 |
| Specific ID (highest cost) | Newest lot @ $190 | $19,000 | $1,000 |
| Specific ID (harvest loss) | Underwater lot @ $220 | $22,000 | −$2,000 loss |
| Average cost | Blended @ ~$160 | $16,000 | $4,000 |
How to Choose for Your Situation
For most tax-aware investors, specific identification is the default to set and forget, because it preserves every option you might want later. If you never plan to sell partial positions or harvest losses and value pure simplicity, FIFO is acceptable. Average cost suits investors who reinvest dividends in a single fund and do not want to think about lots, accepting less control in exchange.
Whatever you choose, set it deliberately at the broker rather than letting FIFO happen to you by default. And keep your own basis records, especially for older noncovered lots the broker may not track. The right method only helps if the underlying basis data is accurate, so reconcile reinvested dividends and transfers when shares move between accounts.
Important: Once you sell shares of a fund using average cost, you may be unable to switch those shares back to specific-ID later. Decide before your first sale, not after.
Want the full framework? This 2-hour ETF course teaches you exactly how to pick, buy, and hold profitable ETFs — from zero to confident investor. Under $15.
Frequently Asked Questions
What is the best cost-basis method for ETFs?
For most tax-aware investors, specific identification is best because it lets you choose exactly which lots to sell, giving full control to minimize gains or harvest losses. FIFO, the common default, sells oldest (often lowest-basis) shares first and tends to maximize gains. Average cost is simplest but surrenders that control. Set specific-ID as your default before your first partial sale.
What does FIFO mean for my taxes?
First-in, first-out sells your oldest shares first. Since older lots are usually your lowest-cost ones in a rising market, FIFO tends to produce the largest taxable gains on a partial sale. The upside is those lots are usually long-term, qualifying for the lower 0/15/20% rates. It is the default at most brokers but rarely the most tax-efficient choice.
Can I change my cost-basis method after I buy?
You can generally set or change your method for future sales up until a sale settles, but you must specify lots at the time of sale, not at filing. One caveat: once you sell shares of a fund using average cost, you may be locked into average cost for the remaining shares of that fund, so decide before your first disposal.
How does specific identification help with tax-loss harvesting?
Specific-ID lets you sell only the lots that are underwater, locking in a capital loss to offset other gains and up to $3,000 of ordinary income per year. Without it, FIFO might force you to sell appreciated lots and realize a gain instead. Pair it with rotating into a similar-but-not-substantially-identical ETF to avoid the wash-sale rule while staying invested.
Further Reading
Free Tools
Alex Harrington
CFA Level II Candidate, Finance & Economics
Alex Harrington is an independent ETF researcher and personal finance writer with over 8 years of experience analyzing exchange-traded funds. A CFA Level II candidate with a background in economics, Alex has reviewed 800+ ETFs and helped thousands of beginners build their first investment portfolios through clear, jargon-free education.
This content is for educational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Consult a licensed financial advisor before making investment decisions.