How does capital gains tax on sale of stock actually work?

Sold some shares this year for the first time and trying to understand how capital gains tax on sale of stock gets calculated before I file. I bought shares at different times — some I held for over a year, some for only a few months. My broker sent a 1099-B and I see proceeds and cost basis listed, but I'm not sure how the holding period changes what I owe or which forms I actually fill out. I tried reading through the IRS topic page on capital gains but got lost when it started talking about Schedule D vs. Form 8949 and which parts go where. Do I need both forms? Does every sale get listed separately? And does the holding period really make that big a difference in terms of the rate?

32 comments

Sold a bunch of shares two years back and went through exactly this confusion. Short answer: yes, you need both Schedule D and Form 8949 in most cases, and yes the holding period matters a lot. Form 8949 is where each individual sale gets listed. Short-term goes in Part I (held 1 year or less), long-term in Part II (held more than 1 year). Then those totals flow to Schedule D. I actually uploaded my 1099-B to taxr.ai and had it walk through each row, flag which sales were short vs. long-term, and list what adjustments I'd need in column (g). Saved me from missing two cost basis corrections. Worth trying if your 1099-B has a lot of rows.

Olivia L.

Author

That's really helpful context. So every single sale gets its own row on Form 8949? Even if I had like 15 small trades?

Every sale gets its own row unless you qualify for Exception 1 — if basis was reported to IRS and you have no adjustments, those can go directly on Schedule D line 1a or 8a without listing each one on Form 8949.

The holding period rule is pretty exact. You start counting the day AFTER you bought the shares. The day you sell counts as part of the holding period. For stocks on an exchange it's the trade date that matters, not the settlement date — both when you bought and when you sold. So if you bought on June 5 you start counting June 6. You need to hold more than 12 months for long-term treatment. Exactly 12 months is still short-term.

Olivia L.

Author

Wait, exactly 12 months is short-term? I assumed 12 months even was the cutoff.

Correct. The rule is MORE than 1 year for long-term. So 366 days minimum (or more in a leap year context). Publication 550 lays this out clearly.

My first year with stock sales I totally ignored the box checked at the top of Form 8949 Part I and Part II. That was a mistake. Box A means your broker reported cost basis to the IRS, Box B means they didn't report it. Box C is for no 1099-B at all. Long-term uses D, E, F the same way. The box you check changes how you handle a wrong basis — different rules apply depending on whether the IRS already has the number or not.

The box also matters if you have a wash sale code W in column (f). The disallowed loss goes as a positive number in column (g) regardless of which box you check.

Good addition. And if the broker already flagged it in box 1g of your 1099-B, you still have to report it on Form 8949 with code W — you can't just skip it because they flagged it.

Something I wish someone had told me: even if your losses are bigger than your gains, you don't get to deduct the whole loss in one year. Net capital losses you can claim against other income are capped. The cap and the married filing separately amount are in Topic no. 409 on irs.gov — look at the Limit on the deduction section. Anything over the cap carries forward to future years using a worksheet in the Schedule D instructions.

Olivia L.

Author

So the carryover isn't automatic — I have to calculate it with a worksheet each year?

You have to run the Capital Loss Carryover Worksheet each year you have a carryover. It's in the Schedule D instructions or Publication 550. TurboTax and similar software do it automatically but it's good to understand what's happening.

Went through this last year with RSUs vesting and then immediately selling some. The shares I held longer had different treatment than the ones I sold right after vesting. For the RSUs, the vesting date FMV showed up as income on my W-2 and that became my cost basis for the stock sale — so I wasn't paying gains tax on the same amount twice, just on the appreciation after vest. I had Taxr compare my 1099-B cost basis against what my W-2 showed for the RSU income and it flagged a discrepancy where the broker had a slightly different basis number. Caught that before I filed and filed with the corrected basis using code B in column (f) on Form 8949.

Olivia L.

Author

