Home>Finance>What Is A Wash Sale And How Do I Avoid It When Tax-Loss Harvesting
Finance
What Is A Wash Sale And How Do I Avoid It When Tax-Loss Harvesting
Table of Contents
No, if you buy the same or 'substantially identical' security within 30 days before or after the sale, the IRS disallows the loss under the wash sale rule. The disallowed loss is instead added to the cost basis of the new shares, deferring the tax benefit until you eventually exit the position.
The wash sale rule's 61-day danger zone
The wash sale rule activates a 61-day window: 30 days before the sale, the day of the sale itself, and 30 days after the sale. If you buy the same or substantially identical security at any point inside that window, even if you sold at a loss on day one, the loss is disallowed. The most commonly missed part is the 30 days *before* the sale. If you bought shares on November 1, then sold those same shares at a loss on November 20, the purchase on November 1 falls inside the 30-day lookback and triggers a wash sale. The rule does not require a *new* purchase after the sale. It includes any acquisition within the prior 30 days. A routine monthly dividend reinvestment plan can accidentally create a wash sale if you sell a losing position while your brokerage auto-buys fractional shares. Always check your transaction history for the full 61-day span, including the date of the sale itself. Count both the buy and sell dates as day one.
What 'substantially identical' actually traps
The IRS defines "substantially identical" broadly. The common failure case is swapping into an alternate share class, a competitor's stock, or an option and assuming the rule won't apply. Selling shares of Vanguard's S&P 500 ETF at a loss and buying iShares Core S&P 500 ETF within the window is a wash sale. Both track the same index, and the IRS treats them as substantially identical. Similarly, buying a call option on the same stock you just sold at a loss counts, because the option gives you the right to reacquire the position. Even a competitor's stock is not safe. If you sell Ford at a loss and buy General Motors, that is generally *not* a wash sale because they are distinct issuers. But if you sell one class of the same company and buy another class of that same company, the IRS can deem them substantially identical. When in doubt, avoid any security that tracks the same index, the same company, or an option contract on the same underlying stock.
The basis adjustment that saves you later
Here is the critical saving grace: the disallowed loss is not gone forever. It is added to the cost basis of the replacement shares you bought. Suppose you bought 100 shares of a stock at $50 per share and sold them at $30 per share for a $2,000 loss. Then you bought 100 shares back at $28 per share within the 30-day window. The $2,000 loss is disallowed. Your new cost basis becomes the $2,800 you paid plus the $2,000 disallowed loss, for a total of $4,800. That equals $48 per share. When you eventually sell those shares, the $2,000 loss reduces your taxable gain or increases your loss on that later sale. The net effect is a *deferral* of the tax benefit, not a cancellation. The deferral can stretch for years. If you die holding the shares, your heirs receive a step-up in basis to the market value on your date of death, which permanently wipes out the deferred loss. For most investors, the deferral is acceptable, but you must track the adjusted basis carefully. Your brokerage will not do this for you on a wash sale that crosses accounts or if you manually calculate your own basis.
Clean alternatives for staying invested
If you want to harvest a loss but avoid the 30-day blackout, you can maintain market exposure using an asset that tracks a separate index or a sector ETF. For example, if you sold a U.S. large-cap stock at a loss, buy a broad-market index fund like the Russell 1000 or a technology sector ETF instead of a direct S&P 500 fund. The IRS looks at whether the replacement is *substantially identical*, not merely similar in performance. An S&P 500 fund and a Russell 1000 fund are generally not considered identical because they track distinct indexes with distinct holdings. If you sold a single stock, you can buy an index fund that holds that stock as a small component. The fund itself is not the same security. For a more aggressive move, you could buy a call option on another index or a futures contract, but that adds complexity and risk. The simplest path: sell the losing position, immediately buy a low-cost total market or sector ETF, wait 31 days, then sell the replacement and repurchase your original stock if you still want it. That keeps your money invested and your risk profile close to the original, all while the wash sale rule leaves you alone. Remember to check your specific holdings. If you own a mutual fund that auto-reinvests dividends, that reinvestment can trigger a wash sale even if you never manually bought shares.
In plain terms, you cannot sell a stock at a loss, claim that loss on this year's tax return, and buy the same stock back the next day. The IRS treats that as a "wash" and postpones the deduction. This catches many DIY investors who understand the basic rhythm of tax-loss harvesting but miss the precise timing and security definitions, especially when they try to stay invested during the waiting period.
Frequently Asked Questions
Does the wash sale rule apply to gains as well as losses?
No, the rule only applies to losses. Selling a security at a gain and buying it back immediately is perfectly legal and has no wash sale consequence. You simply realize the gain and pay tax on it. The rule exists to stop investors from manufacturing losses for tax deductions while keeping their position intact.
What if I sell at a loss and buy the same stock in my IRA within 30 days?
That transaction triggers a wash sale, but the problem is worse. The disallowed loss is added to the IRA's cost basis. When you eventually take distributions, that loss is permanently lost because IRAs do not allow capital loss deductions. You should never buy the same security in a retirement account within the 61-day window of a taxable loss sale. This is one of the most expensive mistakes in retirement & investment taxes.
Can I sell at a loss and buy a different expiration date call option on the same stock?
Yes, but only if the option is not "deep in the money" and has a separate strike price or expiration that is not substantially identical. The IRS uses a facts-and-circumstances test. A safe rule of thumb is to avoid any option that is in the money and within 30 days of expiration, as that is likely to be treated as the same position.
Do I need to track wash sales across multiple brokerage accounts?
Yes, the IRS requires you to aggregate all your accounts, including taxable brokerage accounts, IRAs, and even trust accounts, when determining a wash sale. Your brokerage will only report wash sales on a per-account basis. You must manually track transactions across distinct firms to avoid underreporting your adjusted basis. This is the only way to use tax-loss harvesting to offset capital gains correctly across your full portfolio.
The IRS treats a wash sale as a deferral, not a permanent denial. The disallowed loss moves into the cost basis of the replacement shares and reduces your taxable gain later. No other tax publication explains that the real danger is buying the replacement inside an IRA, where the basis adjustment becomes worthless and the loss evaporates forever.