Tax-Loss Harvesting: The Strategy That Works — and the Wash-Sale Rule That Kills It
Tax-loss harvesting is one of the few tax planning strategies available to investors in real time. Done correctly, it converts paper losses into real tax savings. Done carelessly, the wash-sale rule eliminates the benefit entirely. Here is how to do it right.
Tax-loss harvesting is the practice of selling investments at a loss to generate a capital loss deduction, then reinvesting the proceeds in a similar (but not identical) position to maintain market exposure. It is one of the few tax planning strategies that can be executed throughout the year rather than only at year-end, and it is available to virtually any investor with a taxable brokerage account.
The strategy is straightforward in concept. The execution is where most investors go wrong — primarily because of the wash-sale rule, which disallows the loss if the investor repurchases a substantially identical security within a specific window.
How Capital Losses Work
Capital losses offset capital gains dollar for dollar. If you have $50,000 of long-term capital gains and $30,000 of capital losses, your net long-term capital gain is $20,000. The losses reduce the amount of gain subject to tax.
If your capital losses exceed your capital gains, you can deduct up to $3,000 of net capital losses against ordinary income each year. Losses in excess of $3,000 carry forward indefinitely and can be used in future years — first against capital gains, then against ordinary income up to the $3,000 annual limit.
The character of the loss matters. Short-term losses (from assets held one year or less) first offset short-term gains, which are taxed at ordinary income rates. Long-term losses (from assets held more than one year) first offset long-term gains, which are taxed at preferential rates. After netting within each category, any remaining net short-term loss can offset net long-term gains, and vice versa.
This netting order means that a short-term loss is most valuable when it offsets short-term gains taxed at ordinary rates — potentially saving 37 cents per dollar at the highest marginal rate. A long-term loss that offsets long-term gains saves at most 23.8 cents per dollar (20% rate plus 3.8% net investment income tax). The character of the loss affects its value.
The Wash-Sale Rule: Section 1091
The wash-sale rule under Section 1091 disallows a capital loss if the taxpayer purchases a "substantially identical" security within 30 days before or after the sale that generated the loss. The 61-day window (30 days before, the day of sale, 30 days after) is the critical constraint.
When a wash sale occurs, the disallowed loss is not permanently lost — it is added to the basis of the replacement security. The loss is deferred, not eliminated. But the deferral can be indefinite if the replacement security is never sold, and it eliminates the current-year tax benefit that motivated the harvest in the first place.
Example: An investor sells 100 shares of XYZ stock at a $10,000 loss on November 15. On November 30 — 15 days later — the investor repurchases 100 shares of XYZ. The $10,000 loss is disallowed. The disallowed loss is added to the basis of the repurchased shares, so the investor's basis in the new shares is $10,000 higher than the purchase price. The tax benefit is deferred until the replacement shares are eventually sold.
What Is "Substantially Identical"?
The wash-sale rule applies to "substantially identical" securities — a term the IRS has never fully defined by regulation, leaving it to case law and administrative guidance.
Clearly substantially identical:
- The same stock (selling and repurchasing XYZ common stock)
- Options or warrants on the same stock
- Convertible bonds that are convertible into the same stock
Generally not substantially identical:
- Stock of a different company in the same industry (selling XYZ and buying ABC, a competitor)
- A different ETF tracking the same index (selling SPY and buying IVV, both tracking the S&P 500, is a gray area — see below)
- Bonds of the same issuer with different terms
- Preferred stock vs. common stock of the same issuer (generally, though facts matter)
The ETF gray area: Selling one S&P 500 index ETF and buying another S&P 500 index ETF is a common tax-loss harvesting technique. The IRS has not issued definitive guidance on whether two ETFs tracking the same index are substantially identical. Most tax practitioners treat them as not substantially identical based on the fact that they are issued by different entities and have different expense ratios, holdings (due to sampling methodologies), and dividend policies. But this position carries some risk, and investors who are aggressive about this technique should be aware that the IRS could take a contrary position.
Selling a mutual fund and buying an ETF tracking the same index is generally treated as not substantially identical, as they are different types of securities with different structures.
The Spousal and IRA Trap
The wash-sale rule applies across accounts — including accounts held by the taxpayer's spouse and the taxpayer's IRAs and Roth IRAs.
If you sell a stock at a loss in your taxable account and your spouse purchases the same stock in their taxable account within the 61-day window, the wash-sale rule applies. The loss is disallowed.
If you sell a stock at a loss in your taxable account and repurchase it in your IRA within the 61-day window, the wash-sale rule applies — and the result is particularly harsh. The disallowed loss is not added to the IRA's basis (because IRAs do not track basis in the same way as taxable accounts). The loss is permanently lost, not merely deferred.
This is one of the most common and costly wash-sale mistakes. Investors who use automatic dividend reinvestment in their IRAs or who make regular IRA contributions that are invested in the same securities they are harvesting losses on in their taxable accounts are particularly vulnerable.
Year-End Timing Considerations
The 30-day window before the sale date means that wash-sale planning must begin in early December, not on December 31. A loss harvested on December 15 cannot be replaced with a substantially identical security until January 15 of the following year — after the tax year has closed. This is generally acceptable.
But a loss harvested on December 31 cannot be replaced until January 31 — 31 days of market exposure gap. For investors who are concerned about missing a market recovery in January, the timing of the harvest matters.
The 30-day lookback also means that purchases made in late November can trigger wash sales on December losses. An investor who bought additional shares of a position in late November and then sells at a loss in December may have a wash sale on the portion of the loss attributable to the November purchase.
Harvesting Losses in a Rising Market
Tax-loss harvesting is most obviously applicable during market downturns, when many positions are underwater. But opportunities exist even in rising markets — in individual positions that have declined while the broader market has risen, in sector rotations, or in recently purchased positions that have dipped below cost.
Systematic tax-loss harvesting — reviewing the portfolio regularly throughout the year rather than only at year-end — captures more opportunities and avoids the year-end rush that can lead to hasty decisions.
The Long-Term Value of Harvested Losses
The tax benefit of harvesting a loss today is not simply the tax saved on the current year's return. It is the present value of the tax deferral — the ability to invest the tax savings and earn returns on them until the deferred gain is eventually recognized.
If you harvest a $10,000 loss that saves $2,380 in tax today (at the 23.8% long-term rate), and you invest that $2,380 for 20 years at a 7% annual return, the future value of the deferral is approximately $9,200. The harvested loss that saved $2,380 today is worth nearly $9,200 in future wealth — assuming the deferred gain is eventually recognized at the same rate.
This calculation changes if tax rates increase before the deferred gain is recognized. If the rate rises from 23.8% to 28.8%, the deferred gain costs more to recognize than the original harvest saved. This is the primary risk of aggressive tax-loss harvesting: deferring gains into a higher-rate environment.
Interaction with the Net Investment Income Tax
The 3.8% net investment income tax (NIIT) applies to net investment income — including capital gains — for taxpayers above the MAGI thresholds ($200,000 for single filers, $250,000 for married filing jointly). Capital losses reduce net investment income dollar for dollar, which means harvested losses save both the capital gains rate and the NIIT for taxpayers subject to both.
At the highest rates, a long-term capital loss saves 23.8% in federal tax (20% + 3.8%). A short-term capital loss saves up to 40.8% (37% + 3.8%). State income taxes add further savings in high-tax states.
What Tax-Loss Harvesting Cannot Do
Tax-loss harvesting is a deferral strategy, not an elimination strategy. The deferred gain will eventually be recognized — either when the replacement security is sold, or when it passes through the estate (at which point the step-up in basis at death may eliminate the gain entirely, which is the most favorable outcome).
It cannot convert ordinary income into capital gains. It cannot eliminate gains that have already been recognized. And it cannot overcome the wash-sale rule — the 61-day window is a hard constraint that requires genuine market exposure risk during the replacement period.
For investors who are disciplined about the wash-sale rules, systematic about monitoring their portfolio, and thoughtful about the character of the losses they harvest, tax-loss harvesting is a reliable source of incremental after-tax return. For investors who are careless about the rules, it is a source of disallowed losses and IRS scrutiny.
Related Services
Explore Topics
Written by
Scott Hatchett
Principal & Owner
Scott Hatchett is the Principal and Owner of Autarky Tax and Accounting. A former US Treasury and IRS agent, he brings insider knowledge of IRS procedures to every client engagement — from proactive tax strategy to audit defense.
.webp)