The Wash Sale Rule: When a Loss Doesn't Count (Yet)
Selling at a loss and buying the same investment back within 30 days can disallow the loss for tax purposes. Here is how the rule works, with a worked example, and what happens to the disallowed loss.

Selling an investment at a loss can reduce your taxes. But if you buy the same or a "substantially identical" investment within a short window around that sale, the wash sale rule disallows the loss for now. The loss isn't erased. It's added to the cost basis of the replacement shares, which defers it.
The 61-day window
A wash sale generally occurs if, within 30 days before or after selling at a loss, you buy substantially identical securities, including through certain related accounts. That makes a 61-day window around the sale date.
- 30 days before. A purchase in this period can trigger the rule.
- Sale at a loss. The day you sell.
- 30 days after. A purchase in this period can also trigger the rule.
- Loss deferred. Disallowed loss is added to the basis of the replacement shares.
Worked example
A hypothetical investor:
- Bought 100 shares at $50 ($5,000).
- Sold all 100 at $40 ($4,000), a $1,000 loss.
- Bought 100 shares back at $42 ($4,200) two weeks later.
Because the repurchase came within 30 days, the $1,000 loss is disallowed for now.
If the investor later sells those shares at $55:
Show the numbers behind this chart
| No wash sale (waited 31+ days) | Wash sale (rebought in 2 weeks) | |
|---|---|---|
| Loss claimed on first sale | $1,000 | $0 |
| Gain reported on later sale | $1,300 | $300 |
Over the two transactions, the total is the same: a $300 net gain. The wash sale rule shifts the loss from the first sale to the second. The holding period of the original shares also generally carries over to the replacement shares.
What counts as substantially identical
Buying the same stock or the same fund clearly counts. Options and contracts to buy the same stock can count. Whether two different funds tracking similar indexes are substantially identical is less clear; the IRS has not provided a bright-line rule. Many investors who harvest losses switch to an investment that is similar in role but not identical.

Accounts that matter
The rule can apply across your own accounts, including in some cases purchases in an IRA after selling at a loss in a taxable account. When the replacement shares are bought in an IRA, the disallowed loss may not be recoverable through a basis adjustment. Purchases by a spouse can also count. Automatic dividend reinvestment can trigger a partial wash sale if it buys shares within the window.
Tax-loss harvesting
Tax-loss harvesting means deliberately selling investments at a loss to offset gains, and, within annual limits, ordinary income, with unused losses carried forward. The wash sale rule is the main constraint. Typical approaches include waiting at least 31 days to repurchase, or buying a different but similar investment so your market exposure continues.
The takeaway
Selling at a loss and buying back within 30 days, before or after, generally defers the loss rather than letting you claim it now. Know the window, watch for automatic purchases and other accounts, and get tax advice for significant transactions.
Keep reading

Asset Allocation and Rebalancing: Keeping Your Risk Where You Set It
A 60/40 portfolio left alone through a few good stock years quietly becomes a 70/30 portfolio. Here is how drift happens, what rebalancing does and doesn't do, and the main ways people rebalance.
Guide, 4 min read
Bond Basics: Why Bond Prices Fall When Rates Rise, and What Duration Tells You
Bonds are often described as safe, yet bond funds can lose money. The reason is the seesaw between interest rates and prices. Here is how it works, with prices calculated for three maturities.
Guide, 5 min read
Dollar-Cost Averaging vs. Lump Sum: What the Math Actually Says
If you have a large sum to invest, should you put it in all at once or spread it out? We ran both approaches through three market paths to show who wins, when, and why.
Guide, 4 min read