How to Avoid Wash Sales with a Tax-Loss Harvesting Strategy

Every investor faces moments when a stock or fund in their portfolio turns red. Watching a position slide into a loss is painful, but those paper losses hold a silver lining: they can become a powerful tool to lower your tax bill. By deliberately selling investments at a loss, you can offset capital gains and even reduce ordinary income, all while keeping your portfolio aligned with its long-term goals. This is the essence of a tax-loss harvesting strategy.

However, the Internal Revenue Service (IRS) imposes a critical restriction that can derail the entire benefit if you aren’t careful. Known as the wash sale rule, it disallows a loss if you repurchase a “substantially identical” security within 30 days before or after the sale. Without a clear plan, a well-intentioned loss sale can backfire, leaving you with a higher tax bill and a broken strategy.

This guide walks you through exactly how to execute a tax-loss harvesting strategy while steering completely clear of wash sales. You will learn when the approach makes sense, how to find replacement investments that preserve your market exposure, and what records you must keep to satisfy IRS requirements. By the end, you will have a repeatable process to turn market volatility into a tax advantage.

Quick Answer

To avoid a wash sale while harvesting losses, sell a losing investment, then immediately buy a different security that tracks the same market segment but is not “substantially identical.” Wait at least 31 days before buying back the original asset, and always check both your taxable accounts and your spouse’s accounts.

Understanding Tax-Loss Harvesting

At its core, tax-loss harvesting means selling an investment that has declined in value to realize a capital loss, then using that loss to offset taxable capital gains or, up to a limit, ordinary income. The tax code allows you to net gains and losses each year. Short-term losses first offset short-term gains, and long-term losses offset long-term gains. Any leftover net loss can offset up to $3,000 of ordinary income ($1,500 if married filing separately), with the remainder carrying forward to future years. This is not a tax dodge—it is an explicitly permitted feature of the U.S. tax system under Section 1211 and related provisions.

How a Tax-Loss Harvesting Strategy Works

Imagine you purchased 200 shares of an S&P 500 ETF in January at $100 per share, a total of $20,000. By October, the ETF has dropped to $80. You now have a $4,000 unrealized loss. You decide to sell all 200 shares, realizing a $4,000 capital loss. At the same time, you use the $16,000 proceeds to purchase a different ETF that tracks a large-cap index, such as a total U.S. stock market fund or another S&P 500 ETF from a different provider with a different index methodology. Your portfolio remains invested in U.S. large-cap stocks, but you have locked in a loss that can offset $4,000 in realized gains or, if you have no gains, reduce your ordinary taxable income by up to $3,000 this year and carry the remaining $1,000 forward.

The key to a successful tax-loss harvesting strategy is the replacement security. It must maintain your desired asset allocation and expected return characteristics without being identical to the sold asset. If the replacement is too similar, you trigger a wash sale. If it is too different, you are changing your portfolio’s risk profile, which defeats the purpose of staying invested.

The Wash Sale Rule: Your Biggest Obstacle

The wash sale rule, defined in Internal Revenue Code Section 1091, was created to prevent investors from claiming artificial losses. In simple terms, you cannot claim a loss on a sale if you acquire substantially identical stock or securities within a 61-day window—30 days before the sale, the day of the sale, or 30 days after. The rule also applies to options, contracts to acquire securities, and, importantly, purchases across all your accounts and your spouse’s accounts.

What Triggers a Wash Sale?

A wash sale occurs when you sell a security at a loss and, within the 61-day period, buy the same security, a contract or option to buy it, or a security that is “substantially identical.” The IRS has not issued an exhaustive list of what constitutes substantially identical, but court cases and IRS rulings provide guidance. Generally, two stocks from different companies are not substantially identical, even if they are in the same industry. Two mutual funds or ETFs that track exactly the same index using the same methodology are substantially identical. For example, selling one S&P 500 ETF tracking the Standard & Poor’s index and buying another S&P 500 ETF tracking the same index from a different provider is very likely a wash sale. Converting a traditional IRA to a Roth IRA and buying the same investment can also trigger the rule. Even dividend reinvestment purchases within the window can inadvertently create a wash sale.

The 61-Day Window

Many investors mistakenly believe they only need to wait 30 days after the sale to rebuy. In reality, the look-back period includes the 30 days before the sale. If you bought more shares of the losing stock 20 days ago and then sell a portion at a loss, the loss is disallowed and added to the basis of those recently purchased shares. The window is strict: day one of the sale counts as the middle, so the 30 days before and after include the sale date itself, making a total of 61 calendar days, not business days.

