← Back to blog

Tax Loss Harvesting for U.S. Investors: Avoid a 30-Day Wash Sale

October 13, 2026
Tax Loss Harvesting for U.S. Investors: Avoid a 30-Day Wash Sale

Tax loss harvesting lets you sell an investment at a loss in a taxable brokerage account and use that loss to offset capital gains, plus up to a limited amount of ordinary income each year, with any excess carried forward to future years. It works only in taxable accounts, never in an IRA or 401(k), and the main trap to avoid is the wash sale rule, which disallows the deduction if you buy a substantially identical security within a certain 30-day window before or after the sale.


TL;DR:

  • If losses exceed gains, you can deduct up to $3,000 against ordinary income annually, or $1,500 if married filing separately; excess carries forward indefinitely.
  • A wash sale disallows your loss if you or your spouse buy the same or substantially identical security within 30 days before or after selling.
  • Pair harvesting with a planned rebalance, and trade only when the tax benefit outweighs costs and the replacement keeps your target allocation intact.
  • Check each lot’s holding period: short term losses offset short term gains first, and selling before the one year mark may sacrifice longer term treatment.
  • Report harvested sales on Form 8949, carry totals to Schedule D, and track replacement shares’ adjusted basis when a wash sale disallows a deduction.

Oracleinvestments
Make More Informed Investment Decisions
Compare over 260 stocks by profitability, valuation, and financial health with Oracle Investments’ stock analysis app.
Explore the app

Table of Contents

What Tax Loss Harvesting Is and How It Works

Tax loss harvesting turns a paper loss into something useful on your tax return. Instead of just watching a losing position sit in your portfolio, you sell it, lock in the loss for tax purposes, and use the proceeds to stay invested somewhere similar but not identical.

The process follows a consistent sequence:

  1. Identify losing lots. Look at individual tax lots, not just the overall position, since you might own 100 shares of a stock bought at different times and prices, with some lots up and others down.
  2. Sell to realize the loss. Selling converts an unrealized loss into a realized one that can actually affect your taxes.
  3. Apply the loss against gains or income. The loss first offsets capital gains, and if any remains, up to $3,000 of ordinary income.
  4. Reinvest without triggering a wash sale. Put the proceeds into something that keeps your market exposure similar without being "substantially identical" to what you sold.

Losses and gains are sorted by holding period before they offset each other. Short-term losses, from assets held one year or less, first offset short-term gains, which is valuable because short-term gains are taxed at ordinary income rates. Long-term losses offset long-term gains next, and any leftover short-term loss can cross over to offset long-term gains, and vice versa.

Here's a simple illustration. Say you sold a stake in a growth fund for a $5,000 long-term gain earlier in the year, say after holding it for three years. You also hold a separate position down $5,000 that you no longer want to keep at that size. Selling that losing position realizes a $5,000 loss, which offsets the $5,000 gain dollar for dollar. Your net taxable capital gain for the year on those two trades drops to zero.

That example only works because both trades happened in the same taxable account in the same tax year. If the gain had occurred inside a 401(k), there would be nothing to offset, since tax loss harvesting applies only to taxable accounts and does not touch tax-sheltered retirement accounts.

Key IRS Rules and Limits You Must Know

Three IRS rules govern how far tax loss harvesting can take you, and missing any one of them can turn a smart tax move into a wasted trade.

If your losses exceed your gains, you can deduct up to $3,000 of the excess against ordinary income each year, or $1,500 if you're married filing separately, and any amount beyond that carries forward indefinitely to future tax years.

The wash sale rule is the part that trips up even experienced investors. It disallows your loss deduction if you buy the same security, or one the IRS considers "substantially identical," within 30 days before or after the sale date, a 61-day window in total. Common triggers include:

  • Selling a stock at a loss and buying it back within the 30-day window in the same account.
  • Selling an index fund and buying another fund tracking the same index, which the IRS may treat as substantially identical.
  • Your spouse buying the same security in a separate account during the window, since wash sale rules apply across accounts you both control.
  • Repurchasing shares inside an IRA after selling them at a loss in a taxable account, which also triggers a wash sale with no future basis benefit.
  • Selling stock and buying call options on the same company within the window.

Most filers can deduct a set annual limit against ordinary income when capital losses exceed capital gains, with any remainder carried forward indefinitely, per IRS Topic 409. That carryforward has no expiration date, so a large loss harvested this year can still be useful a decade from now.

Reporting happens on Form 8949, where you list each sale, apply adjustment codes when a wash sale disallows part of the loss, and then carry the totals to Schedule D. When a loss is disallowed under the wash sale rule, it isn't gone. It gets added to the cost basis of the replacement shares, which reduces your taxable gain, or increases your deductible loss, whenever you eventually sell those replacement shares.

