Skip to main content
Loading...

Wash Sale Rules Explained

Understand the IRS wash sale rule, the 30-day window, how disallowed losses affect your cost basis, and how to harvest tax losses without triggering a wash sale. Essential knowledge for any investor using tax-loss harvesting strategies.

What Is a Wash Sale?

A wash sale occurs when you sell a security at a loss and then purchase the same or a substantially identical security within 30 days before or after the sale. When the IRS identifies a wash sale, the loss you realized on the original sale is disallowed for tax purposes. You cannot use that loss to offset capital gains or reduce your taxable income in the current tax year.

The wash sale rule exists to prevent investors from claiming artificial tax losses while maintaining essentially the same investment position. Without this rule, investors could sell a stock at a loss on December 31 to claim the tax deduction, then buy the same stock back on January 2, effectively getting a tax benefit without actually changing their portfolio. The IRS considers this an abuse of the tax code because the investor never truly exited the position.

The wash sale rule is codified in Section 1091 of the Internal Revenue Code and applies to stocks, bonds, mutual funds, ETFs, options, and other securities. Understanding this rule is critical for anyone who practices tax-loss harvesting or actively manages a taxable investment account.

The 30-Day Window Rule

The wash sale window extends 30 calendar days before and 30 calendar days after the date of the sale, creating a total 61-day window (30 days before + the sale date + 30 days after). If you purchase a substantially identical security at any point within this 61-day window, the loss is disallowed.

This means the rule applies in both directions. You cannot buy first and sell later within 30 days to claim the loss, and you cannot sell first and buy back within 30 days. Here is how the window works in practice:

Event Date Result
Purchase replacement shares Day 1 through Day 30 Triggers wash sale if sold at loss on Day 31
Sell shares at a loss Day 31 (sale date) Loss may be disallowed
Repurchase same security Day 32 through Day 61 Triggers wash sale
Purchase after window closes Day 62 or later No wash sale, loss is allowed

Important: Calendar Days, Not Business Days

The 30-day window is measured in calendar days, not business days. Weekends and holidays count toward the 30 days. If you sell a stock at a loss on March 15, you must wait until April 15 (31 calendar days later) to repurchase the same or a substantially identical security without triggering a wash sale.

What Are Substantially Identical Securities?

The IRS does not provide a precise definition of substantially identical securities, which creates some gray areas. However, the following guidelines are well established:

Clearly Substantially Identical

  • Selling shares of a stock and buying back the same stock
  • Selling shares of a mutual fund and buying the same fund
  • Selling a stock and buying a call option on the same stock
  • Selling a stock and buying a contract to acquire the same stock

Generally NOT Substantially Identical

  • Selling an S&P 500 index fund from Vanguard and buying an S&P 500 index fund from Fidelity (same index, different fund, but this is a gray area some advisors avoid)
  • Selling a total US stock market fund and buying an S&P 500 fund (different indexes tracking different baskets of stocks)
  • Selling stock in one company and buying stock in a competitor in the same sector
  • Selling a bond and buying a different bond from a different issuer with different terms

The safest approach when tax-loss harvesting is to replace a sold security with one that tracks a different index or has a meaningfully different composition. For example, if you sell a total US stock market index fund at a loss, you could replace it with a large-cap value fund or a total international stock fund without triggering a wash sale.

Wash Sale Examples with Numbers

Understanding how wash sales affect your taxes requires working through concrete examples with actual dollar amounts.

Example 1: Basic Wash Sale

You purchased 100 shares of Company XYZ at $50 per share for a total investment of $5,000. The stock drops to $30, and you sell all 100 shares for $3,000, realizing a $2,000 loss. Ten days later, the stock drops further to $28, and you buy 100 shares again for $2,800.

Because you repurchased within 30 days, this is a wash sale. Your $2,000 loss is disallowed. You cannot deduct it on your current tax return. However, the disallowed loss is added to the cost basis of the new shares.

Example 2: Cost Basis Adjustment

Continuing from the example above, your new cost basis is calculated as follows:

Item Amount
Purchase price of new shares $2,800 (100 shares at $28)
Disallowed loss added to basis $2,000
Adjusted cost basis $4,800 ($48 per share)

The disallowed loss is not permanently lost. It is deferred by being added to the cost basis of the replacement shares. When you eventually sell the replacement shares (outside the wash sale window), the higher cost basis will result in a larger deductible loss or a smaller taxable gain. The loss is postponed, not eliminated.

Key Insight: Losses Are Deferred, Not Lost