Step-by-Step Guide to Implement a Tax-Loss Harvesting Strategy

Step 1: Review Your Portfolio for Unrealized Losses

Begin by scanning every taxable brokerage account you own. Look for positions showing an unrealized loss. Sort by the size of the loss and the purchase lot if you use specific identification cost basis. Short-term losses are generally more valuable because they offset short-term gains taxed at your marginal income tax rate. Long-term losses offset long-term gains taxed at lower capital-gains rates, so harvesting short-term losses often provides a larger tax benefit.

Make a list of all losing lots, including the acquisition date, cost basis, and current market value. Confirm that you have held the security for at least the required holding period if it pays qualified dividends, though that does not affect the loss deduction itself.

Step 2: Identify Suitable Replacement Investments

This is where the wash sale rule must be top of mind. Your goal is to find a replacement that maintains the same market exposure without being substantially identical. A good replacement will have a high correlation with the sold security over time but a different underlying index, issuer, or methodology. For example:

  • If you sell a large-cap growth ETF tracking the Russell 1000 Growth Index, you might buy a large-cap growth ETF tracking the S&P 500 Growth Index or a total market fund that includes both growth and value.
  • If you sell individual stock in a large technology company, you could replace it with a technology sector ETF to maintain industry exposure without triggering a wash sale on that single stock.
  • For bonds, a municipal bond ETF from one issuer can be replaced with a similar-duration municipal bond ETF from a different issuer tracking a different index.

Be cautious with ETFs that follow the same index. Selling a Vanguard S&P 500 ETF (VOO) and buying an iShares S&P 500 ETF (IVV) will almost certainly be a wash sale because they track the exact same index and hold substantially identical baskets of stocks. Instead, switch to a total U.S. stock market ETF, a large-cap index that uses a different weighting methodology, or an ETF that tracks a different benchmark like the CRSP US Large Cap Index.

Step 3: Execute the Sale and Purchase

Place the sell order for the losing lot. Use specific identification of shares if your broker allows it, so you realize the exact loss you want. Immediately after the sale settles, buy the pre-selected replacement security. You do not need to wait for settlement to place the buy order; you can place both orders on the same day using settled cash or margin, as long as you are not buying the same security back. The key is to avoid leaving cash on the sidelines, which would disrupt your asset allocation and potentially cause you to miss a market rebound.

Step 4: Document and Track Wash Sale Windows

For every tax loss harvested, create a record with the sale date, the security sold, the loss amount, the replacement purchased, and the date you can safely repurchase the original security—31 calendar days after the sale date. Set a calendar reminder for that date. Also note if you hold the same security or a substantially identical one in a retirement account or your spouse’s accounts, because purchases there within the window still trigger a wash sale. If you participate in automatic dividend reinvestment, pause it for the original security across all accounts during the 61-day window.

Step 5: Reinvest Tax Savings

The real power of a tax-loss harvesting strategy comes when you reinvest the tax savings. By lowering your current tax bill, you free up cash that can be invested according to your long-term plan. This increases your effective after-tax return. The best practice is to immediately invest the amount you would have paid in taxes into your portfolio. Even if you simply direct the savings into a broad-market index fund, the compounding effect over decades can be substantial.

When to Use a Tax-Loss Harvesting Strategy

Year-End Tax Planning

The final months of the year are the most common time for tax-loss harvesting because investors have a clearer picture of their realized gains and income for the year. By December, you can estimate your capital-gains tax liability and decide how much in losses to harvest. Many advisors systematically scan portfolios in November to capture losses before year-end. The transaction must settle by December 31 to count for that tax year, so don’t wait until the last business day if markets are closed.

Market Downturns

Sharp market corrections create abundant harvesting opportunities. In a broad sell-off, many positions may be underwater, allowing you to realize losses and reset your cost basis at lower levels while immediately reinvesting in similar but not identical assets. A disciplined tax-loss harvesting strategy turns a 20% market decline into a multi-year tax asset. Even if you have no current gains to offset, you can carry losses forward indefinitely, so harvesting during a downturn builds a bank of losses that can offset future gains from a rebound.

High-Income Years

If you anticipate being in a higher tax bracket this year than in future years—due to a bonus, stock option exercise, or business sale—harvesting losses to offset ordinary income up to $3,000 becomes more valuable. The higher your marginal rate, the more each dollar of loss saves in tax. Coupled with offsetting short-term gains, the tax alpha can be significant.

Common Mistakes and How to Avoid Them

