Wash Sale Rule Calculator – Avoid Tax Losses


Wash Sale Rule Calculator

Understand the wash sale rule and calculate disallowed tax losses. Ensure your trades comply with IRS regulations and maximize your tax benefits.

Wash Sale Calculation

Enter details for your sales and repurchases to determine if a wash sale occurred.





Enter the price per share/unit you sold.


Enter the number of shares/units sold.




Enter the price per share/unit you repurchased.


Enter the number of shares/units repurchased.


Total cost to acquire the original shares/units.


What is the Wash Sale Rule?

The wash sale rule is a tax regulation enforced by the IRS (and similar bodies in other countries) designed to prevent taxpayers from generating artificial tax losses. It specifically targets situations where an investor sells a security at a loss but repurchases the same or a “substantially identical” security shortly before or after the sale. The core idea is that if you haven’t truly disposed of your investment risk, you shouldn’t be able to claim a tax deduction for a loss.

Essentially, if you sell a stock for less than you bought it for, and then you buy it back (or a very similar one) within a specific window, the tax authority views this as not a genuine sale. The loss you incurred on the sale is therefore disallowed for tax purposes in that year. This rule applies to stocks, bonds, and options.

Who Should Use a Wash Sale Calculator?

  • Active traders who frequently buy and sell securities.
  • Investors who engage in tax-loss harvesting strategies.
  • Anyone who has sold a security at a loss and repurchased it or a similar one within a short timeframe.
  • Individuals managing investment portfolios for themselves or others.

Common Misconceptions About Wash Sales:

  • “It only applies to stocks”: The wash sale rule generally applies to stocks, bonds, options, ETFs, and mutual funds.
  • “I can claim the loss if I wait 31 days”: The rule has a 61-day window: 30 days before the sale, the day of the sale, and 30 days after the sale. If a repurchase occurs within this window, it triggers the rule.
  • “It doesn’t matter if I bought for less”: The repurchase price and quantity are crucial for calculating the disallowed loss and the adjusted cost basis.
  • “I can just buy a different but similar stock”: The IRS considers “substantially identical” securities. Buying a different company’s stock in the same industry might not trigger it, but buying an ETF that holds the same underlying stocks often will.

Wash Sale Rule Formula and Mathematical Explanation

The calculation of a wash sale’s impact involves determining if the conditions are met, calculating the loss on the sale, and then adjusting the cost basis of the repurchased security if a wash sale is triggered.

Step 1: Determine if a Wash Sale Occurred

A wash sale occurs if the taxpayer acquires “substantially identical” securities within a 61-day period that includes:

  • The day of the sale (at a loss).
  • The 30 days preceding the sale.
  • The 30 days following the sale.

The purchase can be made by the taxpayer, their spouse, or a corporation they control.

Step 2: Calculate the Loss on the Sale

This is the difference between the net proceeds from the sale and the adjusted cost basis of the sold securities.

Loss on Sale = (Sale Price per Share * Quantity Sold) - Original Cost Basis

Step 3: Calculate the Disallowed Loss (if Wash Sale Occurs)

If a wash sale is triggered, the loss from the sale is disallowed for the current tax year. The amount of the disallowed loss is generally:

Disallowed Loss = Loss on Sale

However, if the repurchased quantity is less than the sold quantity, the disallowed loss is prorated:

Prorated Disallowed Loss = Loss on Sale * (Repurchase Quantity / Sale Quantity)

Step 4: Calculate the Adjusted Cost Basis of Repurchased Securities

The disallowed loss is added to the cost basis of the newly acquired (repurchased) securities. This effectively defers the tax recognition of the loss until the repurchased securities are eventually sold without triggering another wash sale.

Adjusted Cost Basis = (Repurchase Price per Share * Repurchase Quantity) + Disallowed Loss

Variables Table:

Variables Used in Wash Sale Calculation
Variable Meaning Unit Typical Range
Sale Date The date the securities were sold. Date Any valid past date.
Sale Price The price per share/unit received from selling the securities. Currency (e.g., USD) > 0
Quantity Sold The number of shares/units sold. Count > 0
Repurchase Date The date the substantially identical securities were repurchased. Date Any valid past or present date.
Repurchase Price The price per share/unit paid for repurchasing the securities. Currency (e.g., USD) > 0
Repurchase Quantity The number of shares/units repurchased. Count >= 0
Original Cost Basis The total cost to acquire the original shares/units, including commissions. Currency (e.g., USD) >= 0
Loss on Sale The calculated capital loss from the sale transaction before wash sale adjustment. Currency (e.g., USD) Can be positive (loss), zero, or negative (gain).
Disallowed Loss The portion of the loss that cannot be claimed in the current tax year due to the wash sale rule. Currency (e.g., USD) 0 to Loss on Sale.
Adjusted Cost Basis The cost basis of the repurchased securities, including the disallowed loss. Currency (e.g., USD) >= 0