A common misconception is that a wash sale means you permanently lose the tax benefit of your loss. In reality, the disallowed loss is added to the cost basis of the replacement shares. You will eventually realize the tax benefit when you sell the replacement shares, as long as you do not trigger another wash sale at that time. The economic impact is the time value of the delayed deduction.

Wash Sales Across Accounts: The IRA Trap

One of the most dangerous wash sale scenarios involves transactions across different accounts. The wash sale rule applies across all accounts you own, not just within a single account. This means that if you sell a stock at a loss in your taxable brokerage account and buy the same stock within 30 days in your IRA, you have triggered a wash sale.

The IRA wash sale is particularly damaging because when the replacement purchase occurs in an IRA, the disallowed loss cannot be added to the cost basis of the IRA shares (since IRA cost basis is generally irrelevant for tax purposes). This means the loss may be permanently disallowed rather than merely deferred. This is one of the few situations where a wash sale can result in a true and permanent loss of the tax benefit.

This scenario commonly occurs when investors sell at a loss in their taxable account while their IRA has automatic contributions or dividend reinvestments purchasing the same security. Carefully coordinate transactions across all your accounts to avoid this trap.

Wash Sales with Options

Options transactions can trigger wash sales in ways that are not always obvious. If you sell a stock at a loss and then purchase a call option on the same stock within the 30-day window, the IRS treats this as a wash sale because the call option gives you the right to acquire the same security. Similarly, selling a deep in-the-money put option can be treated as acquiring the underlying stock for wash sale purposes.

Writing (selling) covered calls on a stock you hold at a loss does not itself trigger a wash sale. However, if the call option is exercised and you are assigned, the resulting transaction may interact with wash sale rules in complex ways. Investors who trade options actively should consult a tax professional to understand how their specific transactions are affected.

How to Avoid Wash Sales

There are several legitimate strategies to harvest tax losses while avoiding wash sale violations:

1. Wait 31 Days

The simplest approach is to sell the losing position and wait at least 31 calendar days before repurchasing the same security. The risk is that the stock may recover during that period, and you miss the rebound. However, this is the cleanest way to ensure the loss is allowed.

2. Replace with a Similar but Not Identical Fund

Instead of repurchasing the same security, buy a similar investment that is not substantially identical. For example:

  • Sell a Vanguard Total Stock Market Index Fund and buy a Schwab Large Cap Fund
  • Sell shares in one energy company and buy shares in a different energy company
  • Sell a US bond fund and buy a different US bond fund with different duration or credit quality

This approach lets you maintain your desired asset allocation and market exposure while realizing the tax loss.

3. Double Up and Then Sell

Buy additional shares of the security 31 or more days before selling the original lot at a loss. This approach allows you to maintain your full position throughout the process, but it requires having the capital to hold double the position temporarily. The original shares are then sold after the 31-day window from the new purchase has passed.

4. Harvest Losses at Year-End Carefully

When harvesting losses in December for the current tax year, be mindful that the 30-day window extends into January of the following year. If you sell at a loss on December 15 and repurchase on January 5, you have triggered a wash sale. Plan your December transactions to allow the full 31-day window to pass before repurchasing.

Wash Sale Reporting on Form 1099-B

Your brokerage firm is required to report wash sales that occur within the same account on Form 1099-B, which you receive after year-end. The form will show the disallowed loss in Box 1g and may adjust the cost basis of the replacement shares. However, brokerages are only required to track wash sales within a single account. They do not track wash sales across accounts at different firms or between taxable and retirement accounts.

This means you are responsible for identifying and reporting wash sales that occur across accounts. If you sell a stock at a loss at Fidelity and buy the same stock at Schwab within 30 days, neither brokerage will flag it as a wash sale, but you are still required to disallow the loss on your tax return. Failure to do so could result in penalties and interest if the IRS identifies the wash sale during an audit.

Common Wash Sale Misconceptions

Several myths about wash sales persist among investors. Understanding the truth can help you avoid costly mistakes:

  • Misconception: Wash sales only apply to stocks. Reality: The wash sale rule applies to stocks, bonds, mutual funds, ETFs, options, and any other securities.
  • Misconception: You lose the loss forever. Reality: In most cases, the disallowed loss is added to the cost basis of the replacement shares, deferring the benefit rather than eliminating it. The exception is the IRA trap described above.
  • Misconception: Different tax lots avoid wash sales. Reality: Selling specific tax lots of a stock and then buying back shares triggers a wash sale regardless of which lots you sold. The purchase is matched against the sale.
  • Misconception: Automatic dividend reinvestment does not count. Reality: If you sell a stock at a loss and a dividend reinvestment plan (DRIP) purchases shares of the same stock within 30 days, you have triggered a wash sale on at least a portion of the loss.
  • Misconception: The rule only applies to individual investors. Reality: Wash sale rules apply to individuals, trusts, and certain entities. However, they generally do not apply to corporations or dealers in securities.

