Tax-Loss Harvesting Without Tripping the Wash-Sale Rule
The Setup
Tax-loss harvesting is the deliberate sale of a security trading below its cost basis to realize a capital loss, which is then used to offset realized capital gains and — up to a limit — ordinary income. Under IRS rules for capital gains and losses, realized losses first offset realized gains of the same character, then net against the opposite character, and any remaining net capital loss offsets up to $3,000 of ordinary income per year ($1,500 if married filing separately). Losses beyond that carry forward indefinitely. The benefit is real and recurring: in volatile years, a disciplined harvester can bank a meaningful loss inventory even while the portfolio's pre-tax return is positive — because individual positions, not the aggregate, are what get harvested.
The trap sits in Internal Revenue Code §1091, the wash-sale rule. If you sell a security at a loss and buy a "substantially identical" security within 30 days before or after the sale — a 61-day window centered on the trade — the loss is disallowed for the current year and instead added to the basis of the replacement position. The economic loss is not destroyed; it is deferred. But for an investor harvesting specifically to use the loss this tax year, a disallowed loss is a failed harvest.
The Read
The framework to apply is mechanical, not discretionary. Tax-loss harvesting done right is a checklist executed under a calendar, not a judgment call made in the moment. There are four parts: the 61-day window, the "substantially identical" test, the account-aggregation trap, and the basis-tracking discipline.
The 61-Day Window Is Symmetric
The most common misconception is that the wash-sale window runs only forward from the sale. It does not. Per IRS Publication 550, the disallowance triggers if substantially identical securities are acquired in the period beginning 30 days before and ending 30 days after the loss sale. A purchase you made three weeks before deciding to harvest can disallow the loss just as easily as one made after. This matters most for investors who dollar-cost-average or reinvest dividends automatically: an automatic reinvestment three days before a harvest sale can taint part of the loss. Turn off automatic dividend reinvestment in any account where you intend to harvest.
"Substantially Identical" Is the Whole Game
The rule disallows the loss only when the replacement is "substantially identical" — a term the IRS deliberately leaves without a bright-line definition. The defensible reading: the same security, or an option/contract to acquire it, is clearly identical. Two different issuers' common stock are not. The interesting zone is funds. Selling one S&P 500 index fund and buying a different issuer's S&P 500 index fund tracks the identical index — many practitioners treat that as too close. Selling an S&P 500 fund and buying a total-market or large-cap-blend fund with a different underlying index is the standard conservative replacement: it keeps the investor's market exposure continuous while clearing the substantially-identical bar. The principle is to maintain exposure to the same asset class without holding the same security across the window.
The Account-Aggregation Trap Catches IRAs
A wash sale is evaluated across all of a taxpayer's accounts, not just the one where the loss was realized — and per IRS guidance on IRAs, a purchase of the substantially identical security in your IRA within the window disallows the loss in your taxable account and gives you no basis step-up in the IRA to recover it later. This is the harshest version of the rule: the loss is permanently lost, not merely deferred, because IRA basis adjustments don't flow through to taxable gains. A loss harvested in a taxable brokerage account while a 401(k) target-date fund quietly buys the same underlying index in the same window is the textbook unforced error. Map every account before harvesting, including a spouse's.
Basis Tracking Is the Audit Defense
When a wash sale does occur, the disallowed loss is added to the basis of the replacement shares and the holding period of the sold shares tacks on. Brokers report wash sales on Form 1099-B for identical securities in the same account, but they are not required to track across accounts or across substantially-identical-but-not-identical funds. The investor owns that tracking. Keep a harvest log: date sold, security, loss amount, replacement bought, date, and the 61-day clear date. The log is both the planning tool and the documentation if the return is ever questioned.
The Action
- Before any harvest sale, list every account you and your spouse control — taxable, IRA, Roth, 401(k), HSA — and confirm none will buy a substantially identical security in the 61-day window (30 days before through 30 days after). The cross-account check is the step most investors skip.
- Turn off automatic dividend reinvestment and scheduled contributions into the harvested security across all accounts before selling, so an automatic buy can't taint the loss from the "before" side of the window.
- Pre-select a replacement that keeps your asset-class exposure continuous but is not substantially identical — typically a fund tracking a different index of the same asset class. Decide it in advance so you are never out of the market waiting to choose.
- Maintain a harvest log with the 61-day clear date for each lot, and only rotate back into the original security after that date passes if you want the original holding restored.
- Harvest opportunistically through the year on drawdowns, not only in December — the loss inventory compounds, and waiting for year-end concentrates the work into the least liquid, most crowded harvesting window.
The Counter
The strongest objection is that harvesting only defers tax rather than eliminating it: selling at a loss and rebuying lowers your basis, so a larger gain is realized later when the replacement appreciates. This is correct and it is the honest limit of the strategy. The benefit is the time value of the deferred tax plus the possibility of realizing the eventual gain at a lower future rate, in a lower-income year, or — for buy-and-hold investors — never, via the step-up in basis at death that wipes out the deferred gain entirely. Harvesting is most valuable for investors with a long horizon and recurring realized gains to offset; it is close to worthless for someone in the 0% long-term capital gains bracket, where there is no gain to shelter. The second objection is transaction and tracking cost: for a small portfolio, the dollar value of a harvested loss may not justify the operational overhead and the risk of an error that permanently disallows the loss. The rule of thumb is that the strategy earns its complexity in taxable accounts large enough that a single harvest offsets four figures of gains — and only when the investor (or their software) tracks the wash-sale window across every account rigorously.
Primary Sources
- 26 U.S. Code §1091 — Loss from wash sales of stock or securities — Cornell Legal Information Institute
- IRS Publication 550 — Investment Income and Expenses (Wash Sales section) — Internal Revenue Service
- IRS Topic No. 409 — Capital Gains and Losses — Internal Revenue Service
- IRS — Individual Retirement Arrangements (IRAs) — Internal Revenue Service