Disallowed loss added to replacement share basis

When Tax Loss Harvesting Typically Makes Sense

Some investors harvest losses once a year in December. Others monitor positions continuously and act whenever a meaningful loss appears. Year-end harvesting is simpler to execute and easier to document, since you review the whole portfolio at once, but it can mean missing opportunities that show up and disappear earlier in the year during a spring or summer pullback. Continuous harvesting captures more losses over time but demands more frequent tracking of lots, holding periods, and wash sale windows.

Certain situations tend to make harvesting worth the effort:

  • A large taxable gain from RSUs, an ESPP sale, or a bonus-funded investment that pushed your tax bill up unexpectedly this year.
  • A scheduled portfolio rebalance, since you're already selling positions and can choose to realize losses at the same time.
  • A sharp market downturn that leaves recently purchased lots underwater even if the overall position is still profitable.
  • A concentrated stock position, often from employer equity, where trimming the position for risk reasons also happens to generate a usable loss.

The value of harvesting depends on your marginal tax bracket and your state's treatment of capital losses, since not every state mirrors federal rules exactly. An investor in a high federal bracket with a high state income tax rate gets more benefit per dollar of harvested loss than someone in a lower bracket or a state with no income tax.

Pro Tip: Run the numbers before you trade. A loss is only worth harvesting if the tax benefit outweighs transaction costs and the risk of drifting out of your target allocation.

How to Harvest Losses Without Breaking Your Allocation

Harvesting a loss is straightforward in theory. Doing it without accidentally triggering a wash sale or throwing your portfolio out of balance takes a bit more discipline.

Start with three pre-checks before you place any trade:

  1. Review lot-level basis and holding period for the position you're considering, since different lots of the same stock can have very different cost bases and tax treatments.
  2. Check for the same or a substantially identical security anywhere else you or your spouse hold accounts, including IRAs, since a wash sale can be triggered across accounts you control.
  3. Confirm the position isn't about to go ex-dividend or report earnings in a way that complicates your timing decision.

From there, execution comes down to three steps:

  1. Choose the specific lots to sell, often the highest-cost-basis lots first if you're trying to maximize the realized loss.
  2. Sell the position and note the trade date, since that date starts the wash sale clock.
  3. Select a replacement security that maintains similar market exposure without being substantially identical, such as swapping one large-cap growth fund for a different large-cap growth fund from another provider rather than buying back the same fund.

Timing matters here. If you plan to repurchase the original security eventually, wait at least 31 days after the sale date to avoid the wash sale rule, which spans 30 days before and after the sale. Buying even one day too early inside that window disallows the loss and adds it to the new shares' basis instead.

Pro Tip: Set a calendar reminder for day 31 after any harvested sale if you intend to buy back the original position, since missing the window by even a day forfeits the immediate deduction.

Once the trade settles, three post-trade steps keep things clean:

  • Record the realized loss amount and the new cost basis of whatever you bought as a replacement.
  • Check your overall allocation to confirm the swap didn't change your sector or asset-class exposure more than intended. A portfolio drift review at this point catches unintended tilts before they compound.
  • Track any carryforward loss you'll need to report in future years, along with the current year's Form 8949 entries.

Keeping a simple log of each harvested lot, the sale date, the replacement security, and the wash sale deadline saves a lot of confusion when tax season arrives. Tracking portfolio performance consistently throughout the year makes this kind of record-keeping far less painful than reconstructing it in April.

How to Report Harvested Losses on Your Tax Return

Every sale that generates a harvested loss gets reported on Form 8949 before the totals flow to Schedule D.

  • Check the correct box on Form 8949 based on whether your broker reported the basis to the IRS (covered securities) or not (noncovered securities), since this determines which part of the form you use.
  • Apply adjustment code "W" when part or all of a loss is disallowed under the wash sale rule, entering the disallowed amount as a positive adjustment in the appropriate column.
  • Carry your totals to Schedule D, which separates short-term and long-term results and calculates your net capital gain or loss for the year.
  • Keep records of the replacement shares' adjusted basis, since a disallowed wash sale loss gets added to that basis rather than disappearing, deferring the benefit until you eventually sell the replacement shares.

The Form 8949 instructions and IRS Publication 550 walk through these codes and adjustments in detail, including less common situations like partial wash sales across multiple lots.

If your harvesting activity for the year involves wash sales across several accounts, a large RSU vesting event, or carryforward losses from prior years, a tax preparer familiar with investment income can confirm the forms are filled out correctly. The cost of a mistake, an understated gain or a missed carryforward, often exceeds the cost of a second pair of eyes on the return.

Trade-Offs and Common Pitfalls

