Skip to content

First-In, First-Out (FIFO)

First-in, first-out is the default rule for figuring which shares of stock a sale counts as coming from when you have not told your broker otherwise. It treats the oldest shares you own as the ones sold first, which in a long-rising market tends to produce the largest possible taxable gain.

Last reviewed by Steven Fox, CFP®, EA on

Quick Summary

  • FIFO applies automatically to a sale of stock when the shares were not adequately identified beforehand. There is nothing to elect; it is what happens by default.
  • The rule charges a sale against the earliest lot of shares acquired, regardless of which lot was actually delivered or which lot has the most favorable basis.
  • In a stock that has generally risen over time, the oldest lot usually has the lowest basis, so the FIFO default tends to realize the largest gain available among the lots held.
  • FIFO also names a separate method used in small-business inventory accounting for cost of goods sold. The two share a name and a similar ordering logic but govern entirely different situations.
  • Choosing specific share identification before a sale is the only way to override the FIFO default for securities; there is no way to change the method after the trade has settled.

Definition

First-in, first-out, abbreviated FIFO, is the default method for determining which shares of a security a sale is treated as coming from, when a taxpayer has not adequately identified a specific lot at the time of the sale. Treasury Regulation 1.1012-1(c)(1)(i) sets the rule: where shares of stock were bought or acquired on different dates or at different prices and the taxpayer sells part of the holding without adequate identification, the shares sold are charged against the earliest lot purchased or acquired.

FIFO is not something a taxpayer chooses. It is what happens automatically in the absence of a choice, which makes it the method that governs the overwhelming majority of security sales, since most investors do not specifically identify lots at the time of sale.

Advanced Explanation

The rule operates independently of which physical or book-entry shares are actually delivered in the transaction. Modern brokerage accounts do not hold physically distinguishable share certificates for different purchase lots; shares of the same stock are fungible in the account. FIFO is a tax accounting convention layered on top of that fungible holding, assigning the earliest-acquired basis and holding period to the shares being sold, regardless of any operational detail about which shares moved. The rule answers a tax question, not a custody question.

The default has a predictable direction of effect in a market that has generally trended upward. Because the earliest lot was typically bought at the lowest price, in a stock or fund that has risen over time, charging a sale against that earliest lot typically produces the largest available taxable gain among the lots an investor holds. An investor who wants to minimize the taxable gain on a particular sale, or who wants to preserve a favorable long-term holding period on a specific lot, has to act before the sale by specifically identifying a different lot; simply doing nothing defaults into the outcome least likely to minimize the tax bill.

Since 2011, FIFO governs broker reporting as well as the taxpayer's own return, for covered securities. IRC 6045(g)(2)(B)(i) requires a broker to apply the first-in, first-out method for reporting adjusted basis on Form 1099-B unless the customer notifies the broker of an adequate identification, mirroring the taxpayer-facing rule in the Treasury regulation. This is why a broker's default cost-basis reporting on an ordinary stock sale, absent any specific instruction from the account holder, uses FIFO, and why the figure on a 1099-B will change if a customer gives the broker a specific identification before a sale rather than after.

FIFO also names a completely separate accounting method, and the shared name is a genuine source of confusion rather than a coincidence to wave away. In small-business and inventory accounting, first-in, first-out is a method for valuing cost of goods sold and ending inventory, assuming the oldest inventory items are the first ones sold to customers. The ordering logic, oldest first, is the same idea applied to a different subject. A securities investor reading about FIFO in the context of a small business's inventory, or vice versa, is reading about a related but distinct application of the same underlying convention, not about the stock-sale rule this page describes.

Choosing a different method requires acting before the sale, not after. The only way to avoid the FIFO default on a securities sale is specific share identification, made at the time of the sale and confirmed in writing by the broker afterward, which is covered on its own page. Once a sale has settled without that identification, FIFO has already applied, and there is no mechanism to retroactively substitute a different lot.

