How does Capital Gains Term work in this scenario?

  1. Buy x amount of xyz stock and hold for over a year.
  2. Then buy z amount of the same asset and hold for less than a year.


  1. If I sell the initial x amount of xyz stock (held > 1 yr) after purchasing z amount of zyx (held < 1 yr) for a profit, is it taxed at long term capital gains?
  2. If I sell all in the scenario is it all taxed as short term? or is it X amount taxed long term and Z is tax short term?

Any Documentation would be appreciated as well.

  • @Fattie its similar for the first part of the question but different for the second part
    – jkdba
    Commented Jan 14, 2021 at 17:19

2 Answers 2


FIFO is one way to do it. But it's not really the best way.

For ordinary equities and ETFs, in an ordinary taxable account (tax-advantaged accounts like IRAs have different rules, as to different kinds of investments) the IRS also allows cost basis to be reported by specific identification. A lot is a group of shares you bought in one transaction. A lot is identified by the number of shares, the price you paid for them, and the date the trade executed. When you sell, you specify from which lot(s) you are selling, and the cost basis of that specific lot is used to calculate your gain or loss.

When using specific identification, you can sell whatever lots you want. The IRS doesn't care, as long as you don't do inconsistent things like share the same shares twice. But a common strategy is to sell lots in this order:

  1. Short term losses (held less than 1 year), with greatest losses first
  2. Long term losses
  3. Short term lots with no losses or gains
  4. Long term lots with no losses or gains
  5. Long term gains, least gain first
  6. Short term gains, least gain first

The objective of this strategy is to maximize tax deductions by realizing losses, and if gains must be realized, realizing them as long term capital gains as much as possible, as these are taxed at a lower rate. This is a more tax-efficient strategy than FIFO.

It's likely your broker can automatically perform this strategy for you (although you may have to ask for it), and the 1099-B and other tax documentation they send you at the end of the year will reflect this. These days any electronic tax package can automatically import all your trades from your broker so you don't have the tedium of entering all the data.

Since FIFO requires tracking all the lots anyway, and in practice computers automate all the tedium involved with a more tax-efficient cost basis method, I can't think of any reason to use FIFO.

The gritty details, if you want them, are in IRS publication 550.

  • 1
    FIFO is one way to do it. But it's not really the best way, and not what a lot of brokerages will do by default. Unless designated otherwise, the IRS requires FIFO for figuring out the correct tax basis (see FIFO in IRS Publication 550 for details). Can you provide the name of any broker who default to different manner (other than FIFO) of reporting of closed trades to the IRS? Commented Jan 14, 2021 at 20:45
  • 1
    @BobBaerker IRS says if you don't to specific identification you must do FIFO, but since to accurately report FIFO you have to track all the lots anyway, I can't think of a situation where you could do FIFO but couldn't do specific identification. And so, anyone with a modicum of tax savvy will do specific identification, especially since in the modern age a computer can automate all the tedium. As for it being a default, I thought it was at Chalres Schwab, but now that I look I can't find a reference. So it may be I just set that so long ago I forgot.
    – Phil Frost
    Commented Jan 14, 2021 at 21:37
  • You do not have to track a thing in order to accurately report FIFO. That is the default position of the IRS and therefore that is how brokers pair off trades and report them to the IRS. You only have to track positions if you choose to designate specific long lots to be sold (or short lots to be covered). Commented Jan 15, 2021 at 16:19
  • @BobBaerker OK, by "you" I meant "you (or your broker on your behalf)". My point is, to do FIFO, someone needs information about every lot. So if you're doing FIFO, and you'd rather do a more tax-efficient specific identification, you (or your broker on your behalf) must already have the necessary information. So I don't see any situation where you'd have no choice but to do FIFO, and given how easy it is to do specific identification, I don't see why anyone would do FIFO, besides ignorance or extreme laziness.
    – Phil Frost
    Commented Jan 16, 2021 at 15:26
  • I think that you've gotten lost in minor details. Every broker has the necessary information about purchases, sales, splits, wash sales, etc. If you want to do FIFO, you don't have to do a thing. Your broker pairs everything off in FIFO order and reports as such to the IRS. If you choose to designate lots for sale (or short covering), you go to wherever the broker lists the lots and cost basis and designate as desired. It's that simple. As for your ignorance or extreme laziness comment, you assume that everyone does it as you think it should be done and that conclusion is incorrect. Commented Jan 16, 2021 at 22:23

When you decide to sell a portion of your positions, there are several choices.

FIFO stands for first in, first out (you sell the shares bought first). This is the default position for the IRS. IOW, when you sell some shares, unless you specify otherwise, the Internal Revenue Service assumes that the assets that you sell first are also the one's that you bought first.

Here's an excerpt from a Zacks article that discusses this.

Warning: If you plan to use any method besides FIFO, including LIFO, you must specifically direct your broker as to which shares to sell so that your taxes end up the way you want. According to Internal Revenue Service Publication 550, the burden is on you to prove that you informed your broker of which shares you wanted sold and that your broker followed your requests. If you can't prove that, you're treated as having sold your oldest shares first.

  • 1
    This answers the scenario 1 question about what gets counted but ignores what stocks get taxed at what rates in scenario 2.
    – rhavelka
    Commented Jan 14, 2021 at 16:32
  • This is helpful, I think to @rhavelka point they will be taxed at the term of each individual purchase, but clarification/validation of that would be useful.
    – jkdba
    Commented Jan 14, 2021 at 17:20
  • The Zacks article goes on to describe what happens in scenario 2.
    – jkdba
    Commented Jan 14, 2021 at 17:25
  • You say "there are several choices" but describe only one, which isn't what most people actually use.
    – Phil Frost
    Commented Jan 14, 2021 at 19:49
  • Read what I wrote again and see if you can find the three methods described. Plan B? Read the linked Zacks article for more detailed description. Commented Jan 14, 2021 at 20:00

Not the answer you're looking for? Browse other questions tagged .