Practical Examples (Real-World Use Cases)

Example 1: Wash Sale Triggered

Sarah sold 100 shares of XYZ Corp on January 15, 2024, for $50 per share. Her original cost basis for these shares was $70 per share (total cost $7,000). On January 25, 2024 (within 30 days), she repurchased 100 shares of XYZ Corp for $45 per share (total cost $4,500).

Inputs:

  • Sale Date: 2024-01-15
  • Sale Price: $50
  • Quantity Sold: 100
  • Original Cost Basis: $7,000
  • Repurchase Date: 2024-01-25
  • Repurchase Price: $45
  • Repurchase Quantity: 100

Calculations:

  • Total Sale Proceeds: $50 * 100 = $5,000
  • Loss on Sale: $5,000 (Proceeds) – $7,000 (Cost Basis) = -$2,000
  • Wash Sale Occurred? Yes, repurchase date is within 30 days of sale date.
  • Disallowed Loss: $2,000 (The full loss is disallowed).
  • Adjusted Cost Basis of Repurchased Shares: $4,500 (Cost of repurchase) + $2,000 (Disallowed Loss) = $6,500

Interpretation: Sarah cannot claim the $2,000 capital loss on her 2024 taxes. This loss is effectively added to the cost basis of her new XYZ Corp shares. Her new cost basis is $6,500 for 100 shares, meaning her effective cost per share is now $65 ($6,500 / 100).

Example 2: No Wash Sale (Purchase Outside Window)

John sold 50 shares of ABC Inc on March 10, 2024, for $20 per share. His original cost basis was $25 per share (total cost $1,250). He repurchased 50 shares of ABC Inc on April 15, 2024, for $18 per share (total cost $900).

Inputs:

  • Sale Date: 2024-03-10
  • Sale Price: $20
  • Quantity Sold: 50
  • Original Cost Basis: $1,250
  • Repurchase Date: 2024-04-15
  • Repurchase Price: $18
  • Repurchase Quantity: 50

Calculations:

  • Total Sale Proceeds: $20 * 50 = $1,000
  • Loss on Sale: $1,000 (Proceeds) – $1,250 (Cost Basis) = -$250
  • Wash Sale Occurred? No. The repurchase date (April 15) is more than 30 days after the sale date (March 10).
  • Disallowed Loss: $0
  • Adjusted Cost Basis of Repurchased Shares: $900 (Cost of repurchase) + $0 (Disallowed Loss) = $900

Interpretation: John can claim the $250 capital loss on his 2024 taxes. The wash sale rule was not triggered because the repurchase occurred outside the 61-day window. His cost basis for the new shares is simply their purchase price ($900).

How to Use This Wash Sale Calculator

Our wash sale calculator is designed for simplicity and accuracy. Follow these steps to determine the impact of the wash sale rule on your trades:

  1. Enter Sale Details: Input the exact date you sold the security, the price per share/unit you received, and the total quantity sold.
  2. Enter Original Cost Basis: Provide the total amount you originally paid for the securities you sold, including any commissions or fees.
  3. Enter Repurchase Details: Input the date you repurchased the same or a substantially identical security, the price per share/unit you paid, and the quantity repurchased.
  4. Calculate: Click the “Calculate Wash Sale” button.

How to Read the Results:

  • Wash Sale Status: This clearly indicates “Wash Sale Triggered” or “No Wash Sale.”
  • Disallowed Loss: If a wash sale is triggered, this shows the amount of capital loss you cannot claim for the current tax year.
  • Adjusted Cost Basis: If a wash sale is triggered, this value represents the cost basis of your newly purchased shares, which includes the disallowed loss. This adjusted basis will be used for calculating future gains or losses when you eventually sell these shares.
  • Loss on Sale: This shows the capital loss you incurred on the initial sale, before any wash sale adjustments.

Decision-Making Guidance:

  • If “No Wash Sale” is indicated, you can proceed with claiming the calculated loss on your tax return (subject to other capital loss limitations).
  • If “Wash Sale Triggered” is shown, you must add the “Disallowed Loss” to the cost basis of your repurchased shares. Keep records of this adjustment for future tax filings.
  • Consider the 61-day window (30 days before, day of, 30 days after sale) when planning trades to avoid triggering a wash sale if you wish to realize the loss in the current tax year. Tax-loss harvesting strategies often require careful timing.