Tax loss harvesting isn't free. It comes with real trade-offs that are worth weighing against the tax benefit before you trade.

  • Portfolio drift can creep in when you swap one holding for another to avoid a wash sale, especially if you repeat this across several positions without checking the combined effect on your allocation. Reviewing portfolio turnover alongside your harvesting activity helps catch this before it becomes a bigger rebalancing project.
  • Transaction costs and tax-lot tracking complexity add up, particularly for investors harvesting frequently across many positions rather than once a year.
  • A short-term loss used today might have become a long-term loss worth more per dollar if held a bit longer, so timing the sale against the one-year holding threshold matters.
  • Automated tools have limits. An SEC enforcement matter found that a robo-adviser overstated how thoroughly it monitored client accounts for wash sale triggers, and wash sales occurred that reduced the harvested losses clients actually received. That example is a reminder to verify any automated harvesting program's actual monitoring scope rather than assuming full coverage across every linked account.

How Oracle Investments Helps You Spot Harvesting Opportunities

Deciding which losing lot to sell is easier when you can see a stock's fundamentals clearly instead of just its price chart. We score over 260 stocks on profitability, valuation, and financial health, so when a position is down, you can quickly check whether the business behind it still looks sound or whether the loss is a signal to exit for reasons beyond taxes.

Real-time portfolio tracking lets you see which lots are underwater right now without digging through separate brokerage statements, and side-by-side company comparisons help you find a reasonable, non-identical replacement security when you're trying to stay invested in a similar sector or style. For more on related decisions, our posts on when to sell stocks and downside protection strategies cover how to think through an exit beyond the tax angle alone.

Our subscription plan builds on these fundamentals-based scores with deeper comparison tools for investors who want to monitor allocation and evaluate replacement candidates more closely throughout the year.

A Few Rules of Thumb Worth Remembering

After-tax results matter more than the tax trade itself, so avoid selling a fundamentally sound holding purely to harvest a small loss. Pair harvesting with rebalancing whenever possible, since you're already reviewing your allocation and can capture losses without extra transaction overhead. Document every sale, replacement, and wash sale deadline as you go rather than reconstructing it at tax time.

For complex situations, wash sales spanning a spouse's account or a large RSU disposition, talk to a tax advisor before trading. Our long-term investing strategy guide is a good reminder that tax tactics should serve your broader plan, not the other way around.

— Matt

Make Smarter Harvesting Decisions With Oracle Investments

Oracleinvestments

Spotting a good harvesting candidate takes more than a red number on your brokerage app. We built our scoring system to show you the fundamentals behind every position, profitability, valuation, and financial health, so you can tell whether a losing stock is a tax opportunity, a business in real trouble, or both. Real-time portfolio tracking keeps every lot visible in one place, and side-by-side comparisons make it easier to find a reasonable replacement security that keeps your allocation intact.

With our subscription plan, you get:

  • Fundamentals-based scores across many stocks to evaluate what you're holding and what you might buy instead.
  • Real-time portfolio tracking to see gains, losses, and allocation shifts as they happen.
  • Side-by-side stock comparisons to find a non-identical replacement for a harvested position.

If this sounds like the kind of clarity you want before your next trade, check out Premium Annual and see how it fits your taxable account strategy.

For readers who automate parts of their portfolio management, a rebalancing workflow built on automated portfolio rebalancing strategies for TradingView traders can complement a manual harvesting review, keeping your target allocation on track between the trades you make by hand.

This article is general information, not a substitute for advice from a qualified financial advisor. Consult a qualified financial professional about your own circumstances before acting on anything here.

FAQ

What is the downside of tax-loss harvesting?

The main downsides are portfolio drift if replacement securities aren't a close enough match, added transaction costs and recordkeeping complexity, and the risk of using up a short-term loss that would have been more valuable as a long-term loss later. Harvesting also delivers no benefit at all when attempted inside a tax-sheltered account like an IRA or 401(k), since those accounts aren't eligible.

What is the best strategy for harvesting tax losses?

There's no single best strategy, but pairing harvesting with a scheduled rebalance tends to work well because you're already reviewing your holdings and can realize losses without extra unplanned trades. Checking lot-level basis, confirming no wash sale exposure across any account you or a spouse controls, and choosing a replacement security that isn't substantially identical are the core steps that apply regardless of timing.

Can I tax-loss harvest in a 401(k)?

No. Tax-loss harvesting only applies to taxable brokerage accounts, since gains and losses inside a 401(k) or IRA aren't taxed the same way and there's nothing to offset on your current-year tax return.

Can you write off 100% of stock losses?

You can offset 100% of your capital gains with capital losses in the same tax year, but once losses exceed gains, you can only deduct up to $3,000 against ordinary income ($1,500 if married filing separately) per year. Any amount beyond that limit carries forward to future tax years indefinitely rather than being written off all at once.

Sources