Wash-Sale Rule: A Capital Gains Tax Pitfall

Selling assets at a loss can be beneficial from a tax perspective, but be careful to avoid the wash-sale rule.
Andy Rosen
Connor Emmert
By Connor Emmert and  Andy Rosen 
Updated
Edited by Chris Hutchison

Many or all of the products featured here are from our partners who compensate us. This influences which products we write about and where and how the product appears on a page. However, this does not influence our evaluations. Our opinions are our own. Here is a list of our partners and here's how we make money.


The investing information provided on this page is for educational purposes only. NerdWallet, Inc. does not offer advisory or brokerage services, nor does it recommend or advise investors to buy or sell particular stocks, securities or other investments.

Nerdy takeaways
  • The wash-sale rule prevents you from deducting losses from transactions that are quickly reversed.

  • While securities are subject to the wash-sale rule, cryptocurrency is not — for now.

  • You may be able to avoid a wash sale by buying an ETF covering the industry you're interested in.

What is the wash-sale rule?

The wash-sale rule is a tax requirement that prevents investors from selling assets at a loss, and buying them back in order to pocket a quick tax write-off.

The U.S. Internal Revenue Service defines a wash sale as a set of transactions in which you sell a security in a taxable account and repurchase the same or a “substantially identical” security within 30 days before or after the sale.

U.S. Internal Revenue Service. 2022 Publication 550 (Page 56). Accessed Jun 29, 2023.

Wash-sale rules cover stocks, bonds, mutual funds, exchange-traded funds, and options sold in a taxable account.

The IRS will consider transactions a wash sale if you repurchase the security in a different account, including an IRA or Roth IRA — even if the other account is in your spouse’s name.

AD
Zoe Financial
Hire a Pro: See your Top 3 Matches
Get matched with fiduciaries, financial advisors and financial planners who will work with you to achieve your wealth goals. Book your free consultation today.
Find A Financial Advisor

via Zoe Financial

Paid non-client promotion

Wash sales and capital gains

