Tax Loss Harvesting 30 Day Rule: The Complete Guide to Avoid the Wash Sale

You sold some shares at a loss last month, feeling clever about locking in a tax deduction. Then, a week later, you bought the same stock again because you still believed in the company. Guess what? That clever tax move just vanished. The IRS calls this a "wash sale," and their 30-day rule is the single biggest trap for investors trying to do tax loss harvesting. Get it wrong, and you lose the deduction entirely. I've seen it happen too many times, even to savvy people.

What Exactly Is the 30-Day Wash Sale Rule?

Let's strip away the jargon. Tax loss harvesting is selling an investment that's down to realize a capital loss. You can use that loss to offset capital gains or even up to $3,000 of ordinary income each year. It's a powerful tool.

The wash sale rule (Internal Revenue Code Section 1091) is the IRS's way of saying, "You can't just sell for a tax break and immediately buy back the same thing." It disallows the loss if you buy a "substantially identical" security 30 days before or after the sale. That 61-day total window (30+1+30) is critical.

Think of it like this: The IRS wants to prevent paper losses from becoming real tax deductions unless you're actually changing your investment position. If you're right back in the same asset, they see it as a sham transaction.

The Nuts and Bolts: Time Windows and "Substantially Identical" Securities

Most people know about the 30 days after. The 30 days before is the silent killer. You buy more shares on October 1st. The stock drops, and you sell the original lot for a loss on October 15th. That loss is disallowed because you bought the "replacement" shares 14 days before the sale.

Now, "substantially identical." This is where interpretations get fuzzy and mistakes happen.

  • Clearly Identical: Selling Apple (AAPL) stock and buying Apple (AAPL) stock. This is a textbook wash sale.
  • Usually Safe Swaps: Selling an S&P 500 ETF from one provider (like IVV) and buying another S&P 500 ETF from a different provider (like VOO). The IRS hasn't explicitly blessed this, but the consensus among tax professionals is that they are not substantially identical because they track the same index but are different legal entities with different structures.
  • The Gray Zone: Selling shares of a company and buying deep-in-the-money call options of the same company. Many experts argue this is substantially identical. I'd avoid it.

The rule also applies across all your accounts—taxable, IRA, Roth IRA, even your spouse's accounts. Buying the security in your IRA within the window still triggers the wash sale. This is a trap.

Your ActionWithin 30-Day Window?Wash Sale Triggered?What Happens to Your Loss?
Sell VTI for a loss, wait 31 days, buy VTI again.NoNoDeductible. You waited out the full period.
Sell VTI for a loss, buy VTI 15 days later.YesYesDisallowed. The loss is added to the cost basis of the new shares.
Buy more VTI, sell original VTI shares at a loss 20 days later.Yes (bought BEFORE)YesDisallowed. The pre-sale purchase kills it.
Sell VTI for a loss in taxable account, buy VXUS (Total International Stock ETF) next day.N/ANoDeductible. Not substantially identical.
Sell VTI for a loss, spouse buys VTI in their IRA 10 days later.YesYesDisallowed. Spousal accounts are included.

A Step-by-Step Guide to Harvesting Losses Without Getting Washed Out

Let's walk through a real scenario. Meet John. He has 100 shares of TechGiant Inc. (Ticker: TECH) bought at $150/share, now trading at $100. He wants to harvest the $5,000 loss but remains bullish on the sector.

Step 1: Identify the Loss and the 61-Day Calendar

John checks his purchase history. Did he buy any TECH shares in the last 30 days? No. Good. He marks his calendar: The day he sells is Day 0. He cannot buy TECH again until Day 31.

Step 2: Find a Suitable Replacement (The Pivot)

John doesn't want to be out of the market. He needs a security that isn't "substantially identical" but keeps his portfolio's risk profile similar. He looks at a competitor, CloudMajors Corp (CLOD), or a tech sector ETF like XLK. He chooses XLK because it's diversified and tracks the sector, not a single company.

