What is a wash-sale rule and how do I avoid an accidental IRS tax penalty?

The wash-sale rule is an IRS regulation that prevents you from claiming a tax loss on an investment if you buy that same or a substantially identical asset within 30 days before or after the sale. If you break this rule, the IRS denies your tax deduction, which can increase your tax bill.

The mechanics of the wash-sale rule

The purpose of this rule is to stop investors from selling stocks just to claim a tax benefit while keeping the exact same market position. Without this rule, you could sell a stock at a loss on December 31 to lower your taxes and immediately buy it back on January 1, effectively gaining a tax break without ever actually leaving the market.

When you trigger a wash sale, the IRS does not just throw away your loss. Instead, they force you to add that disallowed loss to the cost basis of your new, replacement shares. This essentially hides your loss until you sell the replacement shares later. While you eventually get the benefit of that loss, you lose the immediate tax deduction you were counting on for the current year.

This rule applies to all of your accounts as a single group. This includes your individual taxable brokerage accounts, your spouse’s accounts, and your retirement accounts like a traditional or Roth IRA. If you sell a fund for a loss in your taxable account and your spouse buys it in their IRA within the 61-day window, the IRS considers that a wash sale.

Step-by-step guide to avoiding penalties

You can harvest losses safely if you plan your trades to stay outside of the 61-day danger zone.

  • Audit your recent purchases. Before you sell a stock for a loss, check your transaction history for the past 30 days. If you bought that same stock in any of your accounts, you must wait until 31 days have passed since that purchase before selling for a loss.
  • Sell your losing position. Execute your trade to sell the shares you want to harvest for a loss.
  • Wait 31 days to buy back. To be completely safe, wait at least 31 full days after your sale before purchasing the same asset again.
  • Use a replacement asset. If you do not want to be out of the market for a month, buy a fund that is similar but not substantially identical. For example, if you sell an S&P 500 index fund, you could buy a Total Stock Market index fund. These track different sets of companies, so the IRS does not consider them the same asset.
  • Monitor your automatic reinvestments. If you have automatic dividend reinvestment turned on in your brokerage account, it might trigger a purchase of the stock you just sold for a loss. Turn off automatic reinvestment for the specific asset you are planning to sell before you initiate the trade.

The common mistake to avoid

The biggest mistake is assuming that “similar” funds are safe when they are actually “substantially identical” in the eyes of the IRS. While the IRS does not provide a perfect list of what counts as identical, they are very strict about index funds.

If you sell an iShares S&P 500 ETF and immediately buy a Vanguard S&P 500 ETF, the IRS will almost certainly view those as substantially identical because they track the exact same index. Most investors make this mistake because they focus on the brand name rather than the index being tracked.

To stay out of trouble, always look at the index provider. If you sell a fund tracking the S&P 500, replace it with a fund tracking a different index, such as the Russell 1000 or the MSCI USA Index. By moving to a different index, you maintain your market exposure while clearly distinguishing your new purchase from the original position.

Leave a Reply