In order to understand the wash-sale rule, it helps to understand the basics of capital gains taxes and the strategies investors can (and can't) use to manage them.

When you sell an investment for more than you paid for it, that's called a capital gain. Capital gains are income for tax purposes. The rate depends on your overall income and how long you held the investment.

If you want to reduce your tax liability (and hey, who doesnt?), you can tally up both your investment gains and losses, then use those losses to offset the gains. This is called tax-loss harvesting.

If you don’t have any realized capital gains, you’re allowed to use up to $3,000 of losses per year to offset taxable income, thus reducing your taxes.

One of the few upsides of owning an investment that has lost money is that if you sell it for a loss, you can take advantage of a tax benefit.

The wash-sale rule keeps investors from selling assets at a loss for the sole purpose of those tax benefits. If the wash-sale rule did not exist, you could hypothetically sell assets any time they lost money and repurchase them the same day to capture capital losses without ever losing exposure to that investment.

The idea is that by buying and selling so quickly, your investment is basically a "wash," and so the losses from the one transaction don't truly reflect the state of your portfolio.

Wash-sale consequences

Let's be clear, quick stock trades are allowed. There's nothing preventing you from selling a stock, deciding you made a mistake, and buying it again a few days later. It just means you can't use the loss to get a tax benefit.

If you’re involved in a transaction that is identified as a wash sale, any disallowed loss will be added to your cost basis for the new security. You'll see how this works in the example below.

Wash sale example

Say you purchased 20 shares of XYZ stock two years ago for $50 per share ($1,000 total).

Fast-forward to today, and the price of XYZ has dipped to $10 per share, meaning that your total holding has dropped from $1,000 to $200. In an effort to reduce your capital gains taxes this year, you sell all 20 shares of XYZ and realize an $800 loss.

At the end of the year, you’d be able to apply your $800 capital loss to offset any capital gains you made elsewhere in your portfolio over the course of the year and reduce your tax bill.

Now, say that two weeks after selling your shares, you check the price of XYZ and see that it has jumped back up to $20 per share, and you decide to buy back 20 shares for $400. Because you purchased substantially identical shares — it's the same company — within 30 days of the sale, this would be considered a wash sale, and you would not be able to use your $800 capital loss to reduce your capital gains taxes for the year.

Because your $800 loss is disallowed due to a wash sale, the disallowed loss is then added to the price of your new shares to determine your cost basis for the new shares. In short: $400 + $800 = $1,200.

🤓Nerdy Tip

A higher cost-basis may wind up saving you on taxes later. If you make a profit, the taxable gain will be smaller. And if you have a loss down the road, it could wind up netting you a larger deduction.

What makes wash-sale investments 'substantially identical'?

The IRS's language surrounding wash sales can be a bit tricky.

What does “substantially identical” mean? Generally speaking, stocks or securities of one company are not considered substantially identical to stocks or securities of a separate company, even if they operate in the same sector. However, there are a few exceptions. If two companies merge as part of a reorganization, stock from the old and new company may be considered substantially identical.

Likewise, preferred stock shares are typically not considered substantially identical to common stock shares of the same company. However, if the preferred stock is convertible to shares of common stock in the same company, there are some cases where the preferred and common stock would be considered substantially identical.

While the wash-sale rules for individual stocks are fairly straightforward, things get a little more complicated with pooled investment securities like mutual funds or exchange-traded funds. The complexity lies in the nature of a pooled investment itself (each fund can hold hundreds of individual stock companies), as well as in the lack of specific IRS guidance.

Still, in many cases, it would be difficult to argue that two mutual funds could be considered “substantially identical” enough to trigger a wash sale. Each will have a fund manager actively choosing what is bought and sold within the fund, which could provide enough variation to avoid the two funds being considered substantially identical.

ETFs are slightly different in that most are passively managed investment vehicles. Instead of having a fund manager make portfolio decisions, ETFs generally track a market index such as the S&P 500 or Russell 1000. Two ETFs tracking the same market index will have very similar compositions, so it can be difficult to determine whether they would be considered substantially identical and in violation of the wash-sale rules. Again, the IRS guidance here lacks specifics

.

How to avoid a wash sale

If you decide to harvest some losses in your portfolio by selling individual stocks, you’re safe from triggering a wash sale as long as you don’t purchase the same exact stock shares within 30 days before or after the realized loss. So what should you do if you want to lock in some losses, but you don’t want to wait 30 days to reinvest?

One way to maintain some exposure after selling a company's stock is to purchase an ETF in a similar market sector. That way, if the whole sector bounces back, you’ll be able to take advantage of some market movement while still hanging on to your capital loss.

For example, say you own stock in a large technology company that hasn’t performed well this year. You’d like to harvest some losses, but you’d like to maintain your portfolio’s exposure to the technology sector without having to wait 30 days to repurchase your stock. In that case, you could purchase an ETF or mutual fund that's focused on large technology companies. This would allow you to maintain your exposure without creating a wash sale.

Depending on your broker, ETFs from different issuers that track the same market index may or may not be considered similar enough to be "substantially identical" and trigger a wash sale. One way to try to steer clear of triggering a wash sale would be to pair funds with similar exposures that track different indexes. If you sold an S&P 500-indexed ETF to realize losses, purchasing an ETF that tracks the Dow Jones or Russell 1000 would maintain your market exposure while decreasing the chances that you trigger a wash sale.

Because of the IRS’s nonspecific use of "substantially identical" and the gray areas around mutual funds and ETFs, consider talking with a financial advisor or tax advisor before harvesting any losses in order to avoid a costly mistake.

Track your finances all in one place
Find ways to save more by tracking your income and net worth on NerdWallet.

Is cryptocurrency subject to the wash-sale rule?

The wash-sale rule does not apply to cryptocurrency. However, the rules around digital assets are unsettled, so it helps to be on the lookout for regulatory changes

.

While the IRS considers crypto to be property, and therefore subject to capital gains taxes, it is not broadly considered a security.

That definition is being hotly debated in courts and among legislators, but for now crypto is not treated the same way as stocks and other securities from a wash-sale perspective.

Get more smart money moves – straight to your inbox
Sign up and we’ll send you Nerdy articles about the money topics that matter most to you along with other ways to help you get more from your money.