Wash Sale Calculator: Disallowed Loss and New Cost Basis
Enter a stock or fund sale at a loss and the purchases around it. See how much of the loss the wash sale rule disallows, the new cost basis and holding period of the replacement shares, and the dates of the 61-day window. From 26 U.S.C. 1091, the regulations and IRS Publication 550.
The sale
Shares you are selling, one row for each purchase
Other purchases of the same security, before or after
Include reinvested dividends, automatic investments, your spouse's buys and anything an IRA or Roth IRA bought. Leave out the shares already listed in the lots above.
Loss disallowed by the wash sale rule
$400.00
$400.00 of your $1,000.00 loss cannot be deducted now, because you bought replacement shares between Nov 18, 2026 and Jan 17, 2027.
- Loss on the shares sold at a loss
- $1,000.00
- Loss you can deduct for this sale
- $600.00
- Added to the cost of replacement shares (deducted later)
- $400.00
- Gone for good (an IRA or Roth IRA bought)
- $0.00
- Gain on other shares in the same sale (still taxed)
- $0.00
- The 61-day window
- Nov 18, 2026 to Jan 17, 2027
- First purchase date outside it
- Jan 18, 2027
Your replacement shares
40 shares bought Dec 28, 2026
Takes $400.00 of the loss on 40 shares bought Mar 10, 2025.
New basis of these shares: $2,040.00 (cost $1,640.00 plus the loss). Their holding period counts from Mar 20, 2025.
Estimate only. It follows 26 U.S.C. 1091 and 1223(3), 26 CFR 1.1091-1 and -2, IRS Publication 550 and Revenue Ruling 2008-5. It is not financial advice, tax advice or legal advice. Your broker's Form 1099-B may show a different wash sale amount, because it cannot see everything you or your spouse did elsewhere.
Frequently asked questions
Q.What is a wash sale?
A sale of stock or securities at a loss when, within the 30 days before or the 30 days after, you buy substantially identical stock or securities, acquire them in a fully taxable trade, buy a contract or option to acquire them, or have your IRA or Roth IRA acquire them (26 U.S.C. 1091(a); Publication 550). A spouse's purchase, or a purchase by a corporation you control, counts too (Publication 550). The loss cannot be deducted for that sale. Dealers in securities are treated differently.
The rule is about losses only. A sale at a gain is taxed as usual, whatever you buy afterwards.
Q.When can I buy it back?
The window runs from 30 days before the sale date to 30 days after it, 61 days in all. A sale on December 31, 2026 therefore reaches to January 30, 2027, and a purchase on January 29, 2027 would disallow the whole loss on 100 replaced shares; January 31, 2027 is the first calendar date outside the window. Purchases made in the 30 days before the sale count as much as those after it.
Q.Is the disallowed loss gone for good?
Usually not. It is added to the cost of the replacement shares, so you get it back, as a smaller gain or a larger loss, when you sell those. The time you held the old shares is also added to the new shares' holding period (26 U.S.C. 1223(3)). Publication 550's example: 100 shares bought for $1,000 are sold for $750 and 100 shares are bought again for $800 within 30 days; the $250 loss is not deductible and the new basis is $1,050.
The exception is a purchase by your IRA or Roth IRA. The loss is disallowed and the IRA's basis is not increased (Revenue Ruling 2008-5), so it is never deducted.
Q.I bought 200 shares and sold 100 of them within 30 days. Is that a wash sale?
Not by itself. Revenue Ruling 56-602, as The Tax Adviser describes it, says the rule is not meant to apply to a bona fide sale made to reduce your holding, so the 100 shares you kept do not count as replacements for the 100 you sold. Buy more within the window and the rule does apply to that new purchase. Put the kept shares in the lot's “shares of this purchase you keep” box: they are still counted as replacements for losses on shares from a different purchase. This calculator relies on the description of the ruling; its text was not read.
Q.Do reinvested dividends and automatic investments count?
A reinvested dividend or a scheduled investment buys shares, and a purchase of substantially identical shares inside the window is what the rule looks at, whatever its size. A small one disallows only the matching number of shares: replacing 2 of 100 shares disallows 2% of the loss. Add each one as a purchase.
Q.What is “substantially identical”?
Publication 550 says you must consider all the facts and circumstances. Ordinarily the stock of one corporation is not substantially identical to the stock of another, and bonds or preferred stock are not ordinarily substantially identical to the same company's common stock, although convertible ones may be. Neither the statute, the regulations nor Publication 550 says how two different funds that follow the same index are treated, and this calculator does not decide it: you choose which purchases to list.
Q.What is the last day to take a loss for 2026?
For securities traded on an established market the trade date is what counts, not the settlement date: Publication 550's example reports a sale made on December 31 on that year's return even though it was paid in January. So a sale traded by December 31, 2026 is a 2026 sale. A January purchase can still disallow its loss.
Q.How do I report a wash sale?
On Form 8949, report the sale and enter code W in column (f) with the disallowed amount as a positive number in column (g) (Publication 550; Instructions for Form 8949). Brokers show wash sales they can see in box 1g of Form 1099-B, but they cannot see purchases in other firms, your spouse's accounts or every IRA, so the correct amount may differ. After the adjustment, the capital gains and loss carryover calculator shows what your remaining losses are worth.
Sources
- 26 U.S. Code § 1091 — Loss from wash sales of stock or securities (the 30 days before and after, and the basis of the replacement)
- 26 CFR § 1.1091-1 — Losses from wash sales: the matching order and Examples 1-3
- 26 CFR § 1.1091-2 — Basis of stock acquired in a wash sale (two examples)
- 26 U.S. Code § 1223(3) — The holding period of the replacement shares includes that of the shares sold
- IRS Publication 550 (2025) — Wash Sales; substantially identical; trade date and settlement date
- Revenue Ruling 2008-5 — A purchase by your IRA or Roth IRA disallows the loss and adds nothing to the IRA's basis
- The Tax Adviser (AICPA), March 2012 — Rev. Rul. 56-602: selling part of a purchase you made within 30 days is not by itself a wash sale