Where is capital gains tax calculated on 1040?

Filed my own return this year for the first time with actual stock sales — sold some index fund shares I'd held for a few years and also dumped some shares I'd bought last spring at a loss. My broker sent a 1099-B and I entered everything into the software, but I honestly don't know where capital gains tax calculated on 1040 actually shows up. The software just kind of... did it. I want to understand what lines matter, what feeds into what, and whether the number on my final return is actually right. I checked the IRS website but got lost between Schedule D and Form 8949 and couldn't figure out how they connect to the 1040 itself.

37 comments

The chain goes like this: every individual sale goes on Form 8949 first. Short-term sales in Part I, long-term in Part II. The totals from 8949 flow to Schedule D — short-term to Part I, long-term to Part II. Schedule D then nets everything and the resulting gain or loss lands on Form 1040: a net gain on Schedule D line 16 (or a net loss, limited on line 21) feeds to line 7a of the actual 1040 (combined capital gain or loss). The tax on that gain is then figured either on the Schedule D Tax Worksheet or the Qualified Dividends and Capital Gain Tax Worksheet, depending on your situation — your software picks which one applies. I dropped my 1099-B, Schedule D and 8949 into taxr.ai and it traced every number from the sale entry through to 1040 line 7a, flagged one lot where the basis looked off. Saved me from a headache.

Marcus G.

Author

So the number I see on 1040 line 7a is the net gain or loss, not the tax itself? Where does the actual tax amount appear?

Right, line 7a is the net. The actual tax computed on that gain appears on 1040 line 16 (tax), built up through that worksheet I mentioned. You won't see a separate line that says "capital gains tax" — it's baked into line 16.

Spent an embarrassing amount of time staring at my return wondering the same thing. The disconnect is that the 1040 itself doesn't label anything "capital gains tax" explicitly. Schedule D line 16 (or line 21 for a net loss) is what transfers over. If your net is a gain, it goes into the tax computation worksheets. If it's a net loss, the amount you can use against other income is limited — Publication 550 and Topic 409 on irs.gov both spell out that limit without you having to guess.

Marcus G.

Author

Did your software generate all those worksheets automatically or did you have to trigger something?

Fully automatic in mine. The worksheets don't even print unless you specifically ask for them, which is why it looks invisible. Worth printing or exporting the full return PDF so you can actually see Schedule D and 8949 attached.

Worth knowing that the path through Form 8949 is not optional just because your broker reported everything. If your broker checked the box saying basis was reported to the IRS, those covered transactions can go directly to Schedule D line 1a (short-term) or 8a (long-term) under Exception 1 — skipping 8949 — but only if there are zero adjustments. Any wash sale code, any basis correction, any other adjustment and that lot must go on 8949.

Does that mean if you have even one wash sale you have to do 8949 for the whole account or just that one lot?

Just the lots that need adjustment. You can use the Exception 1 shortcut for the clean ones and put only the adjusted lots on 8949. Each lot with a "W" code needs its own 8949 row, with the disallowed loss shown as a positive number in column (g).

My situation last year had both short and long-term lots plus a wash sale my broker flagged in box 1g of the 1099-B. I was confused about how that box 1g amount connected to what I actually entered. Had Taxr read through my 1099-B and my draft 8949 side by side — it listed every lot, matched the box 1g figure to the right row, and showed me exactly which column (g) entry I'd gotten wrong. Helped me see the whole structure before I filed.

Marcus G.

Author

Was the wash sale from buying back in the same account within 30 days?

Yes, sold at a loss and bought the same fund back nine days later in the same account. The 1099-B flagged it because it was the same CUSIP, same account. The disallowed loss gets added to the cost basis of the new shares — so it's not gone, it just moves.

The holding period matters a lot for where things land and what rate applies. For securities on an established market, the holding period starts the day after the trade date you bought and ends on the trade date you sold — not settlement date. More than one year is long-term, one year or less is short-term. Getting that wrong shifts a sale between Part I and Part II of 8949.

Marcus G.

Author

What if you inherited shares? Does the one-year rule still apply?

Inherited shares are treated as long-term regardless of how long you actually held them — the rule is in Publication 550. That's one situation where the holding period clock works differently from everything else.

My broker's 1099-B had one lot where the cost basis was clearly wrong — showed $0 because it was an older lot transferred in. I had records of what I paid. The instructions for Form 8949 say when basis isn't reported to the IRS you check box B or E, enter your correct basis in column (e), and put -0- in column (g). Don't try to put the correction in column (g) the way you would for a covered security — that's a different path.

