Skip to content

    Wash Sale Calculator

    Free wash sale calculator. Check whether a stock or crypto loss is disallowed under the US wash sale rule and see the basis adjustment carried to your replacement shares.

    4 July 2026
    14 min read
    2,783 words

    A wash sale calculator helps you see whether a stock or securities loss you just booked is actually deductible this tax year, or whether the IRS wash sale rule pushes that loss into the cost basis of the shares you bought back. In plain terms, the United States wash sale rule stops traders from selling a position at a loss purely to harvest a tax deduction, and then quietly rebuying the same position right away so their real market exposure never changed. The rule lives in Internal Revenue Code section 1091. The calculator above turns that rule into a fast yes or no answer: you enter your capital loss and whether you repurchased a substantially identical security within 30 days, and it tells you how much of the loss is disallowed, how much stays deductible, and how much gets added to your new basis so it is deferred rather than destroyed.

    Key Takeaways

    • 1.The wash sale rule (IRC section 1091) disallows a loss when you buy a substantially identical security within 30 days before or after selling at a loss, a 61 day total window.
    • 2.A disallowed loss is not lost forever. It is added to the cost basis of the replacement shares, so you recover the benefit when you finally sell those replacement shares.
    • 3.The rule looks across all your accounts, including your IRA and a spouse's accounts, and it can catch a controlled entity like your own corporation.
    • 4.As of the 2025 and 2026 tax years, crypto is generally not treated as a security under section 1091, so the wash sale rule usually does not apply to it, but this is debated and could change, so verify current figures and current law.
    • 5.This page is educational only. It is not tax advice. Confirm your specific situation with a qualified tax professional. Last reviewed 2026.

    What the wash sale rule is (IRC section 1091)

    The wash sale rule is a United States federal tax provision that blocks you from claiming a capital loss if you acquire a substantially identical security within a set window around the losing sale. Congress created it so traders cannot generate a paper loss for tax purposes while keeping the same economic position. It applies to stocks, bonds, options, and other securities held for investment. It does not change how much money you actually made or lost in the market. It only changes the timing of when you are allowed to use the loss on your tax return. If a sale is flagged as a wash sale, the loss is disallowed in the current year and instead attaches to the basis of the shares that triggered the rule.

    A key point that scares many new traders unnecessarily: the wash sale rule almost never makes a loss disappear permanently. In the ordinary case it defers the loss. The main way a loss can be permanently trapped is a narrow situation, such as a wash sale involving a related party or certain retirement account repurchases, where the basis adjustment cannot flow back to you. For a normal taxable brokerage account, a disallowed wash sale loss simply waits inside your new cost basis until you exit the replacement position.

    How the wash sale calculator works: inputs and outputs

    The calculator above is intentionally simple so you can sanity check a single trade in seconds. Here is what each field means and what each result tells you.

    • Capital Loss (input): the realized loss on the sale, entered as a positive number. If you sold 100 shares you bought for 5,000 dollars for only 3,000 dollars, your capital loss is 2,000 dollars.
    • Repurchased Within 30 Days (input, yes or no): whether you bought a substantially identical security within 30 days before or 30 days after the losing sale. Yes means the trade falls inside the 61 day window.
    • Disallowed Loss (output): the portion of your loss the wash sale rule blocks from this year's deduction. In the simple yes case, this equals your full capital loss.
    • Deductible Loss (output): the portion of the loss you can still claim now. If the trade is a wash sale, this is zero. If it is not, this equals your full loss.
    • Added to New Basis (output): the disallowed amount that gets bolted onto the cost basis of your replacement shares, so the tax benefit is deferred, not deleted.
    • Status (output): a plain label such as Wash Sale (loss deferred) or Clean (loss deductible now) so you know at a glance which path you are on.
    The calculator simplifies real life

    The calculator above treats repurchase as a single yes or no for a full-position rebuy. Real wash sales can be partial: if you only rebuy part of your position, only that proportion of the loss is disallowed. Use the tool for a quick read, then confirm partial and multi-lot cases with a tax professional or full tax software.

    The 61 day window explained

    Most people call it the 30 day rule, but the true danger zone is 61 days wide. The rule looks 30 days before the sale, the day of the sale itself, and 30 days after the sale. If you buy a substantially identical security anywhere inside that span, the loss is a wash sale. The before half surprises people: you can trigger a wash sale with a purchase you made weeks before you sold the losing lot, not just with a rebuy afterward. Count calendar days, not trading days, and count carefully around month ends and holidays.

    1. Mark the date you sold the security at a loss.
    2. Count back 30 calendar days from that sale date. Any substantially identical purchase in that stretch counts.
    3. Count forward 30 calendar days from the sale date. Any substantially identical purchase in that stretch also counts.
    4. If a qualifying purchase sits anywhere in that 61 day total window, the loss is disallowed and shifts into the basis of those replacement shares.
    5. If no qualifying purchase falls in the window, the loss is clean and deductible in the current year.

    What substantially identical means

    The rule does not trigger on any repurchase. It triggers on buying something substantially identical to what you sold. The IRS has never published a bright line list, which is exactly why traders get tripped up. Judgment matters, so this is one area where professional guidance is worth it.

    Usually treated as substantially identical

    Rebuying the exact same stock or the exact same fund is the clearest case. Buying a call option or entering a contract to acquire the same stock can also count, because you are reacquiring the same economic exposure. Preferred shares that are convertible into the common stock you sold can be treated as substantially identical in some situations.

    Usually not substantially identical

    Shares of a different company in the same sector are generally not substantially identical. Two index funds that track different indexes are usually fine. Many traders harvest a loss in one S and P 500 fund and rotate into a total market fund to stay invested while sidestepping the rule, but even close trackers of the same index can be a grey area, so verify current guidance before relying on that move.

    Worked examples with real numbers

    Example 1: full rebuy inside the window

    You bought 100 shares of a stock for 5,000 dollars. You sold all 100 for 3,000 dollars, a capital loss of 2,000 dollars. Four days later you rebought 100 shares of the same stock. In the calculator you enter Capital Loss 2,000 and Repurchased Within 30 Days yes. Result: Disallowed Loss 2,000 dollars, Deductible Loss 0 dollars, Added to New Basis 2,000 dollars, Status Wash Sale. Your new 100 shares carry a cost basis of your purchase price plus 2,000 dollars, so when you eventually sell them you get the loss back through a smaller gain or a larger loss.

    Example 2: no rebuy, clean loss

    Same trade: you booked a 2,000 dollar loss selling 100 shares. This time you stayed out for the full 31 days and bought nothing substantially identical. You enter Capital Loss 2,000 and Repurchased Within 30 Days no. Result: Disallowed Loss 0 dollars, Deductible Loss 2,000 dollars, Added to New Basis 0 dollars, Status Clean. The full 2,000 dollar loss offsets your other capital gains this year, and up to 3,000 dollars of net capital loss can offset ordinary income, with the rest carried forward. Verify the current annual ordinary-income offset figure, as these limits can change.

    Example 3: partial rebuy proration

    You sold 100 shares at a 5,000 dollar loss, then rebought only 60 shares within a week. Because just 60 percent of your position was reacquired, only 60 percent of the loss is a wash sale. Disallowed Loss is 3,000 dollars, which attaches to the 60 replacement shares as extra basis. The remaining 2,000 dollars is deductible now. The simple calculator above cannot split this for you, so treat it as a signal to model partial rebuys in full tax software or with your accountant.

    Wash sale scenarios at a glance

    Illustrative scenarios only. The IRA row shows the harsh case where the disallowed loss cannot be added back to a taxable basis. Figures are examples, not guidance. Last reviewed 2026.
    ScenarioCapital LossRebuy in 61-day windowDisallowed LossDeductible NowAdded to Basis
    Full rebuy of same stock$2,000Yes (100%)$2,000$0$2,000
    No rebuy, waited it out$2,000No$0$2,000$0
    Partial rebuy (60%)$5,000Yes (60%)$3,000$2,000$3,000
    Bought a different-sector stock$2,000Not identical$0$2,000$0
    Rebuy in your IRA$2,000Yes$2,000$0$0 (basis lost)

    Across accounts, spouses, and controlled entities

    A common and expensive myth is that you can dodge the wash sale rule by selling in one account and rebuying in another. You cannot. The IRS applies the rule across all of your accounts combined. That includes selling in a taxable brokerage and rebuying in your IRA or Roth IRA, and IRS guidance is strict there: the disallowed loss cannot be added to the IRA basis, so it can be permanently lost. The rule also reaches your spouse. A loss you take can be washed by a substantially identical purchase your spouse makes in their own account. It can reach an entity you control, such as a corporation where you hold the reins, because the purpose is to stop the same economic actor from gaming the timing. Your broker only reports wash sales within that single broker and account family, so cross-account and cross-broker matching is your responsibility.

    Crypto and the wash sale rule in 2025 and 2026

    As of the 2025 and 2026 tax years, cryptocurrency is generally classified as property rather than a security for United States federal tax purposes, and section 1091 is written to apply to stock or securities. So the wash sale rule usually does not stop crypto traders from selling a coin at a loss and rebuying it immediately. This is why crypto tax loss harvesting has been popular. Two cautions matter. First, lawmakers have repeatedly proposed extending the wash sale rule to digital assets, so this treatment could change, possibly with little warning. Second, tokenized securities and certain crypto structured products may already fall under securities rules. This is a debated, moving area, so verify current figures and current law before you act, and do not assume crypto is permanently exempt.

    Tips and common mistakes

    • Do not forget the 30 days before the sale. A purchase you already made can create a wash sale when you later sell a different lot at a loss.
    • Watch dividend reinvestment. An automatic reinvested purchase of the same fund inside the window can trigger a wash sale on a small slice of your loss.
    • Do not rely on your broker's 1099-B alone. It will not catch wash sales across different brokers, across your IRA, or across your spouse's accounts.
    • Turn off automatic reinvestment before harvesting a loss, then wait the full window before rebuying.
    • Track your basis carefully. The whole benefit of a disallowed loss is recovered through the higher basis of your replacement shares, so losing that number means losing the deduction.
    • Keep a clean, dated trade log so you can prove exactly when each buy and sell happened if the timing is ever questioned.
    Educational only, not tax advice

    This page and the calculator above are for general education. They are not tax, legal, or financial advice, and they do not account for your specific facts, state rules, or account types. Tax rules and figures change, so treat every number here as an example and verify current figures. Before you act on any loss harvesting or wash sale decision, confirm it with a qualified tax professional or CPA. Last reviewed 2026.

    Frequently asked questions

    The wash sale rule rewards traders who keep good records and punishes those who guess. The single best defense is a clean, honest trade log with exact dates, quantities, and prices for every buy and sell, across every account. Keeping that log on OneTradeJournal means that when tax season arrives, you can see your losing exits, the surrounding 61 day windows, and any rebuys in one place, which makes it far easier for you and your tax professional to spot wash sales before they become a filing surprise. Discipline in your logging today is what makes an accurate, defensible return possible tomorrow. Remember that this is education, not tax advice, so confirm the specifics with a qualified professional and verify current figures for your tax year.

    📓 Tools show what happened, a journal shows why. Turn these numbers into better decisions, start your Free Trading Journal.

    Related Topics

    wash sale calculatorwash sale ruledisallowed losswash sale 30 day rulewash sale basis adjustmentcapital loss rules

    Related Articles

    OneTradeJournal

    The trading journal for stocks, options, forex, futures & crypto. Track your trades, spot patterns, build discipline.

    • Log one trade a day by hand, on purpose
    • AI mentor finds your repeat mistakes
    • Behavioural analytics catch tilt early
    • Trading calendar with P&L heatmap
    • Pre-trade checklist flags risks
    Start journaling

    Free to start · No broker credentials