1. Overlooking retirement accounts. The IRS has made clear that buying a substantially identical security in an IRA within the wash sale window will disallow the loss permanently, because the basis adjustment in a tax-advantaged account provides no future tax benefit. Always check your IRA, Roth IRA, and even 401(k) holdings before selling in a taxable account.

2. Forgetting dividend reinvestment. A small automatic dividend reinvestment that buys just a few shares can partially wash a large loss. Turn off DRIP for the sold security and any substantially identical fund during the 61-day window.

3. Thinking a different share class provides protection. Selling a mutual fund and buying the ETF share class of the same fund, or vice versa, is a wash sale. Brokerage platforms may treat them as different tickers, but the IRS sees the same underlying pool of assets.

4. Ignoring the 30-day prior rule. A loss can be disallowed even if you didn’t buy the security after the sale, if you had bought additional shares within the 30 days before. Always review your purchase history.

5. Sitting in cash too long. Harvesting the loss but waiting weeks to reinvest because you are unsure what to buy injects market-timing risk. Have your replacement chosen before you sell.

Advanced Considerations in a Tax-Loss Harvesting Strategy

For larger portfolios, tax-loss harvesting can be automated through direct indexing accounts, where you own the individual stocks of an index rather than an ETF. When one stock falls, the platform sells it and buys a correlated stock, harvesting losses at the individual security level while tracking the index. This dramatically increases the number of harvesting opportunities. However, the same wash sale rules apply: the replacement stock must not be identical, and the system must monitor across all your accounts.

Another nuance involves the netting rules. Because short-term losses are more valuable, some investors preferentially harvest short-term losers. But if you have large long-term gains, harvesting long-term losses can offset them directly. Work with your tax professional to align the holding period of the loss with the type of gain you want to offset.

Qualified dividends and holding periods demand attention as well. If you hold a stock or fund for 60 days or less around the ex-dividend date and receive a qualified dividend, that dividend may be recharacterized as ordinary income. Tax-loss harvesting around dividend dates can inadvertently increase your taxes on dividends, so factor this into your timing.

Conclusion

A well-executed tax-loss harvesting strategy is one of the few reliable ways to generate after-tax alpha without taking on additional market risk. By methodically realizing losses, swapping into carefully selected replacement securities, and strictly observing the wash sale window across all your accounts, you can lower your current and future tax liability while staying fully invested. The wash sale rule is the guardrail, not a barrier; it simply requires you to be intentional about what you buy and when. With the step-by-step process outlined here, you can confidently convert market dips into tax savings, year after year.

FAQ

What is a tax-loss harvesting strategy?

A tax-loss harvesting strategy involves selling investments that have lost value to realize capital losses, then immediately buying different, but highly correlated, securities to maintain market exposure. The realized losses offset capital gains and up to $3,000 of ordinary income, reducing your tax bill while keeping your portfolio on track.

How do I avoid a wash sale when harvesting losses?

To avoid a wash sale, do not repurchase a substantially identical security within 30 days before or after the sale date. Instead, buy a security that tracks a different index or uses a different methodology. Check all taxable and retirement accounts, including your spouse’s accounts, and suspend dividend reinvestment during the 61-day window.

Can I buy the same stock back after 30 days?

Yes. The wash sale window closes 30 calendar days after the sale date. On day 31, you can repurchase the original security without triggering the rule. Many investors set a reminder to buy back the original holding after the waiting period if they prefer it for the long term.

Does tax-loss harvesting work in retirement accounts?

No. Tax-loss harvesting only benefits taxable brokerage accounts. Losses inside IRAs, 401(k)s, and other tax-advantaged accounts are not deductible. Furthermore, buying a substantially identical security in an IRA within the wash sale window can permanently disallow a loss taken in a taxable account.

Is a tax-loss harvesting strategy the same as tax evasion?

Absolutely not. Tax-loss harvesting is a legal and IRS-sanctioned tax planning technique. It relies on explicit provisions of the Internal Revenue Code and has been upheld in numerous tax court cases. Properly documented and following wash sale rules, it is a legitimate way to optimize after-tax returns.

How much can I save with a tax-loss harvesting strategy?

Savings depend on your tax bracket and the size of harvested losses. If you are in the 20% long-term capital gains bracket, every $10,000 of harvested loss can save $2,000 in federal tax. Harvested losses above gains can offset up to $3,000 of ordinary income, saving you at your marginal rate, which could be 24%, 32%, or higher.

Leave a Reply

Your email address will not be published. Required fields are marked *