Home › Accounts & Taxes › Tax-Loss Harvesting With Index Funds: How It Works and the Wash-Sale Trap

Tax-Loss Harvesting With Index Funds: How It Works and the Wash-Sale Trap

Short answer: Tax-loss harvesting means selling an index fund that’s worth less than you paid, using the loss to offset gains and up to $3,000 a year of other income, and buying a similar fund that follows a different index so you stay invested. Under the IRS wash-sale rule (Publication 550), the loss is disallowed if you, your spouse or your IRA buy a “substantially identical” investment within 30 days before or after the sale.

Every December, a lot of index fund investors look at their taxable brokerage account and see the same thing: some funds are up, and one or two are down. A fund that’s down isn’t only bad news. If you sell it before the year ends, the loss can lower your tax bill. That move is called tax-loss harvesting, and index funds are some of the easiest investments to do it with.

There’s one rule that trips people up, though: the wash-sale rule. Get it wrong and the IRS simply ignores your loss. This guide explains how harvesting works, what the wash-sale rule actually says, and how index fund investors can harvest a loss without breaking it. Every rule here comes from the IRS’s own publications.

What tax-loss harvesting is

Tax-loss harvesting means selling an investment that’s worth less than you paid for it, so the loss counts on this year’s tax return, and then putting the money back into the market so you stay invested.

The loss is useful in two ways:

  • It cancels out gains. Capital losses first offset capital gains you realized in the same year, for example from selling another fund at a profit or from capital gains distributions your funds paid you.
  • It reduces your other income, up to a limit. If your losses are bigger than your gains, IRS Publication 550 says your deduction is the lesser of “$3,000 ($1,500 if you are married and file a separate return)” or your total net loss.

Anything above that limit isn’t lost. According to Publication 550, “you can carry over the unused part to the next year,” and keep carrying it forward “until it is completely used up.”

Harvesting only works in a taxable account. Gains and losses inside a 401(k), traditional IRA or Roth IRA aren’t reported year by year, so there’s nothing to harvest there. If you’re not sure which kind of account you hold your funds in, our comparison of index funds in a Roth IRA vs a taxable account explains the difference.

A worked example

Say that early in 2026 you put $20,000 into an S&P 500 index fund in a taxable brokerage account. By late November, after a rough stretch for the market, the shares are worth $17,000.

  • You sell the fund. That locks in a $3,000 capital loss.
  • The same day, you put the $17,000 into a different broad U.S. stock index fund, one that follows a different index (more on that below).
  • You had no other capital gains in 2026, so the whole $3,000 reduces your ordinary income. If your top federal tax rate is 22%, that’s about $660 less federal income tax for 2026.

Your money never left the stock market. You still own a broad U.S. stock fund that moves very much like the one you sold. What changed is that the IRS now recognizes the loss.

These numbers are hypothetical, and your result depends on your own tax rates and the rest of your return.

The catch: harvesting usually postpones tax rather than erasing it

The new fund’s cost basis is the $17,000 you paid for it, not the $20,000 you paid for the old one. So when you eventually sell it, your gain will be $3,000 larger than it would have been. You’ve moved tax from today to some future year.

That can still be a good deal:

  • You get the money now. Tax saved today can stay invested for years.
  • The rates can be different. A harvested loss can cut income taxed at your ordinary rate (up to $3,000 a year), while the extra gain later may be taxed at the lower long-term capital gains rates. For 2026, according to IRS Revenue Procedure 2025-32, the 0% long-term rate applies to taxable income up to $49,450 for single filers and $98,900 for married couples filing jointly, and the 15% rate up to $545,500 and $613,700. Above that, the rate is 20%, and higher earners can also owe the 3.8% net investment income tax.
  • You might sell in a lower-income year, such as early retirement, when part of that future gain could fall in the 0% bracket.

It’s not free money in every case, though. If you’re already in the 0% long-term bracket this year, a harvested loss may save you little or nothing.

The wash-sale rule, in the IRS’s own words

Publication 550 says: “You cannot deduct losses from sales or trades of stock or securities in a wash sale,” unless you’re a dealer in securities. A wash sale happens when you sell at a loss and, “within 30 days before or after the sale,” you:

  • buy substantially identical stock or securities,
  • acquire them in a fully taxable trade,
  • acquire a contract or option to buy them, or
  • acquire substantially identical stock for your IRA or Roth IRA.

