How to reduce or defer large short-term capital gains tax from stock sales

Sold a bunch of tech positions this year that I'd held less than 12 months, so everything lands as short-term. My 1099-B from the broker shows substantial gains and when I ran the numbers through my tax software it basically added the full amount as ordinary income. I already maxed my 401k contributions through work. I looked at whether any of my other holdings are sitting at a loss I could sell to offset, but most are up. I don't have a home sale or anything like that in play. My question is: what are the actual levers people use to reduce or defer large short-term capital gains tax from stock sales legally, before I just hand the full amount over? Filing single, no business entity.

34 comments

Tax-loss harvesting is the most direct move. Go through every taxable brokerage account and find positions currently at a loss. Selling them realizes the loss, which offsets your short-term gains dollar for dollar on Schedule D before the net flows to your return. Watch the wash sale rule though: if you buy the same or substantially identical security within 30 days before or after the sale, the loss is disallowed and gets added to the new shares' cost basis instead. You'd have to wait 31 days or buy something similar but not identical.

Sofia W.

Author

How strict is 'substantially identical'? Like if I sell an S&P 500 ETF at a loss and immediately buy a different S&P 500 ETF from another fund family, does that trigger it?

Had nearly the same situation last year, and the harvesting part was where I almost tripped up. I uploaded my 1099-B and a summary of my open positions to taxr.ai and asked it to walk through which lots were candidates for harvesting and what the wash sale exposure looked like on each one. It flagged two positions where I'd already bought more shares the week before — I would have missed that completely. As for the ETF question above: the IRS hasn't published a bright-line list, but two funds tracking the same index are higher risk than two tracking different indexes. Different fund family, same index = a different CUSIP, so your broker won't flag it in box 1g (that only happens with the same CUSIP bought in the same account), but if the funds are substantially identical the loss is still disallowed.

Sofia W.

Author

That CUSIP point is really useful. My broker actually shows the CUSIP on the lot detail screen, so I can see whether a buy would get flagged in box 1g, though a different CUSIP doesn't make it safe if the funds are substantially identical.

One thing people skip: deferred compensation plans through an employer, if you have access to one before the year closes. A 457(b) or a nonqualified deferred comp plan can move earned income out of the current year, which doesn't reduce the capital gain itself but lowers your overall taxable income, which can matter at the margin if you're near a bracket boundary. Doesn't apply here since you said you're filing single with no business entity, but worth knowing for future years if your employer offers it.

Are you in a year where you have capital loss carryforwards from prior years? If you had net losses in 2022 or 2023 that exceeded the deductible limit, those carry forward and absorb current-year gains first on Schedule D. Worth pulling last year's return and checking line 6 and the carryover worksheet.

Sofia W.

Author

I do have a small carryforward from 2022 actually. So that gets applied automatically on Schedule D before anything else?

Yes, it flows in through the Schedule D instructions — there's a Capital Loss Carryover Worksheet that figures the usable amount. Your software should pull it from last year's file if you're continuing in the same program.

Charitable giving is worth looking at if the numbers are big enough. Donating appreciated long-term shares directly to a charity (or a donor-advised fund) lets you avoid recognizing the gain entirely on those shares and potentially take a charitable deduction. Doesn't help with gains you already realized, but if you have other long-term appreciated positions you were planning to sell and donate the cash anyway, donate the shares instead and sell different shares or just hold.

Does this work with crypto too? I have some long-term bitcoin that's way up and I've been wanting to give to charity anyway.

Qualified Opportunity Zone funds are the big deferral vehicle people don't talk about enough. You invest the gain amount into a QOZ fund within 180 days of the sale and the tax on that gain gets deferred. The rules are specific — the investment has to go into a qualifying fund, and the deferral period has limits — so check the IRS digital assets and opportunity zone pages for current rules, they've changed over the years. I ran my gain numbers and QOZ eligibility timeline through Taxr before my appointment with a CPA; it organized the dates and amounts into a worksheet so the CPA could focus on whether the specific fund qualified rather than recalculating everything from scratch.

Sofia W.

Author

I hadn't thought about QOZ at all. Is 180 days from the trade date or the settlement date?

Generally measured from the date of sale. For securities the trade date is the sale date for tax purposes — Publication 550 covers holding periods starting from trade date, and the QOZ rules follow the recognition date. Your CPA should confirm for your specific situation.

Retirement account contributions beyond your 401k: if you have self-employment income at all (even a side project), a SEP-IRA or solo 401k can shelter a significant amount. But you said no business entity and you're an employee, so this probably doesn't apply unless you have any freelance income showing up on a 1099-NEC.

