Calcmatic

Wash Sale Calculator

Calculate the IRS wash sale rule impact on your stock losses. Determine disallowed losses, adjusted cost basis, and tax implications within the 61-day wash sale window.

Transaction Details

Original Purchase

$

Sale (at a Loss)

$

Repurchase Details

$
% (for scenarios)

Wash Sale Triggered

The IRS wash sale rule applies to this transaction.

Repurchased substantially identical securities 15 days after the sale, within the 61-day wash sale window

Your Transaction Timeline

11/2/19691/1/1970

You Sold

12/2/1969

Sold at a loss of $1,000

You Repurchased

12/17/1969

15 days after sale — inside the 30-day window

The wash sale window spans 30 days before through 30 days after your sale date

Tax Impact

Realized Loss

$0

Total loss from sale

Current Year Deduction

$0

Deductible in 2025

Disallowed Loss

$0

Deferred to cost basis

New Cost Basis

$0

Per share (100 shares)

Cost Basis Calculation

Original Repurchase Cost:$0
+ Disallowed Loss:+$0
New Total Cost Basis:$0

What This Means

Because you repurchased substantially identical securities within the 61-day wash sale window, the IRS wash sale rule applies:

  • Loss Deferral: Your $0 loss cannot be deducted this year. It's added to the cost basis of your repurchased shares.
  • Higher Cost Basis: Your new cost basis is $0 per share, which will reduce your gain (or increase your loss) when you eventually sell.
  • Not Lost Forever: The disallowed loss isn't forfeited—it's deferred until you sell the repurchased shares.

Future Sale Scenarios

Here's how your deferred loss will affect future sales:

Break Even Sale

Sell at the same price as repurchase

Future Sale Price:

$0

Total Gain/Loss:

$0

Recognized Loss:

$0

Net Tax Impact:

$0

10% Gain Sale

Sell at 10% above repurchase price

Future Sale Price:

$0

Total Gain/Loss:

$0

Recognized Loss:

$0

Net Tax Impact:

$0

10% Loss Sale

Sell at 10% below repurchase price

Future Sale Price:

$0

Total Gain/Loss:

$0

Recognized Loss:

$0

Net Tax Impact:

$0

Understanding the Wash Sale Rule

The wash sale rule is an IRS regulation (IRC Section 1091) that prevents taxpayers from claiming artificial losses by selling securities at a loss and immediately repurchasing them. If you sell a stock at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the loss is disallowed for tax purposes in the current year.

The 61-Day Wash Sale Window

The wash sale rule applies to a 61-day period: 30 days before the sale, the day of the sale, and 30 days after the sale. If you purchase substantially identical securities at any point during this window, the wash sale rule is triggered.

The 61-Day Danger Zone

30 days beforeSALE30 days after

The yellow bar represents the danger zone. If you buy the same stock anywhere in this 61-day period, your loss is disallowed.

What Are "Substantially Identical" Securities?

The IRS has not provided a precise definition, but substantially identical securities generally include:

  • The Same Stock: Selling and repurchasing shares of the same company (e.g., Apple Inc.) clearly triggers the rule.
  • Call Options: Selling stock and buying call options on the same stock can trigger a wash sale.
  • Contracts to Acquire: Any contract or option to acquire substantially identical stock counts.
  • Preferred vs Common: Preferred and common stock of the same company may be substantially identical if convertible.

What Is NOT Substantially Identical

  • Different Companies: Selling Apple and buying Microsoft is fine, even if they're in the same sector.
  • Similar ETFs: Selling VOO (Vanguard S&P 500 ETF) and buying SPY (SPDR S&P 500 ETF) is generally acceptable, though this remains a gray area.
  • Bonds vs Stocks: Corporate bonds and stock of the same company are not substantially identical.

How the Wash Sale Rule Affects Taxes

Adjusted Cost Basis = Repurchase Price + Disallowed Loss

Example: You buy 100 shares at $50 ($5,000 total), sell at $40 ($4,000), losing $1,000. Within 30 days, you repurchase 100 shares at $42 ($4,200). The $1,000 loss is disallowed and added to your new cost basis: $4,200 + $1,000 = $5,200 adjusted basis.

When you eventually sell the repurchased shares, your adjusted cost basis will be higher, which reduces your taxable gain or increases your deductible loss. The disallowed loss isn't lost—it's deferred.

Strategies to Avoid Wash Sales

