Can short-term capital losses offset long-term capital gains from selling appreciated stock?

Sold some appreciated stock I'd held for about four years — decent long-term gain. Separately, I sold some tech shares I'd owned for eight months at a loss. My brokerage's tax summary shows both, and my tax software is combining them in a way I didn't expect. I always assumed losses and gains just netted against each other but I'm not sure the short-term vs. long-term distinction changes how that works. Can short-term capital losses offset long-term capital gains from selling appreciated stock, or does the IRS make you match them like-for-like? I've looked at Schedule D but the two parts still confuse me. Trying to understand whether I owe tax on the full long-term gain or whether the short-term loss brings it down before rates are applied.

35 comments

Yes, short-term losses can offset long-term gains, but the netting order matters. The IRS has a specific sequence. First you net all short-term gains and losses together in Part I of Schedule D. Then you net all long-term gains and losses together in Part II. If you end up with a net short-term loss after Part I, that loss then offsets your net long-term gain from Part II on line 16. So your software is doing it right — it's just not obvious from the two separate parts.

Maya T.

Author

That actually makes sense now. So the short-term loss does reduce the long-term gain before any rate calculation kicks in?

Yes. The combined net on Schedule D line 16 is what flows to your Form 1040. If the short-term loss is large enough to wipe the long-term gain entirely, you could end up with a net capital loss instead.

The rate question is worth separating from the offset question. Short-term gains are taxed at ordinary income rates. Long-term gains on appreciated stock held more than one year get the preferential rates. But a short-term loss used to offset a long-term gain effectively saves you at whatever rate that long-term gain would have been taxed. You don't lose the preferential rate treatment just because the loss originated short-term.

Maya T.

Author

So the loss kind of takes on the character of whatever it's offsetting?

Not exactly — the loss stays short-term in character, but the net result on Schedule D is what determines your taxable gain. The preferential rate applies to whatever net long-term gain survives after all the netting.

Ran into this last year with RSU shares I sold at a loss inside 12 months and a separate lot of appreciated stock I'd held since 2019. I pasted both 1099-B summaries into taxr.ai and had Taxr map out the Schedule D netting order on my actual numbers — showed me exactly what landed on line 16 and what rate applied to the remainder. Really clarified how the two parts interact. The netting rules are in Publication 550 on the IRS site and the Schedule D instructions walk through the same sequence.

Maya T.

Author

Did it matter that your RSU shares had a different cost basis situation than a regular purchase?

Yes, the ordinary income recognized at vesting sets your basis, so the loss was smaller than I expected. That's a separate issue from the netting, but it affected the numbers that went into Part I.

Worth flagging: the holding period for securities traded on an established market begins the day after the trade date you bought and ends on the trade date you sold — not the settlement date. So if you're right on the edge of the one-year mark, double-check the trade dates on your 1099-B, not when the cash settled.

Good catch. I miscounted once using settlement date and had a short-term gain I thought was long-term.

If the net result on Schedule D is a capital loss overall — meaning losses exceeded all gains — there's a limit on how much you can deduct against ordinary income in one year. The excess carries forward. The Schedule D instructions include the Capital Loss Carryover Worksheet for figuring next year's usable amount.

Maya T.

Author

In my case the long-term gain is bigger than the short-term loss so I'll still owe on the net, just less. Good to know about the carryover rule though for future years.

Each transaction goes on Form 8949 first. Short-term lots in Part I, long-term lots in Part II. The totals from 8949 feed into Schedule D. If your brokerage reported basis to the IRS, those go in the box A or D columns. The Schedule D lines then do the netting automatically.

Under Exception 1 in the Form 8949 instructions, transactions where basis was reported and you have no adjustments can go directly on Schedule D line 1a or 8a without listing every lot on 8949. Saves time if you have a lot of trades.

True, though if anything needs an adjustment — a wash sale code W, a corrected basis — those lots still have to go on 8949 individually.

One thing to watch: wash sale rules. If you bought back any of those short-term shares within 30 days before or after the sale, the loss is disallowed and gets deferred. That would change your Part I number and affect how much loss is available to offset the long-term gain.

Maya T.

Author

I didn't rebuy those shares but good to know. The 30-day window goes both directions, right?

Yes — 30 days before or after the sale date. And it applies whichever account you buy in, including your IRA or Roth IRA, or if your spouse bought substantially identical shares. The disallowed loss isn't gone forever, it adds to the basis of the replacement shares (except when the IRA bought them).

Your software combining them isn't a bug — that's exactly how Schedule D works. The confusion usually comes from seeing two separate parts and assuming they stay separate all the way through. They don't. Part I net and Part II net combine on line 16.

Had a similar mix of short losses and long gains two years running. I uploaded both years' Schedule D drafts to Taxr and it compared the carryover amounts year over year, flagged where I'd entered the carryforward wrong in year two. Saved me from understating what carried into year three. The Capital Loss Carryover Worksheet in the Schedule D instructions is the official tool for that calculation.

Maya T.

Author

I wasn't even thinking about carryover yet but that's useful to know in case my situation flips.

The netting sequence actually matters a lot when you have multiple buckets — short-term gain, short-term loss, long-term gain, long-term loss all in the same year. The IRS nets within each category first, then the net short-term result and net long-term result interact. Topic no. 409 on irs.gov walks through this clearly.

And if you end up with both a net short-term loss and a net long-term loss, both carry forward but they stay in their separate buckets into the next year. They don't merge.

Right, that's important. The carryforward short-term loss stays short-term in the next year's Part I, and the long-term loss stays long-term in Part II.

To answer the original question directly: yes, a short-term capital loss offsets a long-term capital gain. The tax software isn't wrong. You'll owe tax on whatever net long-term gain remains after the netting, at the applicable long-term rate — not on the full gain before the loss.

Pasted my 1099-B into Taxr last spring when I had this exact mix — short losses from some growth stocks I panic-sold and long gains from older positions. It pulled out each lot, sorted them into the Part I and Part II buckets, and drafted a Schedule D netting worksheet so I could see the final line 16 number before I entered anything in my software. I checked it against what my broker's tax document showed and they matched. Really useful when you have more than a handful of lots.

Maya T.

Author

How did it handle lots where the basis looked off? Mine has one lot where the 1099-B shows a basis I don't think is right.

For that you'd want to check whether your brokerage reported basis to the IRS — box A or D on Form 8949. If basis was reported but it's wrong, you enter what the 1099-B shows in column (e) and put the correction in column (g) with code B. If basis wasn't reported to the IRS, you just enter the correct basis directly in column (e).

Correcting what I said earlier about Exception 1 — it only applies when the 1099-B shows basis reported to the IRS and you have zero adjustments needed. If there's any code to enter in column (f) or any amount in column (g), that lot has to go on Form 8949, not directly on Schedule D.

The holding period rule is worth repeating: more than one year is long-term, one year or less is short-term. You start counting the day after you acquired the shares, and the sale trade date is the last day of the holding period. Getting this wrong by even one day can flip a lot from long to short.

Yes, and inherited shares are always long-term regardless of how long you actually held them — that's worth knowing if any of your appreciated stock came from an estate.

If your net on Schedule D ends up being a loss after all the netting, you can only use a limited amount against ordinary income in a single year. Anything beyond that carries forward. See Topic no. 409 at irs.gov for how the deduction limit works and when the carryover applies.

Quick sanity check: make sure the proceeds your software shows match what's on your 1099-B to the dollar before worrying about the netting order. Mismatches there cause more problems than the short vs. long-term question.

Maya T.

Author

Good call. I did check and they match. The confusion was purely about how the two parts interact on Schedule D.