You sold some stock at a loss last week, thinking you were smart about your taxes. Today, you see the price dipped again and think, "Great chance to buy back in." You click the buy button. Congratulations, you might have just triggered the IRS wash sale rule and disallowed your entire tax deduction. This isn't a rare mistake. I've seen it derail the tax plans of savvy investors more times than I can count. The core of the problem is a specific IRS regulation often called the tax-loss harvesting 30-day rule, or more formally, the wash sale rule.
It's a simple concept with maddeningly complex edges. Get it right, and you can strategically lower your tax bill by thousands. Get it wrong, and the IRS says "no deduction for you," turning a smart move into a paperwork headache. This guide isn't just a rehash of the basic rule. I'm going to walk you through the exact mechanics, show you the hidden traps most articles miss (like the ones involving your IRA), and give you a concrete plan to harvest losses without getting washed out.
What’s Inside This Guide
What Exactly Is the Wash Sale (30-Day) Rule?
Let's strip away the jargon. The wash sale rule, Internal Revenue Code Section 1091, says this: If you sell a stock, bond, option, or other security at a loss, you cannot claim that loss on your taxes if you buy a "substantially identical" security within 30 days before or after the sale. The window is 61 days total: the day of the sale, the 30 days before it, and the 30 days after it.
Key Takeaway: The rule isn't about preventing the transaction. You can still buy and sell as you please. It's about disallowing the tax deduction for the loss if you re-enter a similar position too quickly. The disallowed loss isn't gone forever; it's added to the cost basis of the newly purchased shares, deferring the tax benefit to a future sale.
Most investors fixate on the "30 days after" part. They wait a month after selling to repurchase. That's good, but it's only half the battle. The "30 days before" clause is the stealth bomber of tax mistakes. Let's say you bought 10 more shares of XYZ Fund on October 1st. Then, on October 15th, you sell your original, older shares of XYZ Fund at a loss. That October 1st purchase, which happened before the loss sale, triggers the wash sale rule for the number of shares you bought. The loss on those shares is disallowed.
Why Does This Rule Even Exist?
The IRS isn't trying to be difficult (though it often feels that way). The rule's purpose is to prevent artificial tax losses. Imagine this: It's December 27th. You own a stock that's down $5,000 from what you paid. You could sell it, claim a $5,000 capital loss to reduce your year's tax bill, and then immediately buy the stock back on January 2nd, maintaining your investment position. Without the wash sale rule, you'd get the tax benefit without any real change in your economic exposure. The IRS calls this an abuse, and the 30-day rule is their plug for that loophole.
It forces you to make a choice: take the tax loss and stay out of the identical security for over a month, accepting the market risk that comes with being out of the position. Or, keep your position and forgo the tax loss. This choice is the essence of tax-loss harvesting.
How to Legally Harvest Losses: A Step-by-Step Process
Here’s a practical, bulletproof method I recommend to clients. Forget theory; this is what you do.
Step 1: Identify the Loss
Look at your portfolio. Find holdings with an unrealized loss (your current price is below your purchase price). Focus on those where the loss is meaningful—don't bother for a $20 loss; the tax benefit is negligible. Consider your overall investment thesis for that holding. Is the loss due to a temporary dip in a company you still believe in, or is it a failing business you want to exit anyway? Your answer guides the next step.
Step 2: The Critical Replacement Decision
This is where strategy lives. You have two main paths:
Path A: Swap for a Similar, but Not "Substantially Identical," Security. This lets you maintain market exposure while staying within the rules. You sell the S&P 500 ETF "ABC" at a loss and immediately buy the S&P 500 ETF "XYZ." They track the same index but are from different issuers with different tickers and structures. The IRS has never clearly defined "substantially identical," but different ETFs tracking the same broad index are generally considered safe. Swapping Microsoft stock for Apple stock is definitely safe. Swapping one S&P 500 index fund for another might be risky if their holdings are virtually identical; consult a tax pro if you're unsure.
Path B: Go to Cash and Wait 31+ Days. Sell the loser, park the cash in a money market fund or short-term bonds, and wait out the full 30-day window. On day 31, you are free to buy back the exact same security. The risk? The market could rally significantly while you're in cash.
Step 3: Execute and Document
Sell the loss-making shares. If you chose Path A, buy the replacement security immediately. If Path B, set a calendar reminder for 31 days later to reconsider the purchase. Document everything. Note the sale date, the purchase date of any replacement, the tickers, and the number of shares. Your brokerage will likely flag wash sales on your 1099-B form, but their tracking can be imperfect, especially across accounts.
Hidden Traps and Common Mistakes
This is where most generic advice fails. Knowing the rule is easy. Spotting its invisible applications is hard.
Trap #1: The IRA and 401(k) Landmine. This is the big one. The wash sale rule applies across all your accounts—your taxable brokerage, your IRA (Traditional or Roth), and even your spouse's accounts. If you sell Tesla stock at a loss in your brokerage on Monday and your automatic IRA contribution buys a share of Tesla on Tuesday, you've triggered a wash sale. The loss in your taxable account is disallowed, and the cost basis adjustment goes... nowhere useful, because IRAs don't have taxable cost basis. The loss is permanently disallowed. I've seen this wipe out a whole year's harvesting strategy.
Trap #2: Dividend Reinvestment Plans (DRIP). If you have DRIP turned on, it's automatically buying more shares for you, often every quarter. If one of those automatic purchases falls within the 61-day window of a loss sale you made, it triggers a partial wash sale. Turn off DRIP on any security you plan to harvest for losses.
Trap #3: "Substantially Identical" Ambiguity with Options and Bonds. Selling a stock at a loss and buying a deep-in-the-money call option on the same stock is likely a wash sale. Selling a bond ETF at a loss and buying a different ETF holding very similar bonds may be too close for comfort. When in doubt, choose a clearer alternative.
Practical Scenarios and Examples
Let's make this real with a table and a story.
| Your Action | Timing Relative to Loss Sale | Wash Sale Triggered? | Why / Why Not |
|---|---|---|---|
| Buy 10 shares of Fund A | 15 days BEFORE selling Fund A at a loss | YES (for 10 shares) | Purchase within 30 days before the sale. |
| Sell Fund A at a loss | — | — | This is the loss sale event. |
| Buy 10 shares of Fund B (similar sector, different holdings) | 1 day AFTER the loss sale | NO | Funds are not "substantially identical." |
| Buy 10 shares of the SAME Fund A | 31 days AFTER the loss sale | NO | Outside the 30-day window. All clear. |
| Spouse buys 5 shares of Fund A in their IRA | 10 days AFTER your loss sale | YES (for 5 shares) | Rule applies to spouse's accounts. |
Jane's Year-End Tax Fiasco (A True Story Vibe): Jane is a sharp investor. In early November, she sells her position in a tech ETF (ticker: TECH) for a $4,000 loss, planning to harvest it. She immediately reinvests in a different tech ETF (ticker: GADGET). So far, so good. On December 15th, she gets a bonus and decides to max out her Roth IRA for the year. Without thinking, she buys the original TECH ETF in her Roth. Boom. The December purchase is within 30 days of her November sale. The wash sale rule is triggered, disallowing $4,000 of her loss. Because the repurchase was in an IRA, the cost basis adjustment is lost forever. Her smart move cost her about $1,000 in potential tax savings (assuming a 25% tax rate). The fix? She should have bought GADGET in her Roth too, or waited until mid-January to buy TECH.
Tools and Tactics for Tracking the 30-Day Window
You can't do this in your head. Here’s what works:
Brokerage Tools: Most major brokerages (Fidelity, Vanguard, Charles Schwab) have a "tax-lot" or "gain/loss" view that can show unrealized losses and may have wash sale indicators. Rely on them as a first alert, but not as your sole system.
The Simple Calendar Method: When you harvest a loss, immediately create a calendar event for 31 days later titled "OK to repurchase [TICKER]." Block off the 61-day window (30 days before and after) in your mind for that security across all accounts.
The Spreadsheet: For active harvesters, a simple spreadsheet works wonders. Columns: Security Sold | Date Sold | Loss Amount | Replacement Security (if any) | Date 31-Day Window Ends | Notes (e.g., "DRIP off"). Update it every time you execute a sale.
The goal is to create a system that forces you to check before any purchase of a security you've recently sold at a loss.
Your Wash Sale Rule Questions Answered
Mastering the tax-loss harvesting 30-day rule is less about memorizing code and more about building disciplined habits. It's a powerful tool that turns market downturns into future tax savings. But its power comes with precise boundaries. Map your 61-day windows, watch your spouse's accounts and your IRAs like a hawk, and always have a plan for your cash or your replacement security before you hit "sell." Do that, and you'll harvest losses successfully, turning a potential tax trap into a legitimate financial advantage.
Reader Comments