1. Wait 31 Days

The simplest strategy: wait 31 days after selling before repurchasing the same security. This ensures you're outside the 61-day window and can claim the loss immediately.

2. Buy a Similar, Not Identical, Security

Sell one stock and immediately buy a different (but similar) stock to maintain market exposure. For example, sell an S&P 500 ETF and buy a total market ETF, or sell one tech stock and buy a different tech stock.

3. Double Up, Then Sell

Buy additional shares first, wait 31 days, then sell the original lot at a loss. This lets you maintain your position while avoiding a wash sale. Note: this requires more capital upfront.

4. Harvest Losses Early in the Year

If you want to repurchase the same security, harvest losses in January or February. This gives you the rest of the year to repurchase without worrying about the prior-year wash sale window.

Common Mistakes to Avoid

  • Ignoring IRA Purchases: Buying the same security in your IRA within 30 days of selling in your taxable account triggers a wash sale. The loss is permanently disallowed because you can't adjust the cost basis of IRA holdings.
  • Spouse's Account: If your spouse buys the same stock in their account within the window, it's still a wash sale. The rule applies to you and your spouse.
  • Automatic Dividend Reinvestment: If you have DRIP enabled and dividends automatically purchase shares within the wash sale window, this can trigger the rule.
  • Counting Only After the Sale: Many investors forget the rule applies 30 days BEFORE the sale as well. If you bought shares in the 30 days before selling at a loss, it's a wash sale.

Tax Loss Harvesting and Wash Sales

Tax loss harvesting is a strategy where investors deliberately sell securities at a loss to offset capital gains. The wash sale rule is specifically designed to prevent abuse of this strategy. To successfully harvest losses:

  1. Identify Losses: Review your portfolio for positions trading below your cost basis.
  2. Sell at a Loss: Execute the sale to realize the loss for tax purposes.
  3. Wait or Substitute: Either wait 31 days to repurchase, or immediately buy a similar (not identical) security.
  4. Document Everything: Keep detailed records of purchase dates, sale dates, and repurchase dates for tax reporting.

Advantages and Disadvantages

Advantages of Understanding the Rule

  • Maximize Tax Deductions: Properly timing sales and repurchases lets you claim losses immediately.
  • Avoid IRS Penalties: Correctly applying the rule prevents disallowed loss claims that could trigger audits or penalties.
  • Strategic Portfolio Management: Use the rule to your advantage with tax loss harvesting strategies.

