Selling an investment at a loss can sometimes create a tax benefit. Losses can offset capital gains and, within limits, other income. The wash sale rule exists to stop investors from claiming a loss while keeping essentially the same position. If you sell a security at a loss and buy the same or a substantially identical security within a short window around the sale, the loss is generally disallowed for now. Understanding the rule is important for anyone who uses tax-loss harvesting or trades actively. If you want help reviewing your approach, a complimentary, no-obligation wealth and tax review can help.
This guide explains how the wash sale rule generally works, what counts as substantially identical, how the rule applies across accounts, and how investors commonly plan around it.
How the Wash Sale Rule Works
The rule generally applies when you sell or trade a security at a loss and, within a set number of days before or after the sale, you buy a substantially identical security, acquire it in a fully taxable trade, or acquire a contract or option to buy it. The window covers both sides of the sale, so a purchase shortly before the sale can trigger the rule just as a purchase after it can.
When the rule applies, the loss is not permanently lost in most cases. Instead, the disallowed loss is generally added to the cost basis of the replacement shares, and the holding period of the original shares carries over. The tax benefit is deferred until the replacement shares are sold in a transaction that does not trigger another wash sale.
What Counts as Substantially Identical
The tax code does not provide a precise definition, which leaves some gray area. Generally:
Shares of the same company are substantially identical
Options or contracts to buy the same stock can trigger the rule
Two index funds tracking the same index from different providers may raise questions, and practitioners take different views
Funds tracking different indexes, or stocks of different companies in the same industry, are generally not considered substantially identical
Because this is a judgment area, many investors choose replacement holdings that provide similar market exposure without tracking the exact same index. A tax professional can help you evaluate a specific swap.
Wash Sales Across Accounts
The rule is not limited to a single brokerage account. Purchases in other taxable accounts you own can trigger it, and a spouse's purchases may also be relevant. Purchases in IRAs and Roth IRAs deserve special attention. If you sell a stock at a loss in a taxable account and buy it in an IRA within the window, the loss may be disallowed, and because the replacement is inside a retirement account, the basis adjustment may not help you later. In that situation, the loss can effectively be lost.
Automatic investment features can cause accidental wash sales. Dividend reinvestment, recurring purchases, and employer stock purchase plans may buy shares within the window without you thinking about it. Coordinating these features with any planned loss sales is an important step.
Tax-Loss Harvesting and the Wash Sale Rule
Tax-loss harvesting involves realizing losses to offset gains while keeping a portfolio invested. A common approach is to sell a holding at a loss and immediately buy a different but similar investment, then decide later whether to switch back after the window passes. Done thoughtfully, this can maintain market exposure while creating a loss for tax purposes.
Harvesting has tradeoffs. A lower cost basis on the replacement can mean larger gains later, so harvesting often defers tax rather than eliminating it. Transaction costs, tracking differences, and the effort to monitor the window all matter. Our article on direct indexing and tax-loss harvesting explains one way investors apply this at the individual stock level, and tax-efficient investing strategies puts harvesting in a broader context.
Reporting Wash Sales
Brokerage firms generally report wash sales they can identify within the same account on Form 1099-B, including adjustments to basis. They often cannot see purchases in your other accounts or your spouse's accounts. That means you, or your tax preparer, may need to identify and report wash sales the broker did not catch. Keeping a record of trades across accounts during harvesting periods can make this easier at tax time.
Common Wash Sale Mistakes
Buying back the same stock a few days after selling it at a loss
Forgetting about dividend reinvestment in the same security
Repurchasing the security in an IRA or Roth IRA
Assuming the broker's 1099-B captures wash sales across all accounts
Harvesting at year end without reviewing purchases made in the prior weeks
Coordinating With Your Broader Plan
The wash sale rule is one piece of a larger tax-aware investment approach. Decisions about which lots to sell, when to realize gains, and how to balance accounts across a household all interact. Coordinated wealth management and tax planning can help keep these decisions consistent throughout the year rather than rushed in December.
A Year-End Checklist for Harvesting Losses
Many investors look at harvesting losses near the end of the year, when they have a clearer view of realized gains. A simple checklist can reduce the chance of a wash sale or other surprise:
Review realized gains and losses for the year across all taxable accounts
Identify positions with unrealized losses and confirm their cost basis by lot
Check for purchases of the same securities in the prior weeks, in every account, including IRAs
Pause dividend reinvestment and automatic purchases in securities you plan to sell
Choose replacement investments that fit your allocation without being substantially identical
Note the date when the window closes if you intend to return to the original holding
Coordinate with a spouse whose accounts may hold the same securities
It also helps to consider the bigger picture before harvesting. Losses may be more valuable in a year with large gains, such as after the sale of a business or property, than in a year with little income. Our guide to how to reduce capital gains tax covers related strategies.
Next Steps
Whether you invest from Madison, Waunakee, or anywhere in Wisconsin, the wash sale rule is worth understanding before you harvest losses. A little coordination across accounts can help you avoid surprises on your tax return.
To review how your portfolio and tax return work together, request a complimentary, no-obligation wealth and tax review.
Frequently Asked Questions
What is a wash sale?
A wash sale generally occurs when you sell a security at a loss and buy the same or a substantially identical security within the window before or after the sale.
Is the loss gone forever?
Usually not. The disallowed loss is generally added to the basis of the replacement shares. An exception can arise when the replacement is purchased in an IRA.
Does the rule apply across different accounts?
Yes. Purchases in your other accounts, and potentially a spouse's accounts, can trigger the rule.
Can dividend reinvestment cause a wash sale?
It can. Reinvested dividends in the same security within the window may trigger a partial wash sale.
Are two different index funds substantially identical?
It depends. Funds tracking different indexes are generally viewed as different, while funds tracking the same index are a gray area. Discuss specific swaps with a tax professional.
Compound is a registered investment adviser. Registration does not imply a certain level of skill or training. This article is for informational and educational purposes only and should not be construed as personalized investment, tax, or legal advice. Tax laws are complex and subject to change. Strategies discussed may not be suitable for everyone, and there is no guarantee that any strategy will achieve its objectives or reduce taxes. Investing involves risk, including possible loss of principal. Please consult your tax, legal, and financial professionals before acting on any information in this article. For more information, see Compound's Form ADV, available at adviserinfo.sec.gov.
Information may be generalized or subject to change. Please contact our team for the most current and accurate information.
About Compound Wealth
Tax planning often intersects with investment decisions, business ownership, retirement planning, and other financial considerations. Compound Wealth provides an integrated approach that combines tax planning, wealth management, accounting, and business transition services to help clients evaluate financial decisions from multiple perspectives as part of an ongoing planning process.