This is exactly the kind of situation I might be in. Some of my shares came through the company. How do you correct the basis on 8949 if the broker got it wrong?

If basis was reported to IRS (box A or D checked), you enter the broker's wrong number in column (e), then adjust in column (g) — a negative number in parentheses if the correct basis is higher. If not reported to IRS (box B or E), you just put the correct basis in column (e) and -0- in column (g).

Lots of good info here. One thing that's easy to mix up: Schedule D is the summary. Form 8949 is the detail. You almost always need 8949 unless every transaction qualifies for Exception 1 (basis reported, no adjustments needed). The Schedule D instructions walk through which lines the 8949 totals flow to.

Inherited stock is treated differently — it's always long-term no matter how long you personally held it. Your basis is generally the fair market value at the date of death, not what the original owner paid. That's one of those things that changes the whole calculation if it applies to you.

Olivia L.

Author

I don't have inherited shares but that's useful to know for the future.

If you got shares as a gift, the basis rules get complicated. For gains you use the donor's adjusted basis. For losses you use the lower of the donor's basis or the FMV on the date of the gift. And if the sale price falls between those two numbers there's actually no gain or loss to report. Publication 551 on the IRS site covers this.

My broker consolidated all my covered transactions with no adjustments onto a single summary page. I wasn't sure I had to list them all on 8949. Turns out those can go directly on Schedule D line 1a (short-term) or line 8a (long-term) under Exception 1 — no Form 8949 required for that group. Everything else still needed its own row on 8949.

Worth clarifying: Exception 1 only applies if basis was reported to the IRS AND there are no adjustments needed. If anything triggers an adjustment — wash sale, corrected basis, anything — that transaction has to go on Form 8949 individually.

Honestly, I was surprised how readable the Form 8949 instructions at irs.gov/instructions/i8949 are compared to most IRS docs. Worth going through once before you start. It lists every column (f) code with an explanation, which makes it a lot easier to match what your broker shows on the 1099-B.

Column (d) on Form 8949 is always the proceeds shown on your 1099-B, even if you think the number is wrong. You correct proceeds issues in column (g) with an adjustment, not by changing column (d). I made the mistake of putting what I thought I received in column (d) my first year and had to file a 1040-X.

Olivia L.

Author

Good warning. So column (d) always matches the 1099-B exactly and all corrections go in column (g)?

For proceeds, yes. The instructions say to enter the proceeds shown on the 1099-B or 1099-DA in column (d) and use column (g) for adjustments. Keep column (d) clean.

Sold shares in a down market two years ago and triggered some wash sales accidentally. Sold at a loss, bought the same stock back less than 30 days later. The loss got disallowed and added to the basis of the new shares instead. The wash sale window is 30 days before AND 30 days after the sale — people forget about the 30 days before part.

Also applies if your spouse buys substantially identical stock in that window, or a corporation you control. Not just purchases in your own account.

If you have a large gain and you're not sure about your overall tax situation — especially if you exercised stock options, have AMT exposure, or have capital loss carryovers from prior years — it might be worth having a CPA or enrolled agent run the numbers before you file. The interaction between capital gains, the AMT, and loss carryovers can produce surprises.

Publication 550 and Topic no. 409 at irs.gov are the two IRS sources I keep going back to for capital gains questions. 409 is shorter and good for the basics. 550 goes deeper on wash sales, holding period edge cases, and basis adjustments.

Olivia L.

Author

Bookmarking both. This whole thread has been really useful — I feel like I actually understand what I'm doing now instead of just guessing at boxes.

If you held any crypto and sold it this year, that's handled differently on 2025 Form 8949. Digital asset transactions use boxes G, H, I for short-term and J, K, L for long-term — not boxes A through F. The IRS digital assets page at irs.gov/businesses/small-businesses-self-employed/digital-assets has the current guidance.

And you'd receive a 1099-DA for crypto from brokers that are now required to report, not a 1099-B. The box structure on 8949 matches which form you got.