So for uncovered lots the correction goes in column (e) directly, not as an adjustment?

Exactly. Column (e) gets your real basis. Column (g) gets -0-. The Form 8949 instructions lay this out clearly under the box B/E rules.

The Schedule D Tax Worksheet is what most people with long-term gains go through, and it applies preferential rates to qualified gains rather than ordinary rates. Your software handles which worksheet to use, but if you're checking the math by hand, that worksheet is in the Schedule D instructions. The rate that applies depends on your taxable income — the instructions tell you the thresholds.

I had a year with a net capital loss and was surprised the full loss didn't wipe out my other income. The cap on how much of a net loss reduces other income is spelled out in Topic 409 at irs.gov — whatever doesn't get used carries forward to the next year. The carryover worksheet is in Publication 550 or the Schedule D instructions and tells you exactly how much to bring forward.

Marcus G.

Author

Does the carryover keep its character — like does a long-term loss carry forward as long-term?

Yes, character is preserved. Long-term carryover stays long-term on next year's Schedule D, short-term stays short-term. It doesn't blend together when it carries.

RSUs add their own wrinkle — the shares vest, their fair market value at vesting is ordinary income reported on your W-2, and your basis in those shares for Schedule D purposes is that same FMV. So when you eventually sell, your gain or loss on 8949 is measured from vesting value, not zero. Getting that basis right is what determines whether you owe more on Schedule D or not.

Marcus G.

Author

What if the broker's 1099-B shows $0 basis for the RSU shares?

Very common. The broker often doesn't have the vesting price. If the 1099-B says basis was reported to the IRS, you'd check box D (long-term) or A (short-term), enter the $0 basis shown in column (e), put code B in column (f), and enter the correct basis from your W-2 or equity statement as a negative adjustment in column (g). Only if basis wasn't reported do you use box E or B with the correct basis in (e) and -0- in (g). Keep your vesting statement with your records.

Pulled up my prior-year return while reading this. The Schedule D itself is two pages — Part I nets your short-term transactions, Part II nets long-term, and Part III on the second page combines them and is where the final number comes from before it moves to 1040 line 7a. If you only have the first page of Schedule D you're missing where the math closes.

The part that tripped me up was crypto. My exchange sent transaction history but no 1099-B. For 2025 returns digital asset transactions go on the new boxes in Form 8949 — G through I for short-term, J through L for long-term — not boxes C or F. The IRS digital assets page has the current guidance. Everything still flows to Schedule D the same way after that.

Is the 1099-DA actually being sent out for 2025?

Some brokers and exchanges are sending them, some aren't yet. Even without one you're still required to report each transaction. The IRS digital assets page at irs.gov covers what's required regardless of whether you get a form.

Practical check: once you have your return, look at Schedule D line 16 (net gain or loss) and, for a loss, line 21 (the limited loss carried to 1040). Then find line 7a on the actual 1040 — it should match line 16 for a gain or line 21 for a loss. If it doesn't, something in the software mis-linked and it's worth going back through 8949 totals.

Marcus G.

Author

Mine actually do match, which is reassuring. I just couldn't see where the tax rate was applied.

Print the Qualified Dividends and Capital Gain Tax Worksheet or Schedule D Tax Worksheet from the full PDF — whichever your software used. That's where you'll see the rate actually applied to the gain amount.

Publication 550 and the Form 8949 instructions are honestly the two documents worth bookmarking if you have investment sales every year. The 8949 instructions walk through every column, every code, every box-checking scenario. The IRS pages for both are at irs.gov — About Form 8949 and the instructions are separate pages and both are useful.

If your situation involves a large number of transactions, a loss carryforward from prior years, wash sales across multiple accounts, and RSUs all in the same year — that's genuinely the point where paying a CPA or enrolled agent to review makes sense. Each piece is manageable alone but the interaction between them (especially carryforward character and wash sale basis adjustments) is where errors compound.

Marcus G.

Author

Mine was simpler than that thankfully — just two lots, one long-term gain, one short-term loss. But good to know where the complexity line is.

The About Form 8949 page on irs.gov links to the instructions and the form itself. The instructions have a column (f) code table that lists every situation — W for wash sale, B for incorrect basis, H for home sale exclusion, and others. Reading that table once makes the whole form much less mysterious.

Printed the full PDF from my software and found both the Schedule D and the Qualified Dividends and Capital Gain Tax Worksheet attached. Could finally see where the preferential rate got applied to my long-term gain. The chain from 8949 to Schedule D to the worksheet to 1040 line 16 is all there — I just hadn't been printing the full return before. Thanks everyone.