Worth separating what's doable before December 31 versus what's just planning for next time. Before year-end: loss harvesting, QOZ fund investment, charitable appreciated-share donations, maxing HSA if you have a qualifying health plan. After year-end but before filing: IRA contribution (traditional, if you're eligible to deduct it). After filing: nothing that changes the current year. The short-term gains are taxed as ordinary income so the bracket math is straightforward — there's no preferential rate to plan around, which is why deferral or offset are the only real tools.

This is the clearest breakdown of timing I've seen in this thread. HSA is easy to forget too.

If the gains were from employee stock — RSUs that vested and you sold immediately — the income side is already on your W-2 as ordinary income, and the 1099-B gain is usually small or zero because your cost basis is the FMV at vest. But if you held after vest and then sold, the gain from vest price to sale price is what shows on the 1099-B as short-term. Just flagging this because a lot of people double-count RSU income without realizing it.

Sofia W.

Author

Mine were outright stock purchases, not RSUs, so the full gain is in the 1099-B with my actual purchase price as basis.

Something I wish someone had told me when I had a big short-term gain year: estimated tax payments. If you sell mid-year and don't adjust your withholding or make an estimated payment, you can owe underpayment penalties on top of the tax itself. The penalty calculation is on Form 2210 — worth checking whether you need to make a Q3 or Q4 estimated payment before year-end if this is a current-year situation.

Sofia W.

Author

Genuinely hadn't thought about this. So even if I figure out ways to reduce the gain, I might still owe underpayment penalties on what I already should have paid in earlier quarters?

Exactly. Form 2210 looks at whether you paid enough in each quarter, not just whether the annual total adds up. Safe harbor rules apply too — the instructions for Form 2210 explain the thresholds, and they depend on your prior year tax situation.

Uploaded my brokerage year-end summary to Taxr after a year with large short-term gains and asked it to map out which offsets I could still apply before December 31. It went through the 1099-B line by line, identified the lots with the most loss potential, and drafted a summary showing the net Schedule D position under three different harvesting scenarios. Saved me a lot of spreadsheet work before I took it to my enrolled agent to decide which trades to actually execute.

Sofia W.

Author

Did it handle the wash sale analysis on the existing positions, or did you have to track that manually?

It flagged the positions where I'd bought shares in the prior 30 days and noted which ones would be watch-listed — I still verified against my actual transaction history, but it caught two that I would have missed.

Installment sales are another deferral method but only apply if you're selling an asset directly to a buyer over time — doesn't apply to publicly traded stock sold through a broker. Just want to head off that one before it comes up.

Coming back to the wash sale thing from earlier: the disallowance also applies if your spouse buys substantially identical stock, or a corporation you control buys it. If you have a spouse who also trades in a brokerage account, their purchases count too. People forget this.

And it applies to purchases inside an IRA or Roth IRA, which is the trap most brokers won't flag in box 1g because the accounts are separate. The loss is permanently lost in that case, not just deferred — it doesn't get added to the IRA's cost basis.

How much of the gain is from a single large sale versus a bunch of smaller ones? The answer matters for QOZ eligibility because the 180-day window runs from each individual sale, not from the end of the year. If you have multiple sale dates you might still have time on the later ones even if the earlier ones have passed.

Sofia W.

Author

Several different trades spread over about four months. So the 180-day clock runs separately from each trade date — that's really useful to know.

Traditional IRA deductibility is worth checking even at this stage. If your income and workplace plan coverage affect deductibility, you might get a partial or full deduction on a traditional IRA contribution, which reduces adjusted gross income. The phase-out ranges depend on filing status and whether you're covered by a workplace plan. Publication 590-A points to the right figures, and your software should calculate it automatically.

Going back to the crypto donation question I asked earlier — looked it up and yes, donating appreciated crypto directly to a qualifying charity works similarly to stock in that you can deduct the fair market value and avoid recognizing the gain, provided you've held it more than a year. The IRS digital assets page at irs.gov/businesses/small-businesses-self-employed/digital-assets covers the charitable contribution treatment. For short-term held crypto there's less benefit since your deduction would be limited to cost basis anyway.

Right, the more-than-one-year holding period is what makes the donated-shares strategy valuable. Short-term appreciated property deduction is capped at basis, which eliminates the gain-avoidance benefit.

To summarize the actual levers from this thread since there are a lot of them now: (1) tax-loss harvesting in taxable accounts, (2) capital loss carryforwards from prior years, (3) QOZ fund investment within 180 days, (4) donating long-term appreciated assets instead of cash, (5) traditional IRA deduction if eligible, (6) HSA contribution if on a qualifying health plan. None of these change the character of the gain from short-term to long-term — that's locked in by the holding period — but they reduce or defer the net taxable amount. And check Form 2210 on estimated payments regardless.

Sofia W.

Author

Having every lever in one numbered list makes this a lot easier to act on. I'm going to work through each one with my tax software and probably take the QOZ question to a CPA since that one has moving parts I don't want to get wrong.