Selling a losing position to cut your tax bill is one of the few moves that turns a bad year into something useful. The catch is a rule most people have heard of and almost nobody has read. The wash sale rule says that if you sell a security at a loss and buy the same security, or one substantially identical to it, within thirty days, the loss does not count on your return. The part that surprises people is that the window runs both directions. Thirty days before the sale and thirty days after, plus the day of the sale itself, adds up to a sixty one day span. Buy inside any part of it and the write off you were counting on quietly goes away.
Start with what actually happens to the money, because the loss is usually not destroyed. When a sale is flagged as a wash, the disallowed loss gets added to the cost basis of the replacement shares you bought. Your holding period carries over as well. So the tax benefit is delayed until you finally sell the replacement position without rebuying, not erased outright. That matters, because a deferred loss is an annoyance while a permanent one is real money. Knowing the difference tells you whether to fix a wash sale or simply accept it and move on.
There is one version where the loss really does vanish for good. If you sell a stock at a loss in a taxable brokerage account and buy it back inside an individual retirement account within the window, the rule still applies, and there is no basis in an IRA to adjust upward. The IRS addressed this directly and the answer was not friendly to investors. The same trap is waiting in a Roth account, and it works the same way in a spouse's retirement account too. Nothing gets deferred and nothing gets recovered, because the replacement shares live in a wrapper the adjustment cannot reach. This is the single most expensive way to break the rule, and it usually happens by accident, because people think of the two accounts as separate worlds when the tax code does not.
The rule also reaches further across your household than most investors expect. It applies across all of your accounts at every firm, not just the one where the sale happened. It applies to purchases made by a spouse filing jointly. It applies to a corporation you control. Your broker only tracks washes inside a single account at a single firm, so the year end form you receive can look clean while your actual return is wrong. If you hold the same fund at two brokerages, or across a taxable account and a workplace plan, that reconciliation is on you and nobody else.
Automatic settings cause more wash sales than active trading does. Dividend reinvestment is the usual culprit, because a small reinvested purchase counts as a buy just like any other. Sell a fund at a loss on the tenth of the month, and a dividend that reinvests on the twenty fifth can wash the entire loss, even though the purchase was thirty dollars and the loss was three thousand. Automatic monthly contributions into the same fund do the same thing. Before you harvest a loss, turn off reinvestment and pause any scheduled buys in that position. Turn them back on after the window closes.
The phrase substantially identical is where the rule gets murky, and the IRS has never fully defined it. Selling shares of a company and buying a call option on that same company is treated as substantially identical. Selling one broad index fund and buying a similar fund from a different sponsor that tracks a different index is generally not, and that is the standard workaround for staying invested through the waiting period. Two funds tracking the exact same index from different sponsors sit in a grayer area than most articles admit. Bonds from the same issuer with different maturities and coupons are usually treated as different securities. When the answer is not obvious, a tax professional is cheaper than an amended return.
Keep the payoff in perspective before you build a strategy around this. Capital losses first offset capital gains of the same type, then the opposite type, and only three thousand dollars a year can be applied against ordinary income. Anything beyond that carries forward, with no expiration, for as long as you need it. Digital assets have been treated as property rather than securities for this purpose, which is why the rule has not applied the same way there, though lawmakers have repeatedly proposed closing that gap. The practical habit is simple. Write down the sale date, count thirty one days forward, and do not touch that position again until the calendar says you are clear.




