Wash-Sale Rule: What It Is, How It Works in 2025

Selling assets at a loss can be beneficial from a tax perspective, but be careful to avoid the wash-sale rule.

Many, or all, of the products featured on this page are from our advertising partners who compensate us when you take certain actions on our website or click to take an action on their website. 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.

Updated · 5 min read
Profile photo of Connor Emmert
Written by 
Writer
Profile photo of Chris Hutchison
Edited by 
Head of Content, New Verticals
Profile photo of Andy Rosen
Co-written by 
Lead Writer/Spokesperson
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 then immediately buying them back in order to pocket a quick tax write-off.

Stressed About Taxes or Bookkeeping?

Get matched with a vetted expert who will handle it for you.

Talk to an Expert

on Ledgerway's website

How does a wash sale work?

The IRS 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.

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.

The wash-sale rule keeps investors from selling assets at a loss for the sole purpose of getting 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.

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. If you sell an investment for less than you paid for it, that's called a capital loss.

Capital gains are income for tax purposes. The capital gains tax rate you pay on capital gains depends on your total taxable income, your tax-filing status and how long you held the investment.

  • One tax-reduction strategy is to tally your gains and losses, and then use the losses to offset the gains. This is called tax-loss harvesting.

  • If you have more losses than 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.

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).

Today, the price of XYZ dipped to $10 per share, meaning your holding dropped from $1,000 to $200. You sell all 20 shares of XYZ and realize an $800 loss.

At the end of the year, you apply your $800 loss against capital gains you made elsewhere in your portfolio during the year. This reduces your tax bill.

Now, two weeks after selling your shares, the price of XYZ rises to $20 per share. You decide to buy 20 shares for $400.

Because you purchased substantially identical shares (it's the same company) within 30 days of the sale, the IRS considers this a wash sale, which means you cannot apply your $800 capital loss against your capital gains taxes for the year.

Because your $800 loss is disallowed due to a wash sale, the disallowed loss is 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 tax deduction.

What makes wash-sale investments 'substantially identical'?

Generally speaking, stocks or securities of one company are not 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, stock from the old and new company may be considered substantially identical.

  • Shares of preferred stock are typically not considered substantially identical to shares of common stock 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 IRS would consider the preferred and common stock substantially identical.

Things get a more complicated with pooled investment securities such as mutual funds or exchange-traded funds. The complexity lies in the nature of a pooled investment itself (each fund can hold shares of hundreds of individual companies), as well as in the lack of specific IRS guidance.

  • Two mutual funds may or may not be considered “substantially identical” enough to trigger a wash sale. Each has a fund manager actively choosing what to buy and sell, which could provide enough variation to avoid being considered substantially identical.

  • ETFs are slightly different in that most are passively managed 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 are substantially identical and in violation of the wash-sale rules. Again, the IRS guidance here lacks specifics

    .

How to avoid a wash sale

There are a few ways to lock in some losses without waiting 30 days to reinvest.

Sell a stock and then buy an ETF

One way to maintain some exposure after selling a company's stock is to purchase an exchange-traded fund (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 exposure to the technology sector without waiting 30 days to repurchase your stock. In that case, you might purchase an ETF or mutual fund that's focused on large technology companies. This might allow you to maintain your exposure without creating a wash sale.

Invest in a different index

ETFs from different issuers that track the same market index may or may not be similar enough to be "substantially identical" and trigger a wash sale. One way to try to steer clear of a wash sale might be to pair funds with similar exposures that track different indexes. For example, if you sold an S&P 500-indexed ETF to realize losses, purchasing an ETF that tracks the Dow Jones or Russell 1000 could 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 in order to avoid a costly mistake before harvesting any losses.

Stressed About Taxes or Bookkeeping?

Get matched with a vetted expert who will handle it for you.

Talk to an Expert

on Ledgerway's website

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.

ON THIS PAGE

    ON THIS PAGE

      Nerdwallet advisors logo

      Get matched to a financial advisor for free with NerdWallet Advisors Match.

      Illustration
      Advertisement