Understanding the Wash-Sale Rule
Investing in the stock market often involves managing losses just as much as managing gains. One of the most critical tax concepts for active traders and long-term investors alike is the “wash-sale rule.” If you are not careful, this IRS regulation can disallow a tax deduction you were counting on, potentially increasing your tax bill in April. This guide explains exactly how the rule works, how the math affects your portfolio, and how to legally navigate around it using specific examples.
What is the Wash-Sale Rule?
The IRS established the wash-sale rule to prevent investors from gaming the tax system. Specifically, they do not want you to sell a stock simply to claim a tax deduction (a capital loss) and then immediately buy it back to keep your position in the market.
According to the IRS, a wash sale occurs if you sell a security at a loss and then purchase that same security, or a “substantially identical” one, within a 61-day window.
The 61-Day Window Explained
The window is not just the 30 days after you sell. It wraps around the sale date. The period includes:
- The 30 days before the sale.
- The day of the sale itself.
- The 30 days after the sale.
If you buy the stock, an option on the stock, or a nearly identical ETF within this timeframe, your loss is disallowed.
Example: Imagine you bought 10 shares of Tesla (TSLA) for $250 per share. The price drops, and you sell them on December 1st for $200 per share. You have a $500 total loss.
- If you buy Tesla shares again on December 20th (within 30 days), the IRS triggers the wash-sale rule.
- You cannot deduct that $500 loss on your tax return for this year.
What Happens to the Disallowed Loss?
A common misconception is that the loss vanishes completely. In most cases involving standard taxable brokerage accounts, the loss is not lost forever; it is deferred.
When a wash sale occurs, the disallowed loss is added to the cost basis of the new shares you purchased. This effectively delays the tax benefit until you sell the new shares.
The Math of a Wash Sale:
- Original Trade: You buy 1 share of Apple (AAPL) for $180.
- The Sale: You sell that share for $160. You have a $20 loss.
- The Wash: Two weeks later, you buy 1 share of AAPL for $165.
- The Adjustment: Because you triggered the wash-sale rule, you cannot claim the $20 loss on your taxes yet. Instead, that $20 is added to the cost of your new share.
- New Cost Basis: Your new share has a cost basis of $185 ($165 purchase price + $20 disallowed loss).
Because your cost basis is higher, when you eventually sell this new share in the future, your taxable gain will be lower (or your loss will be larger), so you eventually recoup the tax benefit.
The Danger Zone: IRAs and 401(k)s
There is one specific scenario where the loss does vanish forever. This is the most dangerous trap for retail investors.
If you sell a stock for a loss in your taxable brokerage account (like an individual account at Fidelity or Robinhood) and repurchase the stock within the 30-day window inside your IRA or Roth IRA, the loss is permanently disallowed.
You cannot add the loss to the cost basis of the shares in the IRA because cost basis is irrelevant in tax-advantaged retirement accounts. The result is a “double whammy”: you lost actual money on the trade, and you lost the ability to reduce your taxes with that loss.
Defining "Substantially Identical"
The IRS uses the phrase “substantially identical” to define what triggers the rule. They do not provide a strict list of identical securities, but historical precedents offer clear guidelines.
Same Company, Different Ticker
Generally, preferred stock of a company and common stock of the same company are not considered substantially identical unless they have the same voting rights and dividend rates. However, buying a “Call Option” on a stock you just sold is considered substantially identical and will trigger the rule.
Mutual Funds and ETFs
This is where tax-loss harvesting strategies come into play. You can avoid the wash-sale rule by swapping a fund for a similar, but not identical, fund.
- Risk of Wash Sale: Selling the Vanguard S&P 500 ETF (VOO) and immediately buying the SPDR S&P 500 ETF Trust (SPY). Both funds track the exact same index (the S&P 500). The IRS could argue these are substantially identical.
- Generally Safe: Selling the Vanguard S&P 500 ETF (VOO) and buying the Vanguard Total Stock Market ETF (VTI). While their performance is correlated, they track different indices (S&P 500 vs. CRSP US Total Market). They have different management teams and hold a different number of stocks. This is a common strategy used by “robo-advisors” like Betterment and Wealthfront.
How to Avoid the Wash-Sale Rule
If you are sitting on losses and want to lower your tax liability without exiting the market entirely, you have options.
1. Wait 31 Days
The simplest method is patience. If you sell a stock like NVIDIA (NVDA) at a loss on November 1st, you must wait until December 2nd to repurchase it. During that month, you run the risk that the stock price might rebound without you.
2. The “Swap” Strategy
Sell the losing position and immediately buy a different asset that is correlated but not identical.
- Tech Sector: Sell a losing position in Microsoft (MSFT) and buy shares in a tech ETF like Technology Select Sector SPDR Fund (XLK). You stay invested in the tech sector, but since an ETF is not “substantially identical” to a single stock, you preserve your tax deduction.
- Banking: Sell Bank of America (BAC) and buy JPMorgan Chase (JPM). They are competitors with similar market movements, but they are clearly different companies.
3. Check Spousal Accounts
The IRS treats married couples filing jointly as a single economic unit. You cannot sell a stock at a loss in your account while your spouse buys the same stock in their account the next day. This will trigger a wash sale.
Frequently Asked Questions
Does the wash-sale rule apply to Cryptocurrency? As of late 2024, the wash-sale rule technically applies to securities (stocks, bonds, ETFs). The IRS currently classifies cryptocurrency (like Bitcoin or Ethereum) as “property,” not securities. This means the wash-sale rule has historically not applied to crypto, allowing traders to sell Bitcoin at a loss and buy it back immediately to harvest the tax loss. However, legislation has been proposed repeatedly to close this loophole. You should consult a CPA for the absolute latest status before attempting this with crypto assets.
Do brokers track wash sales for me? Yes and no. Brokerages like Charles Schwab, E*TRADE, and Fidelity are required to track wash sales that occur within the same account and will mark them on your 1099-B tax form. However, they do not track activity across different institutions. If you sell a stock at Fidelity and buy it at Vanguard, they won’t flag it, but it is still your legal responsibility to report it correctly to the IRS.
Does this apply to gains? No. The wash-sale rule only applies to losses. If you sell a stock for a profit and buy it back immediately, you simply owe taxes on the profit. The IRS has no problem with you realizing a taxable gain.