Tax Lots: FIFO vs Specific Identification
By MALI ·

When you sell part of a position bought at different times, FIFO (first in, first out) treats the oldest shares as the ones sold, while specific identification lets you choose which lot you sell. Under US federal rules, FIFO applies when you don't adequately identify the shares; to use specific identification, you tell your broker which lot to sell at the time of the sale and get written confirmation. The choice changes both the size of your gain or loss and whether it's short- or long-term.
This article covers US federal income tax rules for individuals and is educational, not tax advice; state rules and your own situation may differ. It's part of portfolio management for self-directed investors.
The rules
The default is FIFO
Treasury Regulation section 1.1012-1(c)(1) says that when you sell stock bought on different dates or at different prices and don't adequately identify the lot, the shares sold are charged against the earliest lot you acquired. IRS Publication 550 puts it the same way: if you can't adequately identify the shares you sell, their basis is the basis of the shares you acquired first.
Specific identification
For shares held by a broker, Publication 550 says you make an adequate identification if you:
- tell the broker the particular shares to be sold at the time of the sale, and
- receive written confirmation of this from the broker within a reasonable time.
The regulation also treats a standing order or instruction for specific identification as adequate identification. That's how "highest cost first" or "tax-efficient" settings at brokers work: they're standing instructions that pick lots by a rule. You still carry the burden of proving the basis of the shares you identified.
Average basis is for funds, not stocks
You generally can't use an average cost per share for individual stocks. The average basis method is available for shares of mutual funds (regulated investment companies) and shares acquired through a dividend reinvestment plan, under Regulation 1.1012-1(e), and you choose it by notifying your broker or fund in writing.
Holding period
Publication 550: property held more than one year gives a long-term gain or loss; one year or less, short-term. Count from the day after you acquired the shares; the day you sell counts. The lot you pick decides which applies.
How losses are used
Capital losses first offset capital gains. If losses exceed gains, IRS Topic 409 says you can deduct up to $3,000 of the net loss a year against other income ($1,500 if married filing separately), and carry the rest forward to later years.
A worked example
In this illustrative example, an investor holds 300 shares of a hypothetical stock in three lots (commissions ignored):
| Lot | Bought | Shares | Cost per share | Holding period at sale |
|---|---|---|---|---|
| 1 | March 2022 | 100 | $40 | Long-term |
| 2 | February 2025 | 100 | $85 | Long-term |
| 3 | June 2026 | 100 | $75 | Short-term |
They sell 100 shares at $70 in November 2026. Proceeds: $7,000.
- FIFO (lot 1): $7,000 − $4,000 = $3,000 long-term gain.
- Highest cost first (lot 2): $7,000 − $8,500 = $1,500 long-term loss.
- Specific identification of lot 3: $7,000 − $7,500 = $500 short-term loss.
Same sale, same price, three different results on the tax return. Which is best depends on everything else that year: other gains and losses, their types, the investor's tax rates, and what they plan to sell later.
What the choice doesn't change is the total. Selling lot 2 now leaves the low-cost lot 1 in the account, with its $3,000 of gain still there for a future sale. Specific identification moves gains and losses between years and between short- and long-term; it doesn't make them disappear.
Which method suits which situation
| Situation | What lot choice can do |
|---|---|
| You want to realize a loss to offset gains this year | Pick high-cost lots, checking the wash sale window first |
| You have losses carried forward and want to use them | Pick low-cost lots to realize gains the losses can absorb |
| You're close to a lot turning long-term | Sell a different lot and let that one pass the one-year mark |
| You don't want to think about it | FIFO is the default, and it's simple, but in a rising market it tends to sell the lowest-cost, largest-gain shares first |
None of these is right in every case. The point is to decide deliberately, before the order, rather than accept the default by accident.
The wash sale catch
Choosing a loss lot doesn't help if the loss is disallowed. Under the wash sale rule (IRC section 1091), a loss on a sale is disallowed if you buy substantially identical stock within 30 days before or after it, and the disallowed loss is added to the basis of the replacement shares. In the example, lot 3 was bought more than 30 days before the November sale, so it doesn't trigger the rule on its own, but a reinvested dividend or a new purchase in the window could. The wash sale rule for active traders covers the details.
Practical steps
- Check your broker's default method. Many use FIFO unless you change it. Some offer standing options such as highest cost or tax-efficient loss harvesting.
- Decide before you place the order. Identification has to happen at the time of the sale. Choosing a lot after the trade settles, when you see the result, isn't adequate identification.
- Keep the confirmation. The written confirmation of the lot sold is your evidence.
- Fix the basis first. Lot selection only works if each lot's basis is right, including splits, spin-offs and noncovered shares. See Import brokerage history and get true cost basis.
- Treat funds separately. For mutual fund and dividend reinvestment plan shares, check whether you or your broker elected average basis; that election changes how every later sale of those shares is figured.
- Reconcile with Form 1099-B. The broker reports the lots it believes you sold; make sure that matches your instructions.
Where MALI fits
MALI's portfolio tracker replays your imported purchases and sales lot by lot, with fees included in each lot's cost. Its tax-loss harvest planning shows the result of a sale by FIFO, highest cost first, or the specific lots you pick, marks which lots are long-term and when a short-term lot turns long-term, and flags a possible wash sale when the same symbol was bought within 30 days before or after a loss sale. It uses the tax rates you enter.
Limits: MALI doesn't place the order or send the lot instruction to your broker; you do that. It only sees the accounts you import, and its tax views are estimates using simplified rules, not tax advice. For a pre-trade check, the Compliance Co-pilot (Edge) screens a proposed trade for a possible wash sale under IRC section 1091 using the figures you enter.
FAQ
Do I have to use FIFO when I sell shares?
No. FIFO is the default when you don't identify the shares. You can use specific identification by telling your broker which lot to sell at the time of the sale and getting written confirmation, or by setting a standing instruction.
Can I change the lot after the sale?
Generally not. Publication 550 requires the identification at the time of the sale, followed by the broker's written confirmation. Check your broker's procedure before you trade.
Is highest cost first the same as specific identification?
It's a way of applying specific identification: a standing instruction that picks the highest-cost lot each time. The regulation treats a standing order for specific identification as adequate identification.
Can I use average cost for my stocks?
Generally not for individual stocks. Average basis is available for mutual fund shares and shares acquired through a dividend reinvestment plan.
Sources
- Publication 550 (2025), Investment Income and Expenses, IRS
- 26 CFR 1.1012-1, Basis of property, eCFR
- 26 U.S. Code 1012, Cost, Legal Information Institute
- Topic no. 409, Capital gains and losses, IRS
This article is educational and is not investment advice. MALI is a research and analytics platform; it does not recommend buying or selling any security.