Watch Out for Automatic Reinvestment

Many investors have automatic dividend reinvestment (DRIP) enabled on their brokerage accounts. If you sell a stock at a loss but the DRIP purchases shares of the same stock within 30 days, you may inadvertently trigger a wash sale. Consider temporarily disabling DRIP on positions you plan to sell for tax-loss harvesting purposes.

Wash Sales and Cryptocurrency

Historically, the wash sale rule did not apply to cryptocurrency because the IRS classified crypto as property rather than a security. This meant crypto investors could sell Bitcoin at a loss and immediately repurchase it without triggering a wash sale, a significant tax advantage. However, tax legislation has been evolving, and investors should stay current on whether the wash sale rule has been extended to cover digital assets. Consult a tax professional for the most current guidance on crypto wash sale treatment.

Tax-Loss Harvesting Without Triggering Wash Sales

Effective tax-loss harvesting requires a systematic approach that accounts for the wash sale rule. Here is a practical workflow:

  1. Identify positions with unrealized losses in your taxable accounts at regular intervals throughout the year, not just in December.
  2. Before selling, disable any DRIP on the positions you plan to harvest to prevent automatic reinvestment within the 30-day window.
  3. Sell the losing position and immediately purchase a replacement security that is similar but not substantially identical to maintain your asset allocation.
  4. Set a calendar reminder for 31 days after the sale. After 31 days have passed, you can sell the replacement and repurchase the original security if you prefer it.
  5. Document all transactions across all accounts to ensure you are properly tracking wash sales that your brokerage may not flag.
  6. Coordinate across accounts to ensure no IRA or 401(k) contributions purchase the same security within the wash sale window.

Frequently Asked Questions About Wash Sale Rules

No, the wash sale rule only applies to losses. If you sell a security at a gain and repurchase it within 30 days, the gain is fully taxable regardless. The rule was specifically designed to prevent investors from claiming artificial losses, so it has no effect on profitable transactions. You can sell a stock at a gain, pay the capital gains tax, and immediately repurchase the same stock without any wash sale implications.

Yes, if you file jointly, the wash sale rule applies across your account and your spouse's account. If you sell a stock at a loss in your individual account and your spouse purchases the same stock in their account within 30 days, it triggers a wash sale. This is an area where many couples inadvertently violate the rule, especially when both spouses have automatic investment plans or dividend reinvestment programs running on similar securities. Coordination between both partners' accounts is essential.

The IRS does not provide a precise definition, but substantially identical generally means the same security or one that is so similar that owning it is economically equivalent to owning the original. Buying back the exact same stock or fund is clearly substantially identical. Buying shares of a different company in the same sector, or a fund tracking a different index, is generally not substantially identical. A gray area exists with index funds from different providers that track the same index. The safest approach is to switch to a fund tracking a different but similar index when harvesting losses.

Historically, the wash sale rule did not apply to cryptocurrency because the IRS classified digital assets as property rather than securities. This allowed crypto investors to sell at a loss and immediately repurchase without triggering the rule. However, tax law in this area has been evolving with proposed legislation that could extend wash sale rules to digital assets. You should consult a tax professional for the most current treatment of crypto transactions, as the rules may have changed since this content was written.

When a wash sale is triggered, the disallowed loss is added to the cost basis of the replacement shares. For example, if you sold shares at a $1,000 loss that was disallowed and then bought replacement shares for $5,000, your adjusted cost basis for the replacement shares would be $6,000. This higher basis means that when you eventually sell the replacement shares, your taxable gain will be $1,000 less (or your deductible loss $1,000 more) than it otherwise would have been. The holding period of the original shares also carries over to the replacement shares.

Continue Learning

Explore related investment topics to expand your knowledge.

Pavlo Pyskunov

Written By

Pavlo Pyskunov

Reviewed for accuracy

Finance educator and founder of InvestmentBasic. Passionate about making investment education accessible to everyone, with a focus on practical, beginner-friendly content backed by data.

Start typing to search across all investment topics...

Request an AI summary of InvestmentBasic