Used in a Sentence

“Because he had never told his broker which shares to sell, the sale defaulted to first-in, first-out and drew from the lot he had bought fifteen years earlier at the lowest price.”

How It Works

When a sale of stock is not accompanied by an adequate identification of which lot is being sold, the earliest lot acquired is treated as the one sold, and the gain or loss is computed using that lot's basis and holding period.

A hypothetical example. Beatriz bought the same stock in three lots: 50 shares in 2018 at $10 each (basis $500), 50 shares in 2021 at $25 each (basis $1,250), and 50 shares in 2024 at $40 each (basis $2,000). She sells 50 shares in 2026 at $55 each, without identifying which lot, so FIFO applies and the sale is charged against the 2018 lot.

The gain is $2,250 (50 × $55 − $500), and because the 2018 lot was held more than a year, it is a long-term gain. Had Beatriz instead specifically identified the 2024 lot before the sale, the gain would have been $750 (50 × $55 − $2,000), $1,500 smaller ($2,250 − $750), also long-term since the 2024 lot had by then also been held more than a year. FIFO, by reaching for the lowest-basis lot first, produced the largest gain among the three lots available, which is the pattern the default tends to produce in a stock whose price has generally risen.

Pros and Cons

Pros

  • Requires no action from the investor and no recordkeeping burden at the time of sale, since it applies automatically.
  • Gives a predictable, consistent rule that both the taxpayer and the broker apply the same way for covered securities.
  • Matches the intuitive default most investors would expect, oldest shares sold first, even without any tax planning.
  • Straightforward to compute once each lot's purchase date and price are known.

Cons

  • Tends to realize the largest available gain, in a stock that has generally risen, precisely because it reaches for the lowest-basis lot first.
  • Offers no control; an investor who wants a different outcome has to override it with specific identification before the sale, not after.
  • Shares a name with an unrelated inventory-accounting method, which invites confusion between two genuinely different applications of the same ordering idea.
  • Applying it correctly depends on accurate records of each lot's purchase date and basis, which for older, noncovered holdings may be incomplete.

People Also Asked

Answers to the most frequently asked questions.

Is FIFO something I have to choose?
No. FIFO is the default that applies automatically to a securities sale when the shares have not been adequately identified beforehand. Nothing needs to be elected or filed to have it apply; it governs unless an investor takes the additional step of specifically identifying a different lot at the time of the sale.
Does FIFO always produce the largest gain?
Not always, but often, in a security whose price has generally risen over the time the investor has held it, because the earliest lot was typically bought at the lowest price. In a security whose price has fallen or fluctuated without a clear trend, the earliest lot is not necessarily the lowest-basis one, so FIFO will not reliably produce the largest gain in every case.
Is the FIFO used for stock the same as the FIFO used in business inventory accounting?
They share a name and the same basic ordering logic, oldest first, but they govern different situations. The securities rule in Treasury Regulation 1.1012-1(c) determines which lot of stock a sale is charged against for basis purposes. The inventory accounting method values cost of goods sold and ending inventory for a business. Reading about one does not tell you about the rules governing the other.
How do I avoid the FIFO default?
By making a specific share identification at the time of the sale, telling your broker which particular lot to sell and receiving written confirmation afterward. This has to happen before or at the moment of the trade; once a sale has settled without an identification, FIFO has already applied and cannot be undone by deciding afterward which shares you meant to sell.
Do brokers report basis using FIFO?
For covered securities, yes, by default. IRC 6045(g)(2)(B)(i) requires a broker to apply the first-in, first-out method when reporting adjusted basis on Form 1099-B unless the customer has notified the broker of an adequate identification of the shares sold. A customer who wants a different method reported has to give that instruction before the sale, not after receiving the form.

Have a question a definition can't answer?

Advice-only advisors answer questions like this for a transparent flat fee — no products, no commissions, no asset management.

Find an Advisor