ETF

Swapping One S&P 500 ETF for Another to Harvest a Loss? The Wash-Sale Rule Gets Murky

Selling SPY to buy VOO looks like a clean year-end tax move, but two words buried in the tax code could hand your harvested loss straight back to the IRS. The IRS never defined those words, and that silence is…

Published October 29, 2026, 9:03am ET · 4 min read

The ETF Examiner desk. Editor: Ryne Mauck.

This post may contain links from our sponsors and affiliates, and Flywheel Publishing may receive compensation for actions taken through them.

Memo stick with tax-loss harvesting phrase.
Memo stick with tax-loss harvesting phrase. © Memo stick with tax-loss harvesting phrase. (Shutterstock.com) by Vitalii Vodolazskyi

Year-end is when many investors comb through their accounts looking for losses. One popular move is to sell an S&P 500 ETF that’s trading below what you paid, then immediately buy a near-twin from a different sponsor so you never leave the market. The catch is a 30-day window written into the U.S. Internal Revenue Code, plus a two-word phrase the law never defines.

If you own the SPDR S&P 500 ETF Trust (NYSEARCA:SPY), the Vanguard S&P 500 ETF (NYSEARCA:VOO), or the iShares Core S&P 500 ETF (NYSEARCA:IVV), this affects you directly. Does switching one for another keep the loss, or does the IRS take it back?

How the Wash-Sale Rule Catches Year-End Swaps

Tax-loss harvesting means selling an investment at a loss so the loss can offset capital gains on your tax return. The wash-sale rule is there to stop people from gaming it. Under 26 U.S.C. § 1091(a), no loss deduction is allowed if, within a period beginning 30 days before the sale and ending 30 days after it, you acquire substantially identical stock or securities.

The window runs in both directions. A purchase made weeks before the sale counts just as much as one made the next morning. The statute also covers entering into a contract or option to acquire those securities, so buying call options on the same fund can trigger the rule.

IRS Publication 550 adds that buying substantially identical stock for your IRA or Roth IRA counts too. So does a purchase by your spouse.

Same Index, Three Sponsors and a Phrase Nobody Defined

Section 1091(a) never defines “substantially identical” in its text. That gap is why same-index trades are unclear.

All three funds track the S&P 500. According to iShares’ statement of additional information for IVV, that’s a capitalization-weighted index of approximately 503 large U.S. companies. The funds come from three different sponsors: Vanguard, BlackRock’s iShares, and State Street.

What a Disallowed Loss Costs You

Two terms come into play here. Your cost basis is what you paid for your shares, and it’s the figure used to work out your gain or loss when you sell. Your holding period is how long you’ve owned the shares, which determines whether a gain is taxed as short-term or long-term.

If the wash-sale rule applies, IRS Publication 550 says you add the disallowed loss to the cost of the new stock or securities, which defers the deduction until you sell those shares. The new shares’ holding period also includes the time you held the shares you sold. The statute sets out both adjustments in Section 1091(d) and Section 1223(3).

That means the loss stays on your books, but it can’t offset this year’s gains, and offsetting this year’s gains was the whole reason to harvest it.

Your Own Dividend Reinvestment Can Trip the Rule

Publication 550 notes that most funds let shareholders automatically reinvest distributions in more shares. A reinvestment is a purchase. If you sell part of a position at a loss and the same fund reinvests a dividend inside the window, those new shares can be matched against the shares you sold.

The publication’s own examples show a loss being split this way, with only the matched portion disallowed. 24/7 Wall St. covered the same trap with a monthly payer in Selling JEPI at a Loss While Reinvesting Its Monthly Check Hands Part of the Tax Loss Back to the IRS.

How to Shrink the Gray Area Before December 31

Investors who want less uncertainty usually go one of two ways. One is buying a replacement fund that tracks a different index, which puts more distance between the two holdings. The other is waiting until the window after the sale has closed before buying back in. Both cut down the gray area, though the IRS offers no formal safe harbor (a guaranteed-safe method) for either.

Before you place a year-end trade, run through this checklist:

  • Review every purchase of the fund in the window before your planned sale, across taxable accounts, IRAs, and your spouse’s accounts.
  • Turn off automatic dividend reinvestment on the fund you plan to sell.
  • Avoid buying options or contracts on the fund during the window.
  • Determine whether your replacement changes the index or only the sponsor.

Switching between same-index ETFs is a judgment call the tax code doesn’t settle. Investors who want certainty on a year-end loss should change the index, not just the sponsor, or wait out the full window before buying back.

Contact [email protected] for any questions or corrections.

Ryne Mauck

Ryne Mauck is an investment writer covering exchange-traded funds, retirement planning, and portfolio strategy. Through his work at 24/7 Wall St. and other investment platforms, including Seeking Alpha, he aims to provide clear, research-driven insights that help investors make more informed decisions while maintaining a long-term approach to investing.

Ryne holds a B.Sc. in Finance and an M.A. in Political Science. He is a formerly registered Municipal Advisor Representative and has passed the Series 50, Series 63, and Series 65 exams. His articles are not intended to be, nor should they be interpreted as, financial advice.

All articles →