He sells all 100 shares of TECH at $100, realizing a $5,000 capital loss. Immediately, he invests the $10,000 proceeds into shares of XLK.

Step 3: The Waiting Game and Reversion

John waits 31 full days. On Day 32, he has a choice. He can stick with XLK if he's happy. Or, if he strongly prefers TECH, he can sell XLK (which may have a gain or loss) and buy back TECH. This second sale triggers a new taxable event, but the original $5,000 loss is safely locked in.

John's tax saving? If he's in the 24% federal bracket and uses the loss to offset ordinary income, he saves $1,200 on his tax bill ($5,000 * 24%). Not bad for a bit of paperwork.

Advanced Strategies and the Mistakes Everyone Makes

Here's where experience talks. The basics are simple. The execution is messy.

Dividend Reinvestment (DRIP): This is the #1 automated mistake. You turn off loss harvesting in December, but your DRIP automatically buys more shares on December 15th. If you sold for a loss on December 20th, wash sale. You must suspend DRIP in any security you plan to harvest at least 31 days before and after.

The "Substantially Identical" Blind Spot with Mutual Funds: Selling a Vanguard S&P 500 index fund and buying the Fidelity S&P 500 index fund is likely safe. But selling a Vanguard Total Stock Market Index fund and buying a Fidelity Total Stock Market Index fund? That's even safer, but the logic is the same. The real danger is assuming two different "Total Market" funds are identical—they might track slightly different indexes. Check the index they follow.

Tax-Lot Accounting Specifics: If you trigger a wash sale, the disallowed loss isn't gone forever. It's added to the cost basis of the replacement shares you bought. This defers the loss until you eventually sell those new shares. Your brokerage should track this on Form 1099-B, but don't blindly trust them. Keep your own records.

My non-consensus take? People obsess over avoiding the 30 days after but completely ignore the 30 days before. They also forget about retirement accounts. I once reviewed a portfolio where someone was meticulously harvesting in their taxable account but had automatic monthly purchases set up in their Roth IRA. They were violating the rule every single month without knowing it. The brokerage won't flag cross-account wash sales on your tax form.

Your Burning Questions Answered (The Tricky Ones)

If I sell a stock for a loss in my taxable account, can I immediately buy a similar ETF in my IRA without triggering the wash sale?
Buying any "substantially identical" security in any account you control (including IRAs) within the 61-day window triggers the wash sale for the loss in your taxable account. The rule is account-agnostic. So, selling TechGiant stock and buying a Tech Sector ETF in your IRA is probably fine (if they're not identical). But selling an S&P 500 fund and buying an S&P 500 fund in the IRA will likely disallow the loss.
Does the wash sale rule apply to cryptocurrency like Bitcoin?
Currently, the IRS treats cryptocurrency as property, not securities. The formal wash sale rule under Section 1091 does not apply. However, there are other anti-abuse doctrines the IRS could potentially apply. The safer approach is to treat significant, rapid round-trip transactions with caution, especially as regulatory guidance evolves. For now, it's a loophole, but don't be shocked if it closes.
How do I track the 30-day window across multiple trades and lots? My brokerage statement is a mess.
This is the practical nightmare. Brokers track per account, but you need a consolidated view. Use a portfolio tracking tool that allows tax-lot accounting (like specific ID). Before any loss-harvesting trade, manually review all transactions for that security and its close substitutes across all accounts for the past 30 days. Create a simple spreadsheet with purchase dates. It's tedious, but the alternative is an IRS adjustment years later. The automation promise of robo-advisors shines here—they handle this tracking for you.
I accidentally triggered a wash sale. Is it the end of the world?
No, but it nullifies your immediate tax plan. The disallowed loss gets added to the cost basis of the replacement shares you bought. You'll eventually realize that loss when you sell those new shares, but you've lost the time value of that tax deduction. It's a paperwork hassle and a missed opportunity for the current tax year. The key is to identify it yourself so you can report it correctly on Schedule D; don't wait for the IRS to find it.

Leave a Comment