Key takeaways
- A wash sale occurs when you sell stock or securities at a loss and, within 30 days before or after the sale, buy substantially identical stock or securities.
- The loss is not deductible then; it is generally added to the cost basis of the replacement shares, postponing it rather than erasing it.
- The holding period of the old shares carries over to the new ones.
- Buying the replacement in an IRA or Roth IRA also creates a wash sale, and in that case the loss is not added to basis.
- Purchases by your spouse or a corporation you control count too.
Selling an investment at a loss usually produces a capital loss you can use to offset gains on your US tax return. But if you sell at a loss and quickly buy the same thing back, the IRS treats it as if the loss did not really happen yet. That is the wash sale rule, explained in IRS Publication 550, the IRS's guide to investment income and expenses. This article summarises how the rule works using the IRS's own examples; it is general information, not tax advice, and the details of your situation matter.
The rule
Publication 550 states it directly: you cannot deduct losses from sales or trades of stock or securities in a wash sale. A wash sale occurs when you sell or trade stock or securities at a loss and, within 30 days before or after the sale, you:
- buy substantially identical stock or securities,
- acquire substantially identical stock or securities in a fully taxable trade,
- acquire a contract or option to buy substantially identical stock or securities, or
- acquire substantially identical stock for your IRA or Roth IRA.
It also counts as a wash sale if you sell and your spouse, or a corporation you control, buys substantially identical stock.
The window runs in both directions: buying before the loss sale counts as much as buying after it.
What happens to the loss
The loss is not simply lost. Publication 550 explains that you add the disallowed loss to the cost of the new stock or securities, and the result is your basis in them. That postpones the deduction until you dispose of the new shares. Your holding period for the new shares also includes the time you held the old ones, which matters for whether a later gain is short- or long-term; see capital gains on stocks.
The IRS example. You buy 100 shares of X for $1,000. You sell them for $750, and within 30 days you buy 100 shares of X again for $800.
| Step | Amount |
|---|---|
| Loss on the sale | $1,000 − $750 = $250 |
| Deductible now | $0: it is a wash sale |
| Basis of the new shares | $800 + $250 = $1,050 |
If you later sell the new shares for $800, for example, your loss on that sale is $1,050 − $800 = $250: the postponed loss shows up then.
The IRA exception. For a replacement bought in an IRA or Roth IRA, item 4 above, Publication 550 makes an exception to the basis adjustment: the disallowed loss is not added to the basis of the new shares. In that case the loss is not merely postponed.
Partial repurchases
If you buy back a different number of shares than you sold, the rule applies share by share. The IRS's example: you bought 100 shares of M in September 2024, bought 50 more on 13 December and 25 more on 20 December, then sold the original 100 on 3 January 2025 at a $1,000 loss. Because 75 substantially identical shares were bought within 30 days before the sale, the loss on 75 shares ($750) is disallowed, and the loss on the other 25 shares ($250) is deductible.
The disallowed $750 is then spread across the replacement shares in proportion to their number:
| Replacement lot | Cost | Share of the $750 | New basis |
|---|---|---|---|
| 50 shares, 13 December | $2,750 | 50 ÷ 75 = two-thirds, $500 | $3,250 |
| 25 shares, 20 December | $1,125 | the remaining $250 | $1,375 |
Publication 550 adds that you match replacement shares to the shares sold in the order you bought them, starting with the first, and that a loss from a wash sale of one block cannot reduce gains on identical blocks sold the same day.
What counts as "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, though there are exceptions, such as predecessor and successor companies in a reorganization. Bonds or preferred stock of a company are not ordinarily substantially identical to its common stock, but convertible ones can be, depending on their terms. The IRS also notes the rules apply to losses on contracts and options to buy or sell stock, which links this rule to options, but not to losses on commodity futures contracts or foreign currencies.
Whether two different funds tracking similar indexes are substantially identical is a question the IRS publication does not settle with a simple rule; it is one to take to a tax professional.
Keeping track
Your broker may flag wash sales for you, but only some of them. Publication 550 explains that box 1g of Form 1099-B shows a disallowed wash sale loss when the shares sold were covered securities and the replacement shares had the same CUSIP number and were bought in the same account. A repurchase in a different account, an IRA or by your spouse will not appear there, and the IRS is explicit that you cannot deduct a wash sale loss even if it is not reported on Form 1099-B.
Good records, of each purchase date, sale date, price and quantity across all your accounts, are the practical defence; a trading journal helps. Publication 550 says to report a wash sale on Form 8949 with code "W" and the disallowed loss entered as a positive adjustment, and Topic 409 explains how Form 8949 feeds Schedule D.
Simulated trades in Learn to Trade Stocks Beginner use virtual money and have no tax consequences, which makes the app a safe place to practise keeping records. It is one of our education apps; the investing basics hub lists the related guides.
Good to know
Frequently asked questions
What is the wash sale rule?
Is a wash sale loss lost forever?
How long should you wait to buy back a stock sold at a loss?
Are two different companies' stocks substantially identical?
Sources
- Publication 550 (2025), Investment Income and Expenses: Wash Sales (opens in a new tab)Internal Revenue Service — accessed
- Topic no. 409, Capital gains and losses (opens in a new tab)Internal Revenue Service — accessed
About the author
Reign Creative LLC — The independent app studio that builds the apps covered on this site and publishes every article here. On Google Play it publishes as Reign Collective Apps.
We use AI tools to help research, draft and edit our articles. Each article lists the sources its factual claims rely on, and details about our apps come from their live Google Play listings. No article on this site has been reviewed by an independent expert unless the reviewer is named on it.
No person at Reign Creative LLC has read this article in full. It was published after automated checks and an AI editorial review, which are described in our editorial policy and are not the same as a person reading every sentence.
Spotted an error? Tell us — how corrections are handled is set out in our editorial policy.