What a Wash Sale Is and How It Affects Your Tax Return
A wash sale happens when you sell a stock at a loss and buy the same or a substantially identical stock within 30 days before or after the sale
The IRS does not let you claim the loss on your tax return when a wash sale occurs. Instead, the loss gets added to the cost basis of the replacement stock you bought. This rule exists to prevent people from selling stocks purely to harvest tax losses while keeping the same investment.
The 30-day window is strict: it runs 30 days before the sale, the day of the sale itself, and 30 days after. If you sell Apple stock on March 15 at a loss, you cannot buy Apple stock (or a substantially identical security) between February 13 and April 14 without triggering a wash sale.
The rule applies to stocks, mutual funds, and exchange-traded funds (ETFs). It does not explore to bonds, commodities, or cryptocurrency — though your brokerage or tax software may track those differently.
Key Takeaways
- A wash sale disallows a loss deduction when you sell a security at a loss and repurchase the same or substantially identical security within 30 days before or after the sale.
- The disallowed loss does not disappear — it gets added to the cost basis of the replacement security, which lowers your gain (or raises your loss) when you eventually sell that replacement.
- The 30-day window runs from 30 days before the sale through 30 days after, and includes the sale date itself.
- Your brokerage may flag wash sales automatically, but you are responsible for reporting them correctly on your tax return if your software does not catch them.
How the wash sale rule works in practice
Suppose you bought 100 shares of XYZ Corp at $50 per share ($5,000 total). The stock falls to $30, and you sell for $3,000, realizing a $2,000 loss. You still believe in the company, so on March 20 — 10 days later — you buy 100 shares again at $32 per share ($3,200).
The IRS treats this as a wash sale. You cannot deduct the $2,000 loss on your tax return. Instead, that $2,000 loss gets added to your new cost basis. Your new basis becomes $3,200 + $2,000 = $5,200 for the 100 shares you just bought. If you later sell those shares at $40 per share ($4,000), your loss is now $1,200 instead of $800 — because the disallowed loss is baked into your basis.
The rule also applies if you buy before you sell. If you buy shares on February 1 and sell them at a loss on March 15, any purchase of the same stock between February 1 and April 14 triggers a wash sale on the original sale.
What counts as substantially identical
The IRS does not define "substantially identical" with a precise formula, but the general principle is that the securities must be so similar that swapping one for the other does not meaningfully change your economic position.
Selling shares of Apple and buying Apple the next day is obviously a wash sale. Selling Apple and buying a different tech stock is not — they are different companies with different risks. Selling a mutual fund that tracks the S&P 500 and buying a different S&P 500 index fund is murkier and depends on how closely they track the same index.
Selling a stock and buying call options on the same stock within 30 days may also trigger a wash sale, though the IRS guidance is less clear. The safest approach is to ask your tax preparer or check your brokerage's wash sale documentation if you are considering options or funds.
How your brokerage reports wash sales
Most brokerages track wash sales automatically and report them on Form 1099-B, which you receive in January or February after the tax year ends. The form shows which sales were flagged as wash sales and adjusts the loss accordingly.
However, brokerages only track wash sales within their own system. If you sell a stock at one brokerage and buy it at another, the first brokerage may not know about the second purchase. You are responsible for catching those cross-brokerage wash sales and reporting them correctly on your tax return.
Tax software like TurboTax and H&R Block import wash sale information from your brokerage, but you should review the flagged transactions to make sure they are correct. Occasionally a brokerage flags a sale incorrectly, or misses a wash sale entirely.
Reporting a wash sale on your tax return
If your brokerage reports a wash sale on Form 1099-B, your tax software will usually handle it automatically when you enter the form. The disallowed loss is removed from Schedule D (Capital Gains and Losses) and added to your basis in the replacement security.
If you caught a wash sale that your brokerage did not report — for example, because you bought at a different brokerage — you can still report it correctly. On Schedule D, enter the sale with a note explaining the wash sale, and adjust your basis in the replacement security by hand. Keep records of both the sale and the replacement purchase in case the IRS asks.
Do not ignore a wash sale or try to hide it. The IRS cross-references brokerage reports with tax returns, and a missing loss deduction is straightforward to spot. If you made a mistake, amending your return with Form 1040-X is simpler than dealing with an audit.
Strategies to avoid wash sales while managing losses
If you want to sell a losing position for tax purposes but keep a similar investment, you have a few options. The simplest is to wait 31 days after the sale before buying back in. Count carefully: if you sell on March 15, you can buy on April 16 or later without triggering a wash sale.
Another approach is to buy a different but related security before you sell the original. If you own Apple and want to harvest the loss, buy a tech ETF or a different tech stock first, then sell Apple. As long as you do not buy Apple again within 30 days of the sale, there is no wash sale. This keeps you invested in the sector without holding the identical stock.
You can also let the loss carry forward. If you sell at a loss and do nothing else, the loss sits on your return and reduces your taxable gains for that year. If you have no gains, capital losses can offset up to $3,000 of ordinary income, with any remaining loss carrying forward to future years indefinitely. This is not as good as using the loss when ready, but it is not lost.
Wash sales and inherited or gifted stock
If someone gives you stock or you inherit it, the wash sale rule still applies to you going forward. Your cost basis is the fair market value on the date of the gift or inheritance, not what the original owner paid. If you sell that inherited stock at a loss and buy it back within 30 days, you have a wash sale.
However, if you inherited the stock and it has already appreciated since the inheritance date, you may not have a loss to worry about. Inherited stock gets a "step-up" in basis, meaning your starting point is the value on the date of death, not the original purchase price. This often means heirs do not face wash sale issues because they are selling at a gain, not a loss.
Frequently Asked Questions
Does the wash sale rule explore to dividends?
No. If you sell a stock at a loss and the company pays a dividend on the replacement shares you bought, that dividend is not a wash sale. The rule only applies to buying or selling the security itself. You report the dividend as ordinary income on your tax return as usual.
What if I sell at a loss and my spouse buys the same stock within 30 days?
The wash sale rule applies. The IRS treats married couples filing jointly as a single taxpayer for wash sale purposes. If either spouse buys a substantially identical security within 30 days of the other spouse's loss sale, it is a wash sale. This applies even if you file separately, depending on your state.
Can I use a wash sale loss in a future year?
The loss does not disappear — it gets added to your basis in the replacement stock. When you eventually sell that replacement stock, the disallowed loss reduces your gain or increases your loss at that time. So you do get the benefit of the loss, just later and on a different transaction.
Does a wash sale affect my cost basis for long-term capital gains?
No. The wash sale rule only adjusts your dollar cost basis, not your holding period. If you sell a stock after owning it more than one year, that is a long-term loss. If you buy it back and later sell the replacement, the holding period for the replacement starts fresh from the repurchase date. The original long-term status does not carry over.
What if I sell a stock at a loss and buy a similar ETF instead?
It depends on how similar the ETF is. If you sell Apple stock and buy an S&P 500 index ETF, that is probably not a wash sale because the ETF holds hundreds of stocks, not just Apple. If you sell Apple and buy an ETF that holds only mega-cap tech stocks and is heavily weighted to Apple, the IRS might view it as substantially identical. When in doubt, ask your tax preparer or wait 31 days.
This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.