Disadvantages of the Rule

  • Loss Deferral: If triggered, you can't deduct the loss in the current year, delaying tax benefits.
  • Complexity: Tracking purchases across multiple accounts (taxable, IRA, spouse's accounts) is complicated.
  • Market Timing Risk: Waiting 31 days to repurchase exposes you to market movements that could work against you.

Reporting Wash Sales on Your Tax Return

Your broker should report wash sales on Form 1099-B with a "W" code in Box 1f. The disallowed loss is shown in Box 1g. You must report this information on Schedule D (Capital Gains and Losses) and Form 8949 (Sales and Other Dispositions of Capital Assets).

Important: Brokers only track wash sales within the same account. If you have multiple accounts (different brokers, IRA accounts, etc.), you're responsible for identifying and reporting wash sales across accounts yourself.

Frequently Asked Questions

Does the wash sale rule apply to gains?

No, the wash sale rule only applies to losses. If you sell a security for a gain and immediately repurchase it, there's no wash sale issue. The gain is fully taxable.

Can I trigger a wash sale by selling in December and buying in January?

Yes. The 61-day window spans across tax years. If you sell on December 15 and repurchase on January 10, that's only 26 days—the wash sale rule applies, and you can't claim the loss on your prior year's return.

What if I only repurchase some of the shares I sold?

The wash sale rule applies proportionally. If you sell 100 shares at a $1,000 loss and repurchase only 50 shares within 30 days, half the loss ($500) is disallowed and added to the cost basis of the 50 repurchased shares. The other $500 loss is allowed.

Does the wash sale rule apply to crypto?

As of 2025, the wash sale rule does NOT apply to cryptocurrency because the IRS treats crypto as property, not securities. However, proposed legislation could change this—consult a tax professional for current guidance.

What if I forget about the wash sale rule?

If you incorrectly claim a disallowed loss, the IRS may adjust your return and disallow the deduction, potentially assessing penalties and interest. Keep detailed records and work with a tax professional if you're unsure.

Can I avoid the rule by selling in one account and buying in another?

No. The wash sale rule applies to all accounts you control, including taxable brokerage accounts, IRAs, 401(k)s, and your spouse's accounts. Buying in a different account within the 61-day window still triggers the rule.

Plan Your Trades Carefully

Use this calculator before executing tax loss harvesting trades to ensure you don't accidentally trigger the wash sale rule. By understanding the 61-day window and planning your transactions strategically, you can maximize your tax deductions and avoid costly mistakes. Always consult with a qualified tax advisor for personalized guidance.

Additional Frequently Asked Questions

What exactly triggers the wash sale rule?

The wash sale rule is triggered when you sell a security at a loss and purchase the same or substantially identical security within 30 days before or after the sale. This creates a 61-day window (30 days before + sale date + 30 days after) during which any purchase of substantially identical securities will disallow your loss deduction for the current tax year.

How is the 30-day window calculated?

The window is calculated in calendar days, not trading days. For example, if you sell on June 15, the wash sale window runs from May 16 (30 days before) through July 15 (30 days after). Any purchase during this 61-day period triggers the rule. Weekends and holidays count as part of the 30-day period.

What are substantially identical securities?

Substantially identical securities include the exact same stock, call options on that stock, or any contract to acquire the stock. The IRS hasn't provided a precise definition, but generally: (1) the same company's stock is always substantially identical, (2) preferred and common stock of the same company may be, especially if convertible, (3) similar ETFs tracking the same index may not be (e.g., VOO vs SPY), and (4) different companies' stocks are never substantially identical, even in the same sector.

How does the disallowed loss affect my cost basis?

When a wash sale occurs, the disallowed loss is added to the cost basis of the repurchased shares. For example, if you sell 100 shares at a $1,000 loss and repurchase 100 shares for $4,000 within the window, your new cost basis becomes $5,000 ($4,000 purchase price + $1,000 disallowed loss). This higher cost basis reduces your taxable gain or increases your deductible loss when you eventually sell the repurchased shares.

Can I avoid a wash sale by buying in a different account?

No. The wash sale rule applies across all accounts you control, including taxable brokerage accounts, IRAs, Roth IRAs, 401(k)s, and even your spouse's accounts. Crucially, if you sell at a loss in a taxable account and buy the same security in your IRA, the loss is permanently disallowed (not just deferred) because you cannot adjust the cost basis of IRA holdings. This is one of the most common and costly wash sale mistakes.

Does the wash sale rule apply to cryptocurrency?

As of December 2025, the wash sale rule does NOT apply to cryptocurrency. The IRS classifies crypto as property rather than securities, so you can sell Bitcoin at a loss and immediately repurchase it while still claiming the loss. However, there have been legislative proposals to extend the wash sale rule to crypto, so this could change in the future. Always consult current tax guidance before making decisions.

What happens if I partially repurchase the shares I sold?

The wash sale rule applies proportionally. If you sell 100 shares at a $2,000 loss and repurchase only 60 shares within 30 days, 60% of the loss ($1,200) is disallowed and added to the cost basis of the 60 repurchased shares. The remaining 40% ($800) can be deducted in the current tax year. This proportional treatment allows you to claim part of your loss immediately while deferring the rest.

Can automatic dividend reinvestment trigger a wash sale?

Yes. If you have dividend reinvestment (DRIP) enabled and the dividends automatically purchase additional shares within the 61-day wash sale window, this counts as a purchase that triggers the rule. To avoid this, consider disabling DRIP before selling at a loss, or be aware that your tax loss may be partially or fully disallowed if dividends purchase shares within the window.

How should I report wash sales on my tax return?

Your broker should report wash sales on Form 1099-B, with code "W" in Box 1f indicating a wash sale loss disallowance. The disallowed amount appears in Box 1g. You must transfer this information to Form 8949 and Schedule D when filing your taxes. Note that brokers only track wash sales within the same account at that brokerage—you're responsible for identifying and reporting wash sales across different accounts or brokers.

Is the disallowed loss lost forever?

No, the loss is not lost—it's deferred. The disallowed loss is added to the cost basis of the repurchased securities, which means you'll recognize it when you eventually sell those shares. The only exception is when you buy replacement shares in a tax-advantaged account like an IRA or 401(k), in which case the loss is permanently disallowed because you cannot adjust the cost basis of tax-advantaged account holdings.