Three details matter most for index fund investors:

  1. The window is 61 days, not 30. It runs 30 days before the sale, the day of the sale and 30 days after. A purchase in the weeks before you sell counts too.
  2. Your spouse counts. Publication 550 adds: “If you sell stock and your spouse or a corporation you control buys substantially identical stock, you also have a wash sale.”
  3. Your IRA counts, and that loss is gone for good. In Revenue Ruling 2008-5, the IRS ruled that if you sell at a loss and have your IRA or Roth IRA buy substantially identical securities in the window, the loss is disallowed and your basis in the IRA is not increased. In other words, you don’t get to use that loss later either.

In an ordinary wash sale inside a taxable account, the loss isn’t lost forever. Publication 550 says you “add the disallowed loss to the cost of the new stock or securities,” which postpones the deduction until you sell the new shares. But a postponed loss isn’t what you were trying to get in December.

What counts as “substantially identical” for an index fund?

This is the gray area. Publication 550 says only that “you must consider all the facts and circumstances in your particular case,” and that stock of one company ordinarily isn’t substantially identical to stock of another. It doesn’t say anything specific about index funds.

That leaves a practical spectrum:

  • Clearly too close: the same fund. Selling shares of a fund and buying shares of the same fund within the window is a wash sale. This includes buying back a different share class of the very same fund, which owns the same portfolio.
  • Uncertain: a different company’s fund that tracks the same index. Our S&P 500 fee analysis found 32 funds that track the plain S&P 500. Their portfolios are nearly the same, and the IRS has never said whether swapping one for another is a wash sale. Some investors do it; it’s a judgment call with real risk.
  • Generally treated as safe: a fund that tracks a different index. A total stock market fund holds the same large companies as an S&P 500 fund plus thousands of smaller ones, follows a different index and doesn’t move in lockstep with it. Our comparison of total stock market vs S&P 500 index funds shows how much they overlap and how they differ.

The cautious approach is the third one: swap into a fund that follows a different index, wait at least 31 days, and then decide whether to switch back.

The big fund families make this easy, because each one runs both kinds of fund at very low cost:

Fund familyS&P 500 fundTotal-market fund
FidelityFidelity 500 Index Fund (FXAIX), 0.015%Fidelity Total Market Index Fund (FSKAX), 0.015%
SchwabSchwab S&P 500 Index Fund (SWPPX), 0.02%Schwab Total Stock Market Index Fund (SWTSX), 0.03%
VanguardVanguard 500 Index Fund ETF Shares (VOO), 0.03%Vanguard Morningstar Total Stock Market ETF (VTI), 0.03%
iSharesiShares Core S&P 500 ETF (IVV), 0.03%iShares Core S&P Total U.S. Stock Market ETF (ITOT), 0.03%

Expense ratios are from each fund’s prospectus as filed with the SEC. The Vanguard total-market fund was renamed in 2026 and now carries “Morningstar” in its name; its ticker didn’t change.

This is a pairing, not a recommendation of any fund. The point is that a swap can keep your costs and your market exposure almost unchanged.

Four ways index fund investors trigger a wash sale by accident

Most wash sales aren’t deliberate. They come from automatic features that keep buying in the background.

  1. Dividend reinvestment. A reinvested dividend is a purchase. If the fund reinvested a dividend in the 30 days before your sale and you keep those new shares, or if it reinvests one in the 30 days after (because you sold only part of your position), part of your loss can be disallowed. Publication 550 matches shares bought against shares sold, so the disallowed slice is usually small, but it’s avoidable: turn off reinvestment ahead of time, and when you harvest, sell every lot of the fund, including recent reinvestments.
  2. Automatic investments. A monthly purchase plan into the same fund will land inside the window. Pause it or point it at the replacement fund.
  3. Other accounts. A purchase in your IRA, your spouse’s account or a second brokerage account counts. Your broker may not catch it: the IRS instructions for Form 1099-B require brokers to report a wash sale only when “both the sale and purchase transactions occur in the same account” with the same CUSIP number. Across accounts, keeping track is your job.
  4. Buying back too soon. If you want to return to the original fund, count at least 31 days from the sale.

Year-end timing

To count for 2026, the sale has to happen in 2026. Publication 550 is clear that the trade date is what matters, not the settlement date: its own example is a sale on December 31 that settles in January and still goes on that year’s return.

  • December 31, 2026, is a Thursday, and it’s the last trading day of the year.
  • ETFs trade during market hours, so sell before the close.
  • Mutual fund orders are priced once a day, at the close. An order entered after the 4 p.m. Eastern close is generally processed on the next business day, which would be Monday, January 4, 2027. Don’t leave it to the last afternoon.

