Updated: Mar 15, 2024

Wash Sale Rule: How to Avoid an Inconvenient Tax Violation

Learn what trades are considered in violation of the wash-sale rule, which forbids you from exploiting tax benefits in securities transactions.
Today's Rates
Super boost your savings with highest rates.
Savings Accounts up to:
5.35% APY

It’s essential to understand the tax consequences of investing so that you can take advantage of opportunities to maximize your gains.

There are plenty of rules in the tax code that you could use to benefit.

One way people try to take advantage of an opportunity with investments is tax-loss harvesting. This strategy allows you to sell certain assets when they’re at a loss.

The result:

You get to take advantage of the tax benefit this allows.

After selling an investment at a loss, the general idea is you’ll reinvest the money in something else. This allows you to keep your wealth growing overall.

Sadly, the tax code is complicated.

There is a particular rule, called the wash sale rule, that could result in your loss being disallowed if you don’t follow certain guidelines.

Here’s what you need to know about the wash sale rule so you don’t inadvertently end up with a disallowed loss.

What Is The Wash Sale Rule?

The wash sale rule states you can’t deduct losses from stock or security trades or sales unless the loss happened in the ordinary course of business as a dealer in stock or securities.

According to the Internal Revenue Service (IRS), the wash sale rule applies when you’re selling or trading stocks or securities at a loss and doing one of the four following things within 30 days before or after the sale:

  • Buying substantially identical stock or securities
  • Acquiring substantially identical stock or securities in a fully taxable trade
  • Acquiring a contract or option to buy substantially identical stocks or securities
  • Acquiring substantially identical stock or securities for your individual retirement arrangement (IRA) or Roth IRA

If this sounds confusing, you aren’t alone.

Even so, it’s important to understand this rule because it can impact whether you’re allowed to take a loss or not.

Examples of a wash sale

Some wash sales are easier to identify than others.

Here are crystal clear examples of wash sales:

John decides to buy a share of common stock in Google on April 30th. He sells a share of Google at a loss on May 1st. John’s transactions meet the wash sale rule requirements and the loss is disallowed.

Zoey sells a share of Facebook on May 14th at a loss. She purchases an option to buy Facebook on the same day. Zoey’s investment moves would be considered a wash sale.

William sells 100 shares of Microsoft in a taxable investment account at a loss on December 1st. He then purchases 100 shares of Microsoft in his Roth IRA on December 26th. John’s actions result in his loss being disallowed due to the wash sale rules. 

"Substantially identical"

One key phrase in all four potential qualifications of a wash sale is substantially identical stock or security


The IRS doesn’t define what it means by substantially identical. This leaves a massive gray area depending on your interpretation of the phrase.

An identical security could be considered the same exact stock. There is no way you could sell Exxon stock for a loss, then buy Exxon stock within 30 days and avoid it being called a wash sale.

However, things get trickier when you start talking about other types of investments. 

What if you sold a Vanguard S&P 500 index fund for a loss and then immediately bought a Charles Schwabb S&P 500 index fund? 

These are different securities with different ticker symbols. Yet, they essentially own the same exact companies. Both are mutual funds, too.

You could take the argument a step further.

What if you sold a Vanguard S&P 500 index fund at a loss then bought a Charles Schwabb S&P 500 ETF? These still both own the same securities, but one is a mutual fund and one is an ETF.

Since the IRS hasn’t defined what a substantially identical stock and security is, you have to decide what is right for you.

Keep in mind:

The IRS can disallow these losses if you get audited and they consider the transactions substantially identical.

If you want to play it safer, some experts say you should consider selling a passive index fund investment and exchanging it for an actively managed option. 

Another option would be selling a security that tracks one index and buying another that tracks a different index.

Of course:

You could wait to make sure your buying and selling doesn’t fall within the 30-day period.

The risk in this scenario is that you miss out on major market moves during the time you’re not invested.

Why Does The Wash Sale Rule Exist?

The rule exists because the IRS doesn’t want people taking paper losses with virtually no risk to get tax benefits today.

The result defers taxes to the future. 

Without the wash sale rules, you could sell a security today at a loss then immediately rebuy it. You wouldn’t lose money if you immediately buy and sell the same asset.

This would give people tax benefits by reducing taxable income. You do have to use the capital losses to offset capital gains first. 

However, most people can typically use up to $3,000 in excess capital losses to offset ordinary income. Depending on your tax rate, this could be considerable savings.

The result is deferring taxes to the future and reducing tax collections today.

The wash sale rule makes it so you have to leave time between transactions or change what you invest in to claim the loss.

This discourages people from taking advantage of losses when they don’t intend to make moves for any reason other than tax reasons.

What Happens If I Have a Wash Sale?

If you end up having a wash sale, the loss on the sale of the investment cannot be taken.

That said:

The loss is not permanently disallowed.

In general, the loss is added to the cost basis of your new security when the wash sale occurs. This increase in the basis of the stock allows you to take advantage of the loss when you end up selling it down the road.

In addition to including the loss in the basis of the investment, you also get to add the holding period of the old security to the new security. This helps you by allowing you to keep the timing characteristics of your investment. 

For example, let’s say you owned the previous asset for more than a year. Adding the holding period allows you to consider future sales a long-term capital gain or capital loss within the first year. 

If you couldn’t add the prior holding period, you would have a short-term capital gain or loss by selling the new asset before a year passes.

Better recordkeeping required

While these rules let you take advantage of the loss in the future, it adds a lot of recordkeeping responsibilities. 

You must determine the loss and holding period on the previous sale. Then, you have to remember to add these to the new security. 

Finally, you must remember to take advantage of these benefits when you sell the new asset.

How to Avoid Violating The Wash Sale Rule

Avoiding a wash sale transaction isn’t tricky. It may not be ideal, though

Avoid the 30-day time window

The first way to do so is to make sure any transactions with substantially identical securities or stocks are spaced at least 31 days apart.

If they are, there is no way they can trigger the wash sale rule’s 30-day timing period. 

Make sure the actual trades take place 31 days or more apart. If you place an order but it doesn’t take place immediately, you could mess up your timing.

Avoid substantially identical securities or stocks

If you do decide to sell a security at a loss and purchase another investment in its place, make sure they are not substantially identical.

Due to the IRS’s lack of a definition of substantially identical, you’ll have to use your judgment.


The best way to do this is to take a conservative approach. Don’t exchange similar mutual funds or ETFs from different companies. Instead, switch to a different type of asset when you make the transactions.

Once the 30-day period from the sale expires, you can continue investing in the security you sold.

Consult a Professional

If you’re not sure if your investment trades would be considered a wash sale, consider consulting a professional for advice to see how the rule applies to your situation. 

Financial advisors or tax professionals should be able to guide you in the right direction. They both deal with the impacts of these trades with their clients.

These professionals may also be able to advise you on ways you can take losses while avoiding falling victim to the wash sale rules.