How the Wash Sale Rule Works

How the Wash Sale Rule Works: Cost Basis & 30-Day Rules

Learn how the wash sale rule works, how the 61-day window adjusts your cost basis, and how to stay compliant. Read the full guide.

By Trader Faculty Team

Direct Answer

The wash sale rule is an IRS regulation that disallows claiming a tax loss if you buy a substantially identical security within 30 days before or after selling at a loss. Instead of eliminating the tax deduction entirely, the disallowed loss is added to the cost basis of the newly purchased shares, deferring the tax benefit until the replacement position is sold.

A wash sale rule is an IRS regulation that disallows claiming a tax loss when you buy a substantially identical security within 30 days before or after selling at a loss.

Active swing and day traders often harvest losses to offset capital gains, only to realize at tax time that frequent re-entry triggered disallowed losses.

Understanding the timeline and cost basis mechanics can help you avoid unexpected tax liabilities while you maintain your trading strategy.

Quick Takeaways

  • The wash sale rule covers a 61-day total window: 30 days before the loss sale, the day of the sale, and 30 days after.
  • Disallowed losses are not permanently lost; the IRS adds the loss to the cost basis of the replacement position, deferring the tax benefit.
  • Executing a wash sale in a Roth or Traditional IRA permanently destroys the tax loss deduction because IRAs do not adjust cost basis.
  • The rule applies across all accounts you or your spouse own, regardless of whether you use different brokerages.

What Is the Wash Sale Rule?

The wash sale rule is defined under Internal Revenue Code (IRC) Section 1091 to prevent investors from creating artificial tax deductions.

Without this rule, a trader holding a losing position could sell the asset on December 31 to claim a capital loss deduction and immediately buy it back on January 1. The IRS considers this transaction an attempt to harvest a tax write-off without changing actual market exposure.

How the 61-Day Wash Sale Window Works

The wash sale timeline spans 61 consecutive days, centered on the exact date of your loss transaction:

  1. 30 Days Before the Sale: Purchasing replacement shares within this window triggers the rule if you later sell original shares at a loss.
  2. The Day of the Sale: Selling at a loss and repurchasing replacement shares on the same trading day triggers a wash sale.
  3. 30 Days After the Sale: Buying replacement shares within 30 calendar days post-sale disallows the loss.

If a stop limit order you placed fills a replacement purchase within this period, the wash sale rule applies once that purchase executes.

What Happens When You Trigger a Wash Sale?

Triggering a wash sale does not mean your tax loss vanishes forever. Instead, the IRS defers the loss by adjusting the cost basis of your new shares and carrying forward your original holding period.

Step-by-Step Cost Basis Adjustment Example

Suppose you buy 100 shares of Stock XYZ at $50 and sell them later for $40, realizing a $1,000 loss ($10 per share).

  1. Original Purchase: 100 shares @ $50 = $5,000 cost basis.
  2. Loss Sale: 100 shares sold @ $40 = $1,000 realized loss.
  3. Repurchase (15 days later): 100 shares bought @ $42.

Because the repurchase occurred within 30 days, the $1,000 loss is disallowed for the current tax period. The disallowed $10-per-share loss is added directly to the entry price of your replacement stock:

Adjusted Cost Basis = Repurchase Price ($42) + Disallowed Loss per Share ($10) = $52 per share

When you eventually sell the replacement shares at $60, your capital gain is calculated using the $52 adjusted cost basis ($8 per share gain instead of $18), realizing the deferred tax benefit.

Special Cases: IRAs, Options, and Substantially Identical Assets

The IRA Wash Sale Trap

Selling shares at a loss in a taxable brokerage account and repurchasing them inside an IRA (Roth or Traditional) within 30 days creates an unrecoverable loss. IRAs do not track cost basis adjustments for individual holdings; therefore, the disallowed tax loss is permanently destroyed.

Substantially Identical Securities

The IRS applies wash sale rules to "substantially identical" assets. Buying stock in a direct competitor (for example, selling Ford to buy GM) generally doesn't trigger the rule, but the following scenarios can:

  • Selling a stock at a loss and buying a call option on the same stock, because the rule also covers any contract or option to buy a substantially identical security.
  • Selling an index ETF at a loss and buying another ETF that tracks the same index. The IRS hasn't issued clear guidance on ETFs from different issuers, so check with a tax professional before relying on this swap.

Common Wash Sale Mistakes Traders Make

  • Assuming Multi-Broker Accounts Are Hidden: Brokerages report activity via Form 1099-B Box 1g. Even if Broker A does not auto-adjust a wash sale triggered by a buy on Broker B, IRS matching algorithms require you to report cross-account wash sales accurately on Form 8949.
  • Doubling Down Before Cutting Losses: Buying additional shares to average down 15 days before closing your original losing position triggers a wash sale on the original lot.
  • Year-End Harvesting Oversights: Selling a losing asset on December 28 for a year-end tax deduction and repurchasing it on January 10 disallows the loss for the completed tax year.

Conclusion

Understanding the wash sale rule can help you manage capital losses more effectively and reduce the risk of unexpected tax adjustments at year-end. By tracking the 61-day window and accounting for cost basis roll-forwards, active market participants can execute their strategies cleanly.

To learn more about structuring entries, risk management, and fundamental trade execution rules, read our complete guide on how to start trading.

Frequently Asked Questions

What triggers a wash sale rule violation?

A wash sale is triggered when you sell a stock or security at a loss and buy a substantially identical security within 30 days before or after that sale. It also applies if you acquire replacement shares through an IRA or spouse account.

Does a wash sale mean you permanently lose the tax deduction?

No. In taxable brokerage accounts, the disallowed loss is added to the cost basis of your replacement shares. This defers the tax deduction until you eventually sell the new shares without repurchasing them again within the 30-day window.

What happens if you trigger a wash sale in an IRA?

If you sell a stock at a loss in a taxable account and repurchase it inside an IRA within 30 days, the tax loss is permanently lost. IRAs do not allow cost basis adjustments to carry forward tax deductions.

Does the wash sale rule apply to options trading?

Yes. The rule covers contracts or options to buy substantially identical securities, so selling a stock at a loss and buying a call option on the same stock within 30 days before or after the sale can trigger a wash sale.

How do brokerages report wash sales on tax forms?

Brokerages track wash sales occurring within the same account and report them on Form 1099-B in Box 1g. However, if you trigger a wash sale across multiple different brokerage accounts, you must manually adjust and report it on IRS Form 8949.

Keep learning

Trading 101

Know the mechanics cold before you risk a single cent.

8 lessons quiz

Start Trading 101
TF
Trader Faculty Team

The Trader Faculty Team writes and reviews every guide together — pairing hands-on market experience with a curriculum-first approach to trading education. One good syllabus, taught in the order that makes you better.