How does tax-loss harvesting work, and what is the wash-sale rule?

Person walking beside a large downward-trending stock chart with a red arrow, while a blue arrow curves toward a glowing shield and a financial document, symbolizing security amid risk.

How Does Tax-Loss Harvesting Work, and What Is the Wash-Sale Rule?

Last reviewed: July 2026

Tax-loss harvesting is the practice of selling an investment at a loss to offset capital gains and reduce your tax bill. You use realized losses to cancel out realized gains dollar for dollar, and if your losses exceed your gains, you can deduct up to $3,000 against ordinary income each year. The wash-sale rule is the catch: if you buy back the same or a "substantially identical" security within 30 days before or after the sale, the IRS disallows the loss. Done right, tax-loss harvesting turns a down market into a tax asset. Done carelessly, it triggers a rule that erases the benefit you were chasing.

Key Takeaways

  • Tax-loss harvesting uses realized investment losses to offset realized capital gains, lowering your taxable income for the year.
  • Excess losses can offset up to $3,000 of ordinary income annually, with the remainder carried forward indefinitely.
  • The wash-sale rule disallows a loss if you rebuy the same or a substantially identical security within 30 days before or after the sale.
  • Harvesting works only in taxable brokerage accounts, never inside an IRA or 401(k).

About the Author: Jeff Judge, CFP®, AEP®, ChFC®, CLU® is Managing Partner of Chesapeake Financial Planners in Forest Hill, Maryland. He has been helping families and business owners in Harford County and the Baltimore metro area navigate tax-aware investing since earning his CFP® certification in 2013, by using Chesapeake Financial Planners’ signature process, the R.U.D.D.E.R. method™. Jeff often reminds clients that the goal of harvesting is never the loss itself; it's keeping your money invested while quietly building a tax asset for years you'll actually need it.

What Is Tax-Loss Harvesting and How Does It Work?

Tax-loss harvesting is selling a security that has dropped below your purchase price to "realize" the loss, then using that loss to offset gains elsewhere in your portfolio. The mechanics are simple. Say you sold one fund for a $10,000 gain earlier in the year. If another holding is down $10,000, selling it cancels the gain, and you owe nothing on that trade.

The order of operations matters. The IRS first nets short-term losses against short-term gains, and long-term losses against long-term gains. Short-term gains are taxed at your ordinary income rate, which can run as high as 37% in 2026, while long-term gains top out at 20%. Because short-term gains are taxed harder, a loss applied against them saves you more.

After gains and losses are netted within each category, any leftover loss crosses over to offset the other type. Whatever survives can then reduce your ordinary income. Jeff has watched clients treat harvesting as a year-end scramble in December. The better players harvest opportunistically all year, whenever a position dips, because losses don't expire and the chance to capture them does.

The strategy only works in taxable brokerage accounts. Losses inside a traditional IRA, Roth IRA, or 401(k) have no tax effect because those accounts are already tax-sheltered. This is one of the most common misunderstandings I see when someone first hears the term. If you want to learn how account type changes the math, our How Should I Place Investments Across Taxable and Retirement Accounts? piece covers where each holding belongs.

What Is the Wash-Sale Rule and Why Does It Matter?

The wash-sale rule, defined in IRS Publication 550, disallows a loss deduction if you buy the same or a substantially identical security within 30 days before or after the sale that created the loss. That's a 61-day window total: 30 days before, the sale date, and 30 days after. Trip the rule, and the IRS adds the disallowed loss to the cost basis of the replacement shares instead of letting you claim it now.

Here's why people stumble. They sell a fund to harvest the loss, then panic about being out of the market and rebuy it a week later. The loss vanishes. The rule also applies across accounts you control, including your IRA and, per IRS guidance, accounts held by your spouse. Selling in your taxable account and rebuying the identical fund in your spouse's IRA still triggers it.

"Substantially identical" is the phrase that does the heavy lifting, and the IRS has never published a bright-line definition. Two S&P 500 index funds from the same provider are almost certainly substantially identical. A total-market fund and an S&P 500 fund from different providers usually are not, though the IRS reserves the right to disagree. The common workaround is to sell one fund and immediately buy a similar-but-not-identical fund tracking a different index. You keep market exposure, you bank the loss, and you can switch back after 31 days if you want. Jeff Judge notes: "The safest way to stay in the market while you wait out the 31-day window is to swap into a fund tracking a different index entirely, because two S&P 500 funds from the same provider are about as identical as it gets in the IRS's eyes."

According to FINRA, investors who ignore the wash-sale rule often discover the disallowed loss only at tax time, when their broker's 1099-B flags it. By then the year is over and the fix is gone.

What Are the Limits and Carryforward Rules?

There is no cap on how much loss you can use to offset capital gains. If you have $200,000 in gains and $200,000 in losses, you can offset all of it. The only limit kicks in after gains are fully offset: you can deduct up to $3,000 of net capital loss against ordinary income per year ($1,500 if married filing separately).

Anything beyond that doesn't disappear. It carries forward indefinitely. A $50,000 net loss this year can shelter gains in future years and chip away at ordinary income at $3,000 annually until it's used up. Jeff treats large carryforwards as a stored tax asset, something a client can deploy in a future year when they sell a business, a rental property, or a concentrated stock position.

