FIFO: First In, First Out

The default cost basis method for stock, with a worked example.

Educational information only, not tax, legal, or investment advice. Rules change; check the official sources listed on this page or talk with a qualified professional about your situation. Full disclaimer.

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:

LotDate boughtSharesPriceCost
1Mar 2022100$20$2,000
2Jun 2023100$30$3,000
3Feb 2025100$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

Last reviewed: November 2026