Two more timing notes:

  • Short-term or long-term matters. A loss on shares held one year or less is short-term; more than a year, long-term. Short-term losses first offset short-term gains, which are taxed at your ordinary income rate, so they can be the more valuable kind.
  • A mutual fund special case. If you held mutual fund shares for six months or less and received a capital gains distribution from them, Publication 550 says the loss is “treated as a long-term capital loss up to the total of any capital gain distributions you received.”

A short checklist before you harvest

  1. Confirm it’s a taxable account. No harvesting in an IRA or 401(k).
  2. Look up the loss per lot. Your broker shows the cost basis of each purchase. Selling only the lots that are down can produce a bigger loss.
  3. Turn off dividend reinvestment and automatic purchases in the fund you’re selling, in every account you and your spouse own.
  4. Pick a replacement that follows a different index, at a similar cost.
  5. Sell and buy the replacement on the same day, so you’re not out of the market.
  6. Mark the calendar 31 days out if you plan to switch back.
  7. Keep records. You’ll report the sale on Form 8949 and Schedule D, and your broker’s Form 1099-B will show the proceeds and basis.

Common questions

Is tax-loss harvesting worth it for a small loss? It depends on your tax rate. A $500 loss saves $110 at a 22% rate. Transaction costs on index funds and ETFs at the big brokers are often zero, so even small harvests can be worth doing, as long as you don’t trigger a wash sale.

Can I harvest a loss and buy the same fund back in January? Only if January falls more than 30 days after the sale. A sale on December 31 means waiting until early February.

Does harvesting change my investment plan? It shouldn’t. The idea is to swap one broad index fund for a very similar one and keep the same mix of stocks and bonds. If the replacement would leave you with a different kind of investment than you want, it’s not a good swap.

Should I sell an index fund just before a capital gains distribution? A distribution is taxable even if you reinvest it. If a mutual fund you were going to harvest anyway is about to pay a large distribution, selling before the ex-dividend date avoids it. Our guide to capital gains distributions explains how to find the dates.

The bottom line

Tax-loss harvesting turns an investment that’s down into a tax deduction while keeping your money invested. With index funds, the method is simple: sell the fund that’s at a loss, buy a similar fund that follows a different index, and stay out of the original for at least 31 days. The trap is the wash-sale rule, which covers your IRA, your spouse’s accounts and automatic purchases, and which no broker tracks for you across accounts.

Most of the time harvesting postpones tax rather than eliminating it, and the IRS hasn’t said exactly where “substantially identical” begins for index funds. If you have large losses, many accounts or an unusual situation, it’s worth checking with a tax professional before December 31.

This article is general information, not tax or investment advice. See our Financial Disclaimer.

Sources and data notes

  • IRS, Publication 550, Investment Income and Expenses (2025): wash sales, substantially identical securities, the $3,000 limit on capital loss deductions, capital loss carryovers, trade date vs settlement date, and losses on mutual fund shares held six months or less.
  • IRS, Revenue Ruling 2008-5, Internal Revenue Bulletin 2008-3: wash sales when the replacement is bought in an IRA or Roth IRA.
  • IRS, Instructions for Form 1099-B (2026): box 1g, when brokers must report a wash sale.
  • IRS, Revenue Procedure 2025-32: 2026 long-term capital gains rate brackets.
  • IRS, Topic 559, Net Investment Income Tax.
  • Fund prospectuses as filed with the SEC on EDGAR: Fidelity Total Market Index Fund (April 29, 2026); Fidelity 500 Index Fund (April 2026); Schwab S&P 500 Index Fund and Schwab Total Stock Market Index Fund (February 26, 2026); Vanguard 500 Index Fund and Vanguard Total Stock Market Index Fund (April 28, 2026; the latter renamed Vanguard Morningstar Total Stock Market Index Fund by a supplement effective July 29, 2026); iShares Core S&P 500 ETF and iShares Core S&P Total U.S. Stock Market ETF (2025-2026).
  • The count of 32 S&P 500 index funds comes from our analysis of SEC Form N-CEN and prospectus data; see our Editorial Methodology. The dollar example is our own illustration.

Sources checked on October 19, 2026.

Scroll to Top