Understanding the Wash Sale Rule: What to Avoid When Selling Investments at a Loss

Have a loss on an investment? Beware the wash sale rule, which could prevent you from deducting the loss on your taxes.

by Stephen Sylvester
updated June 13, 2022 ·  3min read

Internal Revenue Code Section 1091 denies a tax deduction for wash sale losses. Understanding how wash sale rules work will help you avoid losing the deduction when selling investments at a loss.

A woman studies the rule of wash sales on her laptop computer. Understanding how wash sale rules work will help you avoid losing the deduction when selling investments at a loss.

What Is a Wash Sale?

A wash sale occurs when a taxpayer sells a security at a loss and buys a substantially identical security within thirty calendar days before or after the sale. The 30-day rule applies even if the sale and purchase occur in different years—a sale on December 31 and repurchase on January 1 still counts as a wash sale.

Securities include stocks, bonds, exchange-traded funds, mutual funds, and derivatives of securities such as stock options. Sales of cryptocurrencies are a grey area because the IRS has not included cryptocurrencies in wash sale rules as of the date of this article.

Substantially identical also lacks a comprehensive definition. Publication 550 expresses the IRS's unofficial opinion that securities of different corporations generally don't meet the substantially identical test. Selling Walmart stock and immediately buying Target stock probably won't cause a wash sale despite the similarities between the companies.

The IRS also believes that different types of securities from the same company usually won't trigger a wash sale. However, securities that convert into a substantially identical security—most commonly stock options—will cause a wash sale. Wash sale rules probably don't apply to selling Walmart common stock and immediately buying a Walmart nonconvertible bond. Purchasing Walmart stock options instead of a bond constitutes a wash sale because stock options can convert into common stock.

Applying Wash Sale Rules

You usually recognize capital gain or loss on the sale of securities in the year you sell them. However, you can't deduct losses on a wash sale. The basis of the security bought gets increased by the amount of the wash sale loss disallowed, so you'll get the tax benefit of the loss eventually. The holding period of the security bought includes the holding period of the security sold.

For example, suppose you bought 1,000 shares of ABC stock five years ago at $5 per share. Your cost basis in those shares equals $5,000. On April 15 of this year, you sell all 1,000 shares at $3 per share for a total of $3,000. The sale price of $3,000 minus your basis of $5,000 results in a long-term capital loss of $2,000 that you deduct on this year's tax return.

However, if you repurchase 1,000 shares of ABC stock for $3 per share on April 20, you have a wash sale and cannot deduct the $2,000 capital loss. Your basis in the shares you repurchased still equals $5,000—that's $3,000 from the price you paid to repurchase and $2,000 from the deduction denied due to the wash sale. When you sell the stock again, you'll have a long-term capital gain or loss because the holding period of the repurchased stock includes the original stock's holding period.

How to Avoid Having a Wash Sale Loss Disallowed

While wash sales are legal, most people want to avoid them to take the loss in the current year.

A partial workaround exists if you want to take a deduction for your capital loss and want to stay invested in the security. You can sell the original security and buy one in a similar but not identical company. For example, selling Uber stock at a loss and buying Lyft instead would allow you to deduct your loss while staying invested in the rideshare industry.

Spouses count as a single taxpayer for the wash sale rule, so you can't sell stock and have your spouse repurchase it to avoid a wash sale. The same rule applies to your retirement accounts like Individual Retirement Accounts (IRAs) and Roth IRAs, per IRS Revenue Ruling 2008-5. It also doesn't matter whether you hold the securities in different accounts or even a different brokerage.

Automatic dividend reinvestments can unexpectedly trigger the wash sale rule for mutual funds. To avoid a wash sale, make sure to disable this feature 30 days before and after selling mutual funds at a loss.

Knowing how wash sale rules work allows you to avoid unintentionally losing a capital loss deduction.

Form your business with LegalZoom to access LegalZoom Tax services. LEARN MORE
Stephen Sylvester

About the Author

Stephen Sylvester

Stephen Sylvester, CPA helps CPA and finance firms turn expertise into new clients. By transforming esoteric technical i… Read more

This portion of the site is for informational purposes only. The content is not legal advice. The statements and opinions are the expression of the author, not LegalZoom, and have not been evaluated by LegalZoom for accuracy, completeness, or changes in the law.