Key Factors That Affect Wash Sale Results

Several factors influence whether a wash sale occurs and its financial implications:

  1. Timing of Transactions: This is the most critical factor. The 61-day window (30 days before, the day of, and 30 days after the sale) is the primary determinant. Any repurchase within this period for a security sold at a loss triggers the rule.
  2. Substantially Identical Securities: The definition of “substantially identical” is crucial. While identical shares of the same stock always trigger the rule, buying options, convertible bonds, or even ETFs that hold the same underlying assets can be considered substantially identical by the IRS, depending on the specifics.
  3. Loss vs. Gain on Sale: The wash sale rule only applies if the initial sale results in a capital loss. If you sell a security at a capital gain and repurchase it, the gain is recognized, and the wash sale rule is irrelevant for that specific transaction.
  4. Repurchase Quantity vs. Sale Quantity: If you repurchase fewer shares than you sold, the disallowed loss is prorated based on the ratio of repurchased shares to sold shares. If you repurchase more or the same quantity, the entire loss is typically disallowed.
  5. Cost Basis of Original Shares: The original cost basis, including commissions, directly impacts the calculated loss on sale. A higher cost basis means a larger potential loss, which in turn could result in a larger disallowed loss if a wash sale occurs.
  6. Tax Implications: The primary impact is the deferral of capital losses. This means you postpone the tax benefit of the loss. The disallowed loss is added to the cost basis of the new shares, reducing the capital gain (or increasing the capital loss) when those shares are eventually sold.
  7. Related Accounts: The rule applies across multiple accounts owned by the same individual, their spouse, or controlled corporations. Selling at a loss in one taxable account and repurchasing in another (or an IRA, though specific rules apply to IRAs) can still trigger a wash sale.

Frequently Asked Questions (FAQ) About Wash Sales

Q1: What is the exact definition of “substantially identical”?

A: The IRS generally considers securities of the same type and class. For stocks, this typically means shares of the same company. For bonds, it usually means bonds from the same issuer with similar maturity dates and interest rates. Buying an ETF that tracks the same index might be considered substantially identical, especially if it holds most of the same underlying stocks.

Q2: Does the wash sale rule apply to retirement accounts like IRAs?

A: The wash sale rules generally do not apply within traditional or Roth IRAs. However, if you sell a security at a loss in a taxable account and repurchase it in your IRA (or vice versa), the wash sale rule *does* apply, disallowing the loss. Trading within an IRA itself doesn’t trigger wash sales for tax purposes.

Q3: What if I sell at a loss and repurchase shares in my spouse’s account?

A: Yes, the wash sale rule applies if you, your spouse, or a corporation you control acquires substantially identical securities within the 61-day period. Transactions across related parties are aggregated.

Q4: How do I track the disallowed loss and adjusted cost basis?

A: It’s crucial to keep detailed records. Your brokerage firm may provide a Form 1099-B, but they are not required to track or report wash sale adjustments. You should maintain a separate ledger or spreadsheet noting the sale date, repurchase date, loss on sale, disallowed loss, and the adjusted cost basis of the repurchased shares. This information is vital for future tax filings.

Q5: What if I sell multiple lots of the same stock at different cost basis?

A: You need to track each lot separately. When selling, you can choose which lot to sell (e.g., FIFO – First-In, First-Out, or specific lot identification). If you sell one lot at a loss and repurchase, the wash sale rule applies to that specific lot’s transaction. The disallowed loss is then added to the basis of the repurchased shares.

Q6: Can I harvest losses in December and repurchase in January?

A: Yes, this is a common tax-loss harvesting strategy. If you sell a security at a loss on December 28th, and the earliest you can repurchase the same security without triggering the rule is January 28th (30 days later), you can realize the loss in the current tax year and potentially repurchase afterward.

Q7: What happens if I repurchase shares at a gain?

A: The wash sale rule specifically applies to sales made at a loss. If you sell a security at a gain and repurchase it, the gain is recognized for tax purposes, and the wash sale rule is not triggered.

Q8: Is there a penalty for violating the wash sale rule?

A: The primary consequence isn’t a penalty in the traditional sense, but rather the disallowance of the capital loss deduction for the current tax year. The disallowed loss is deferred and added to the cost basis of the repurchased security, impacting future capital gains calculations.

Related Tools and Internal Resources



© 2024 Your Website Name. All rights reserved. This calculator is for informational purposes only and does not constitute financial or tax advice.


Leave a Reply

Your email address will not be published. Required fields are marked *