Tool · Investor Sam Windfall

Use Tax-Loss Harvesting to Offset a Windfall Gain

July 1, 2026 • By the Investor Sam Editorial Team • Reviewed by Berly Sam Varghese, Editor
If you sell investments at a loss and realize a capital gain from a windfall in the same tax year, the loss directly offsets the gain — dollar for dollar. Most investors do not time this intentionally. This tool shows exactly how much tax a deliberately harvested loss can save, plus any carryforward to future years — turning a paper loss into a real-money win.

Example: Capital gain from windfall (e.g., home sale above exclusion, RSU sale): 75000 $ · Portfolio losses you can harvest this year: 30000 $ · Ordinary income available to offset (up to $3,000/yr after gains): 3000 $ · Long-term capital gains rate: 15 % · Marginal ordinary income tax rate: 24 %

Tax savings from harvesting$4,500
Tax without harvesting$11,250
Tax after harvesting$6,750
Loss carryforward to future years$0

Worked example

A $75,000 capital gain from selling RSUs; you harvest $30,000 in losses from an underperforming position. Net gain: $45,000. Tax without harvesting: $75,000 × 15% = $11,250. Tax after harvesting: $45,000 × 15% = $6,750. Tax savings: $4,500 — using losses you were already sitting on. If losses exceeded the gain, the first $3,000 of excess could offset ordinary income, and the rest carries forward indefinitely.

Frequently asked questions

What is the wash-sale rule?

If you sell an investment at a loss and buy the same or a 'substantially identical' security within 30 days before or after the sale, the IRS disallows the loss for tax purposes. You can avoid this by waiting 31 days or buying a similar-but-not-identical fund (e.g., swapping a Vanguard S&P 500 fund for a Fidelity S&P 500 fund).

Can I harvest losses in a tax-advantaged account?

No — losses inside a traditional or Roth IRA or 401(k) are not deductible. Tax-loss harvesting only works in taxable brokerage accounts, where realized gains and losses flow to your Schedule D.

How long does a loss carryforward last?

Capital loss carryforwards are indefinite — they carry forward every year until fully used, even across decades. They offset capital gains first, then up to $3,000 of ordinary income per year. When you die, carryforwards are extinguished and cannot be passed to heirs.

Does tax-loss harvesting change my long-term returns?

Harvesting defers taxes (by lowering your basis in the replacement investment), not eliminates them. The new position eventually sells at a higher gain. The benefit is the time value of money — paying tax later rather than now — and the ordinary-income-offset on any $3,000 excess. For long horizons, the deferral benefit compounds meaningfully.

💎
InvestorSam.com
Stock analysis, market insights & portfolio research — free
Ready to put these numbers to work?
Get stock picks, earnings analysis, and market commentary from Investor Sam.
Visit InvestorSam.com →

Sources

Berly Sam Varghese · Editor, Investor Sam

Berly Sam Varghese is an engineer who treats money the way he treats any hard problem — something to be engineered, not gambled on. He funded years of education and built real financial stability the patient way, by living below his means and investing rather than borrowing. He writes for the person trying not to waste a rare opportunity. He reviews and approves every article on Investor Sam and checks the figures against primary sources before anything is published. More about our standards.