How do you calculate capital gains on shares bought at different prices?

Trying to figure out capital gains on shares bought at different prices and I'm completely turned around. I bought shares of the same stock across four separate purchases over about two years — different prices each time, different lot sizes. Sold a chunk of them last month. My broker's 1099-B shows one proceeds number and one cost basis number, but I have no idea how they calculated that basis or which shares they used. I always assumed it would be FIFO but I never actually set a cost basis method with them. The 1099-B has box 1e filled in and box 12 is checked, so it looks like basis was reported to the IRS. How do I know which shares were sold and whether the gain is short-term or long-term? Do I just trust the 1099-B number or do I need to verify lot by lot?

30 comments

Which broker is this? Most default to FIFO (first in, first out) if you never changed it, meaning they sold your oldest shares first. That matters a lot for holding period — if your first purchase was more than a year before the sale date, those shares are long-term. Did your broker send any supplemental detail showing each lot they used?

Victor K.

Author

It's a mid-size online broker. They did include a supplemental page but it's separate from the 1099-B itself. It lists three lots with different acquisition dates and prices. I just wasn't sure if I had to use that detail on my own return or if I could just use the totals.

I dealt with this same multi-lot mess last year. I uploaded my broker's supplemental statement to taxr.ai and it broke down each lot by acquisition date, proceeds, basis, and whether the holding period was short or long. That was way more useful than staring at the totals line. Worth doing before you fill in Form 8949 — the per-lot detail is what actually goes on the form, not the blended number.

Victor K.

Author

Did it flag anything off about the basis numbers or just organize what the broker already showed?

Are all four lots covered securities? If box 12 is checked on the 1099-B it means basis was reported to the IRS, which makes them covered. That matters for which box you check on Form 8949 — Part I box A for short-term covered, Part II box D for long-term covered.

Victor K.

Author

The 1099-B header says covered securities, yes. So the supplemental lot detail should match what gets reported to the IRS?

Each lot goes on its own row in Form 8949. Column (b) is the acquisition date of that specific lot, column (c) is the date of sale, column (d) is the proceeds allocated to that lot, column (e) is that lot's cost basis. The IRS instructions for Form 8949 at irs.gov/instructions/i8949 walk through every column. You can't just enter the blended total — the per-lot breakdown is required.

This is right. And the holding period is determined lot by lot, not blended. A lot bought 14 months ago is long-term, a lot bought 8 months ago is short-term, even if sold on the same day. They go in different parts of Form 8949.

Can I ask — did you pick which lots to sell, or did the broker just choose? Because if you had the option to tell them which lots to sell before the trade settled, you might be able to get a more favorable result. After settlement it's too late to change, but it's worth knowing for next time.

Victor K.

Author

I didn't specify anything before selling, so I guess they defaulted. Sounds like FIFO means my oldest lots went first which is probably fine since those are the long-term ones.

The broker's supplemental statement is not filed with the IRS but it should reconcile exactly to what's on the 1099-B totals. If the per-lot proceeds and basis don't add up to what's in box 1d and 1e on the 1099-B, something is off and you'd want to call the broker before filing.

What if the broker's basis is wrong for one of the lots? Like if you got shares through a dividend reinvestment or a corporate action and the broker didn't record that correctly?

Victor K.

Author

No reinvestment, all straightforward cash purchases. But good to know that could cause a mismatch — I'll double-check each lot's purchase price against my own records.

Had a similar pile-up of lots after adding to a position over time. I ran my 1099-B and the broker's lot detail through Taxr and it flagged that one lot straddled the one-year mark depending on whether you count trade date or settlement date. Turns out for securities traded on an exchange the holding period runs from the day after the trade date you bought to the trade date you sold — settlement date doesn't count. That detail changed which part of Form 8949 that lot landed in.

That's a real edge case that catches people. Trade date, not settlement date, is the rule for listed securities. Publication 550 has the holding period rules spelled out.

So once you have each lot assigned to short-term or long-term, the short-term ones go in Part I of Form 8949, long-term in Part II. Each part flows to Schedule D — Part I to line 1b (covered, no adjustments) or line 1a if you use Exception 1, and Part II to line 8b or 8a. Schedule D then carries the net to Form 1040.

Minor note — Exception 1 on Form 8949 lets you skip the form for covered transactions with no adjustments and put those totals directly on Schedule D line 1a (short-term) or 8a (long-term). Still need Form 8949 for any lot with an adjustment.

Are any of your lots close to triggering a wash sale? If you sold at a loss on any lot and bought the same stock within 30 days before or after, the loss gets disallowed and you'd need a code W in column (f) and the disallowed amount as a positive number in column (g) of Form 8949. Box 1g on the 1099-B shows the disallowed wash sale amount for covered securities.

Victor K.

Author

No losses on any lot, all gains, so I don't think the wash sale rules apply here. But I'll keep that in mind if I ever harvest losses.

Before I filed last year with multiple lots from different purchase dates I uploaded everything to Taxr — my 1099-B, the broker supplemental, and my own purchase records. It compared all three, matched each lot's basis and acquisition date, and drafted a completed Form 8949 with each lot on its own row. Made it easy to spot that one lot had the wrong acquisition date on the broker's statement.

Victor K.

Author

That's the kind of line-by-line check I need. I'll try that before I finalize anything.

Does your broker's supplemental statement show the per-lot proceeds as well as the per-lot basis? Some brokers only show basis per lot and prorate proceeds by number of shares. Either way you need actual proceeds per lot in column (d) of Form 8949, not an estimate.

Victor K.

Author

Mine shows proceeds per lot, so I should be fine. Each row on the supplement has acquisition date, sale date, proceeds, basis, and gain.

Worth checking whether the gain on each lot is ordinary income or capital gain. RSUs and options can produce income at vesting or exercise that gets taxed as wages, not as capital gain, and the basis can look off on the 1099-B if the broker didn't add the income inclusion properly. If you bought these as plain market purchases that's not an issue, but it trips people up.

The IRS topic page on capital gains and losses — Topic 409 at irs.gov/taxtopics/tc409 — also covers the capital loss limit if any lot does end up with a loss. Net losses above the annual cap carry forward, figured with the Schedule D instructions. Good to have that bookmarked even if all your lots are gains right now.

Good link. And if losses ever exceed gains in a future year the carryover worksheet in the Schedule D instructions keeps track of what carries to the next year.

Can you tell from the 1099-B whether the broker split your sale across lots or treated it as one block? Some 1099-Bs show one line per lot, some consolidate. If yours is consolidated you definitely need the supplement to do the per-lot Form 8949 entries.

Victor K.

Author

Mine is consolidated on the 1099-B — just one line for the total sale. The lot detail is entirely on the supplement. So yes, I need to use the supplement to fill in Form 8949 properly.

One place people go wrong: they enter the 1099-B total on a single Form 8949 row and mix short-term and long-term proceeds together. That's not correct. The IRS expects each lot on its own row in the right part based on its own holding period, even if the broker's 1099-B shows a combined number.

Exactly right. And if you have both short-term and long-term lots from the same sale, you need rows in both Part I and Part II of Form 8949. Can't blend them into one part just because they were sold on the same day.