One nuance worth flagging: harvesting resets your cost basis lower on the replacement shares. You're often deferring tax rather than eliminating it, because a lower basis means a larger gain when you eventually sell. The benefit is real when you harvest losses at a high rate today and realize the deferred gain at a lower rate later, or never, thanks to the step-up in basis at death. For a closer look at timing, see How Can I Reduce Capital Gains Taxes on My Investments?.

When Does Tax-Loss Harvesting Actually Help?

Harvesting pays off most when three things line up: you hold taxable accounts, you have realized or expected gains to offset, and you expect your future tax rate to be the same or lower than today's. If you're in a low bracket now and expect to be in a higher one later, deferring gains through harvesting can backfire.

Market downturns are the obvious harvest season, but Jeff watches for personal triggers too: a high-income year, a portfolio rebalance that throws off gains, or a concentrated position you're trying to unwind. The discipline that separates good harvesting from busy trading is staying invested the whole time. You're not trying to time the market. You're swapping into a near-equivalent holding so your money keeps working while the loss does its job. If a high income year is the trigger, How can I potentially optimize my taxes as my income grows? is worth reading alongside this.

A quick comparison of where harvesting helps and where it doesn't:

SituationHarvesting Useful?Why
Taxable brokerage account with gains to offsetYesLosses directly cancel taxable gains
Traditional or Roth IRA / 401(k)NoAccount is already tax-sheltered
Low current bracket, higher expected future bracketOften noDefers gains into a higher-tax year
Large pending sale (business, property) next yearYesCarryforward losses offset the future gain

Frequently Asked Questions

What is tax-loss harvesting in simple terms?

Tax-loss harvesting is selling an investment that has lost value to capture the loss for tax purposes. You use that realized loss to offset capital gains from other investments, lowering your tax bill. If losses exceed gains, you can deduct up to $3,000 against ordinary income each year.

How much can tax-loss harvesting save me?

The savings depend on your tax bracket and how much gain you offset. Offsetting a $10,000 short-term gain taxed at 32% saves you $3,200. Offsetting long-term gains saves at the 15% or 20% rate. The $3,000 ordinary-income deduction saves you your marginal rate times $3,000 each year.

Does the wash-sale rule apply to all accounts?

Yes, the wash-sale rule applies across all accounts you control, including your IRA, your taxable accounts, and accounts held by your spouse. Selling at a loss in one account and rebuying the identical security in another within 30 days still disallows the loss. The IRS treats these as one economic unit.

Can I tax-loss harvest in my IRA or 401(k)?

No, tax-loss harvesting has no benefit inside an IRA or 401(k) because those accounts grow tax-deferred or tax-free already. There are no taxable capital gains to offset inside them. Harvesting only works in taxable brokerage accounts where gains and losses have real tax consequences.

What counts as a "substantially identical" security?

The IRS has never defined the term precisely, which is why it causes confusion. Two index funds tracking the same index from the same provider are almost certainly substantially identical. Funds tracking different indexes from different providers usually are not, making them a common replacement to avoid triggering the wash-sale rule.

Do tax losses expire if I don't use them?

No, capital losses never expire. After offsetting current-year gains and up to $3,000 of ordinary income, any remaining loss carries forward indefinitely. You can use carried-forward losses to offset gains in future years until the balance is exhausted, which makes them a durable tax asset.

Ready to Build a Tax-Smart Investing Plan?

Tax-loss harvesting is one lever inside a larger year-round tax strategy, and it works best when it's coordinated with your gains, your brackets, and your long-term goals rather than run in a December panic. If you want a framework for thinking through these moves, our year-round tax planning guide breaks down when to harvest, when to convert, and when to give. Download it at chesapeakefp.com.


Want to go deeper? Our Tax-Smart Financial Plan walks through this step by step.

Disclosures

The information provided is for educational purposes only and should not be construed as investment advice. Investment strategies should be tailored to individual circumstances, risk tolerance, and goals. Past performance doesn't guarantee future results. Consult with qualified financial professionals regarding your specific situation.

This information is not intended to be a substitute for specific individualized tax, investment or legal advice. We suggest that you discuss your specific situation with a qualified tax, legal or financial advisor.

Advisors associated with Chesapeake Financial Planners may be either (1) LPL Financial Registered Representatives offering securities through LPL Financial, Member FINRA and SIPC, and investment advisor representatives offering investment advice through Great Valley Advisor Group; or (2) solely investment advisor representatives offering investment advice through Great Valley Advisor Group and not affiliated with LPL Financial. Great Valley Advisor Group, and Chesapeake Financial Planners are separate entities from LPL Financial.

Chesapeake Financial Planners | 2402 Scotlon Ct, Forest Hill, MD 21050 | (410) 652-7868 | www.chesapeakefp.com © 2026 Chesapeake Financial Planners | Not to be reproduced in whole or in part. All rights reserved.

author avatar
Jeff Judge Managing Partner
Jeff is one of Chesapeake’s founding partners and a go-to advisor for professionals navigating complex transitions like retirement, business sales, or sudden windfalls. With nearly two decades of experience, he’s known for delivering calm, clear guidance when it matters most. Clients say working with him feels like talking to a longtime friend, if that friend happened to be an award-winning financial expert.

Share: