But you can negate the benefits of a capital loss if you aren’t careful. You’ll delay your ability to deduct your capital losses and you could lose out on the deduction forever if you violate the “wash sale rule.”

The Wash Sale Rule Defined

A wash sale consists of two transactions. The first occurs when a trader closes a position at a loss. You might have bought a stock for $10, then you later sold it for $5. You have a capital loss of $5. That $5 capital loss is tax-deductible, but a second transaction can erase the tax benefits of the loss if it occurs within 30 days of the first transaction and it’s any one of four transactions:

Buying substantially identical stock or securitiesAcquiring substantially identical stock or securities in a fully taxable tradeAcquiring a contract or option to purchase substantially identical stock or securitiesAcquiring a substantially identical stock for your IRA or Roth IRA

The wash sale rule can also be triggered if you sell an investment at a loss and your spouse or a corporation controlled by you buys the same investment within 30 days. The time period isn’t confined to a calendar year. You can’t sell on December 15 and expect that the wash sale period will terminate in 16 days when a new year begins.

What Is a Substantially Identical Security?

Unfortunately, tax law doesn’t clearly define what makes one security “substantially identical” to another. The IRS simply states: It’s easy to tell that a security is substantially identical when you’re dealing with the same stock, mutual fund, or bond. They’re obviously substantially identical securities if you sold XYZ stock and bought XYZ stock. It’s a bit harder to identify when two investment securities are similar, but not entirely identical. For example, two passively managed index mutual funds based on the same underlying market index can be substantially identical to each other. Selling a single company’s stock, then buying an index fund that includes that stock wouldn’t violate the wash rule, however.

Example of a Wash Sale

Let’s say that you have a taxable brokerage account that holds 50 shares of XYZ stock. Your cost basis in the stock is $500 because you bought it at $10 per share. The stock is worth only $5 per share on July 31, and you sell all 50 shares for a total of $250. The trade produced a capital loss of $250 because you paid $500 for the shares and earned only $250 from selling them. Now let’s say that you purchase new shares in XYZ on August 15. The transaction falls within 30 days of July 31, so the wash sale rule is triggered. This has two ramifications. First, the capital loss from the July 31 sale is deferred. Second, your cost basis on your new XYZ position is adjusted.

Deferred Loss and Adjusted Cost Basis

The amount of an investor’s loss is added to the cost basis of the replacement investment when the wash sale rule is triggered. This defers the loss until a later date when the replacement investment is eventually sold off. You sold 50 shares of XYZ stock for $5 per share for $250 total on July 31, incurring a $250 loss, then you purchased 50 shares of XYZ stock on August 15 for $6 per share, or $300 total. August 15 is within the 61-day wash sale period, so your $250 loss on July 31 was a wash sale, and your loss is added to the cost basis of your new investment. Your adjusted basis in the replacement shares is now $550—$300 from your August 15 purchase combined with your $250 loss from the July 31 sale. Your loss is a “wash” in this scenario, just as though you had held your original shares without selling. The tax benefit of your capital loss isn’t gone forever, but it’s deferred. The loss on the original investment will be taken into account when you sell your replacement shares by applying the losses to your adjusted cost basis.

When Wash Sales Can Be Beneficial

It’s usually best to avoid wash sales, but there are situations in which an investor might purposefully trigger the wash sale rule. It could bump you into a lower tax bracket if your income was lower than usual, and you might find that your capital gains will therefore be taxed at the long-term 0% tax rate that year. There’s no point in offsetting your capital gains by applying the tax benefits from your capital losses in this case. You might then decide to purchase the same or substantially identical securities to defer the loss to another year when it might be more beneficial to you. 

Reporting Wash Sales on Form 8949

All investment sales are reported on Form 8949, then summarized on Schedule D. The IRS requires that the transaction be identified with code “W” in column (f), and the loss adjustment must be reported in column (g). Brokers should report wash sales to the IRS on Form 1099-B and provide a copy of the form to the investor, but they’re only required to do so per account based on identical positions. This means that transactions can—and often do—fall through the cracks. The wash sale rule applies to any and all transactions, even through separate accounts, so you’ll want to keep your own accurate records.