FIFO: First In, First Out
The default cost basis method for stock, with a worked example.
If you own several lots of the same stock bought at different times and prices, and you don't identify which shares you are selling, the tax rules treat the first shares you bought as the first shares sold. This is "first in, first out," or FIFO. It is the default method for stock under Treas. Reg. § 1.1012-1(c), and most brokers use it unless you choose otherwise.
Example: selling part of a position
You bought shares of XYZ in three lots:
| Lot | Date bought | Shares | Price | Cost |
|---|---|---|---|---|
| 1 | Mar 2022 | 100 | $20 | $2,000 |
| 2 | Jun 2023 | 100 | $30 | $3,000 |
| 3 | Feb 2025 | 100 | $40 | $4,000 |
In October 2025 you sell 150 shares at $45 = $6,750 proceeds.
Under FIFO the 150 shares come from Lot 1 (100 shares, $2,000) and Lot 2 (50 shares, $1,500). Basis = $3,500.
Gain = $6,750 − $3,500 = $3,250, all long-term, because both lots were held more than one year.
You still own 50 shares from Lot 2 ($1,500) and all of Lot 3 ($4,000).
Why FIFO often means a bigger gain
In a rising market, your oldest shares usually have the lowest cost, so FIFO tends to realize the largest gain. The upside is that older shares are more likely to be long-term. Compare the same sale using specific identification.
Fees count
Commissions and fees paid to buy shares are added to basis; fees paid to sell reduce the proceeds (Pub. 550 and Pub. 551).
Frequently asked questions
Is FIFO required?
No. FIFO is the default if you do not adequately identify the shares sold. You can use specific identification for any stock, and average cost for mutual fund or DRIP shares.
Does FIFO apply account by account?
Yes. For covered securities, brokers apply the method separately to each account; shares in one account are not mixed with shares in another for this purpose.
Sources
- Treas. Reg. § 1.1012-1: Basis of property (FIFO default, adequate identification, average basis)
- 26 U.S.C. § 1012: Basis of property, cost
- IRS Publication 550: Investment Income and Expenses (basis of investment property, wash sales, nondividend distributions)
- IRS Publication 551: Basis of Assets
- IRS: Instructions for Form 1099-B (covered securities, boxes 1e, 1g, 5 and 12)
Last reviewed: November 2026