Apply today — you could get a loan for up to $1,500. Application deadline is Dec. 31, 2025. Explore Emerald Advance® Loan

Explore All Topics

First-in, First-out stock & share selling

4 min read


4 min read

At a glance

  • FIFO (First-In, First-Out) is the default method for selling shares of stock, selling the oldest shares
  • LIFO (Last-In, First-Out) is another share selling method where the newest shares are sold first, but you must notify your broker to use it.
  • Specific identification lets you choose exactly which shares to sell for more flexibility with your tax liability, but you must notify your broker to use this method.

As a stock investor you’ve likely heard the adage, Buy low; Sell high. But have you heard of FIFO (First-In, First-Out)?  FIFO is a common accounting method used to determine which of your stocks or shares to sell when you’re only selling a portion of them.

FIFO is also used in other processes (for example as an inventory valuation method), but for this post, we’re focusing on the investing angle.

Person calculating First in First out method with calculator

Read on as we outline first-In, first-Out for stocks, as well as Last-In, First-Out, and specific share identification.

FIFO accounting method (First-In, First-Out)

FIFO is the default way your brokerage figures out which shares* you sold – if:

  • Your shares were in a brokerage account, and
  • You didn’t choose a different method when you sold them.

With FIFO, your oldest shares you bought are the first ones sold. Since markets usually go up over time, those older shares probably cost less – so selling the oldest shares could mean a bigger gain. But if you’ve held them for over a year, you might qualify for lower long-term capital gains taxes.

Related articles: What is capital gains tax? Long vs. short-term capital gain.

Take note: One downside of FIFO is that those older shares may have the lowest cost basis, which can mean a higher taxable gain.

Related article: Cost basis information

*The default for mutual funds is typically average cost, not FIFO. Review other cost basis methods.   

File with H&R Block to get your max refund

LIFO accounting method (Last-In, First-Out)

LIFO is the other primary method, but it’s not the default method. That means you’ll need to specifically tell your broker to use this method. Typically, they’ll have a form or a place on their website or app where you can indicate this.

With LIFO, you sell your newest shares first. That can mean a smaller gain (and smaller tax bill), since those shares probably cost more. But there’s a catch: if you’ve held them for less than a year, you might pay higher short-term capital gains taxes.

Also, while LIFO is allowed under U.S. accounting rules (GAAP), it’s not accepted internationally under International Financial Reporting Standards (IFRS).

Specific share identification

Specific share identification (or specific identification) is exactly what it sounds like. As the account owner, you pick out the exact shares you want to sell.  This method gives you the most control over your tax situation, potentially allowing you to determine if you’ll have a capital gain or loss.

You’ll need to tell your broker before the sale, and they’ll need to send you confirmation that those are the shares that will be sold.  Again, this may be done via their website.  That’s called specific identification.

FIFO vs. LIFO vs. Specific share identification: A comparison

While these concepts are generally easy to follow, an easy example is always helpful. Let’s say you bought the same stock three times on three different dates:

  • Jan 10: 100 shares @ $10 = $1,000
  • Feb 15: 100 shares @ $15 = $1,500
  • Mar 20: 100 shares @ $20 = $2,000

On May 1, you sell 150 shares at $25 per share. That’s $3,750 in proceeds.

Using FIFO:

You’d sell the oldest shares first:

  • Sell 100 shares from Jan 10 @ $10 = $1,000
  • Sell 50 shares from Feb 15 @ $15 = $750
  • Cost basis = $1,750
  • Capital gain = $3,750 – $1,750 = $2,000

Using LIFO:

You’d sell the newest shares first:

  • Sell 100 shares from Mar 20 @ $20 = $2,000
  • Sell 50 shares from Feb 15 @ $15 = $750
  • Cost basis = $2,750
  • Capital gain = $3,750 – $2,750 = $1,000

Using Specific Identification:

You tell your broker to sell:

Capital gain = $3,750 – $2,250 = $1,500

50 shares from Jan 10 @ $10 = $500

50 shares from Feb 15 @ $15 = $750

50 shares from Mar 20 @ $20 = $1,000

Cost basis = $2,250

Rely on H&R Block for help with reporting your capital gains

While taxes for your investments can be tricky, you don’t have to go it alone. Trust the expertise of H&R Block to help make sense of your taxes. Make an appointment to file with a tax pro or with H&R Block Online.

Was this topic helpful?