Tax Loss Harvesting Rules: The IRS Guide for 2026
Most articles about tax loss harvesting spend their time explaining why it works. This one focuses on the constraints โ the precise IRS rules that determine when a harvested loss is valid, when it is disallowed, and how much of it you can actually use in a given year. Understanding the strategy is one thing. Knowing exactly where the edges are is what separates investors who capture the full benefit from those who inadvertently give it back.
The rules governing capital losses in the United States are not especially complicated, but they interact with each other in ways that matter significantly at the margins. A loss that is disallowed under the wash sale rule is not gone forever, but the timing consequence can be substantial. A carryforward loss that is misapplied can leave money on the table for years. Getting these details right is not a technicality โ it is where a large fraction of the strategy's real-world value lives.
What the IRS allows: the basic framework
Under the Internal Revenue Code, a taxpayer who sells a capital asset โ a stock, bond, ETF, mutual fund, or other investment โ at a price below their adjusted cost basis realizes a capital loss. That loss is a recognized tax event, meaning it exists for tax purposes regardless of whether any money actually left the account. It can be used to offset capital gains realized elsewhere in the same tax year, dollar for dollar.
If total capital losses for the year exceed total capital gains, the excess loss can offset up to $3,000 of ordinary income per year ($1,500 if married filing separately). Any remaining loss that cannot be used in the current year does not disappear โ it carries forward indefinitely to future tax years, retaining its character as either short-term or long-term, until it is fully absorbed.
This structure means that a harvested loss is always useful. Even an investor who has no capital gains in a given year can harvest losses to offset ordinary income or to build a carryforward balance that reduces future tax bills. The benefit is real in either case โ it is simply a question of when it arrives.
Short-term versus long-term: the classification that determines the value
Every capital gain and every capital loss is classified as either short-term or long-term, based on the holding period of the asset sold. If you held the asset for one year or less before selling, the gain or loss is short-term. If you held it for more than one year, it is long-term. This classification matters because short-term and long-term losses are applied against gains of the same character first.
Specifically: short-term capital losses first offset short-term capital gains, which are taxed at ordinary income rates of up to 37%. Long-term capital losses first offset long-term capital gains, taxed at the preferential rates of 0%, 15%, or 20%. When losses in one category exceed gains in that category, the excess spills over to offset gains in the other. If total losses in both categories still exceed total gains, up to $3,000 of the net loss offsets ordinary income.
The practical implication is that a short-term loss harvested against a short-term gain is worth more per dollar than a long-term loss harvested against a long-term gain, because it reduces tax at a higher rate. For an investor in the 37% federal income bracket, a $10,000 short-term gain costs $3,700 in federal tax. That same investor using a $10,000 short-term loss to offset it saves the full $3,700. The same $10,000 long-term gain, at the 20% rate, costs only $2,000 to offset.
The wash sale rule: Section 1091 of the Internal Revenue Code
The wash sale rule, codified in Section 1091 of the Internal Revenue Code, is the primary constraint on tax loss harvesting. It states that if you sell a security at a loss and, within 30 days before or after the sale, you purchase the same security or one that is "substantially identical," the loss is disallowed. The 61-day window โ 30 days before the sale, the day of the sale, and 30 days after โ is the critical interval to track.
When a loss is disallowed under the wash sale rule, it is not eliminated โ it is deferred. The disallowed loss amount is added to the cost basis of the newly purchased shares. This means the investor will eventually recognize the loss when those replacement shares are sold, as long as no new wash sale occurs. The consequence is not a permanent loss of the tax benefit, but a delay โ and depending on your tax situation, the timing of that delay can cost real money.
What counts as "substantially identical"?
The IRS has never issued a comprehensive definition of "substantially identical," and the question is one of the more persistently uncertain areas of tax loss harvesting practice. What is clear: selling a stock and buying back the exact same stock is a wash sale. Selling a fund and buying back the exact same fund is a wash sale. Selling a Treasury bond and buying a nearly identical Treasury bond with the same maturity and coupon is likely a wash sale.
What is generally considered not substantially identical: selling one S&P 500 ETF and buying a different S&P 500 ETF from a different issuer (e.g., selling SPY and buying IVV, or selling VOO and buying SCHX). Selling a stock and buying an ETF that holds that stock among many others. Selling a bond and buying a bond with meaningfully different maturity or issuer. The key question the IRS applies is whether the two securities are so similar in nature that owning either one would give the investor essentially the same economic exposure.
One important note for 2026: the wash sale rule currently applies only to stocks and securities, as defined in the Internal Revenue Code. Cryptocurrency is not currently classified as a security under that definition, which means that selling Bitcoin at a loss and buying it back the next day does not trigger a wash sale under current law. This treatment may change โ there have been repeated legislative proposals to extend wash sale rules to digital assets โ but as of the 2026 tax year, crypto investors retain the ability to harvest losses and repurchase immediately.
The cross-account wash sale trap
The wash sale rule applies across all accounts you own or control, not just the account in which the sale occurred. This is the most commonly overlooked dimension of the rule, and one of the most consequential. If you sell a stock at a loss in your taxable brokerage account, and your IRA or 401(k) holds the same stock and receives a dividend reinvestment that purchases additional shares within the 61-day window, you have triggered a wash sale in your taxable account โ even though the IRA purchase was automatic and unintentional.
The outcome in this scenario is particularly damaging: the loss is disallowed in the taxable account, but because IRA accounts do not track cost basis in the same way, the disallowed loss cannot be added to the IRA's cost basis either. The loss is effectively permanent โ not deferred, but gone. This is the one situation in tax loss harvesting where a wash sale causes irreversible harm rather than a timing problem.
Avoiding this requires tracking purchases across all accounts simultaneously โ taxable accounts, IRAs, Roth IRAs, 401(k)s, and any accounts held by a spouse. Automatic dividend reinvestment plans in any of these accounts can silently trigger wash sales against losses harvested in taxable accounts. This is precisely the kind of multi-account coordination problem that is extremely difficult to manage manually and extremely easy to handle with automated tax management software.
The $3,000 ordinary income offset rule
When net capital losses โ after offsetting all capital gains โ exceed zero, the IRS allows taxpayers to deduct up to $3,000 of the remaining loss against ordinary income in the current tax year. For a single filer at the 37% federal marginal rate, this $3,000 deduction is worth $1,110 in federal tax savings. For married filing separately, the limit is $1,500 per spouse. This limit has not been adjusted for inflation since it was set in 1978, which means its real value has declined substantially โ but the benefit remains real.
Any net capital loss beyond the $3,000 threshold carries forward to the following tax year. The carryforward loss retains its original character โ a short-term loss carryforward remains short-term in future years, and a long-term loss carryforward remains long-term. This matters because, as described above, the character of the loss determines which category of gains it first offsets in future years.
Cost basis accounting methods: which lots you sell matters as much as when
When you own multiple tax lots of the same security โ purchased at different times and different prices โ the IRS requires you to choose an accounting method for identifying which shares you are selling. The method you use determines your cost basis, and therefore the size and character of any gain or loss you recognize. The IRS permits several methods for different types of securities.
For stocks and ETFs held in taxable accounts, the default method โ if you do not make an election โ is FIFO (first in, first out): the shares you purchased earliest are treated as the shares sold first. This is almost always suboptimal for tax purposes, particularly for investors who have held a position for many years and whose oldest shares carry the lowest cost basis and therefore the largest embedded gain.
The alternative the IRS permits is specific identification (also called "specific lot identification" or the "spec ID" method). Under this method, you explicitly designate which tax lots you are selling at the time of the sale, and your broker records the instruction. This allows you to choose the highest-cost lots โ minimizing your gain โ or lots held for just over a year to secure long-term treatment, or lots currently at a loss to harvest them intentionally. Specific identification requires that you make the designation before or at the time of the sale; you cannot go back and retroactively reassign lots after the fact. For mutual funds, the IRS also permits average cost basis as an alternative method, though this forfeits the ability to do precise lot-level optimization.
The net investment income tax: an additional layer for high earners
For taxpayers whose modified adjusted gross income exceeds $200,000 (single filers) or $250,000 (married filing jointly), capital gains are subject to an additional 3.8% net investment income tax (NIIT) under Section 1411 of the Internal Revenue Code, introduced by the Affordable Care Act. This tax applies on top of the regular capital gains rates โ bringing the maximum federal rate on long-term capital gains to 23.8% for affected investors.
Harvested losses reduce net investment income dollar for dollar, making tax loss harvesting even more valuable for investors subject to the NIIT. A $50,000 gain offset by $50,000 in harvested losses saves not just the standard capital gains tax but also the $1,900 in NIIT that would have applied (3.8% ร $50,000). At the combined 23.8% federal rate, the same $50,000 of net gain eliminated saves $11,900 in federal taxes.
State tax rules: a separate overlay that varies significantly
Federal rules govern how the IRS treats your capital losses, but state income taxes add a separate layer that varies considerably by jurisdiction. Most states that have an income tax follow federal treatment of capital gains and losses โ losses offset gains and carry forward if unused. However, some states have their own specific rules. California, for example, taxes long-term capital gains at the same rate as ordinary income (up to 13.3% in 2026), making harvesting particularly valuable for California residents. A handful of states, including Florida, Texas, and Nevada, have no state income tax at all, so the state-level benefit of harvesting is zero for residents of those states (though the federal benefit remains).
Some states do not allow net capital loss deductions against ordinary income, or cap the deduction at a different amount than the federal $3,000. A few states also have different holding period thresholds for long-term treatment. Investors in high-tax states โ California, New York, New Jersey, Oregon, Minnesota โ should calculate their state and federal tax savings together when evaluating the benefit of any individual harvest, as the combined marginal rate can exceed 35% even on long-term gains.
The year-end deadline and why it matters less than most investors think
Tax losses must be realized โ meaning the sale must settle โ by December 31 to count against the current tax year. Stock trades in the United States settle in one business day (T+1), meaning a sale executed on December 31 will settle on January 2 and does not count for the current year. In practice, investors who want a harvest to apply to the current year should execute the trade no later than December 30 in a normal week, accounting for potential holiday closures.
This deadline is real, but the fixation on year-end harvesting misunderstands where most of the value actually lies. Markets are volatile throughout the year. Positions move in and out of loss territory continuously. A stock that is at a $15,000 loss in April may have recovered to a $5,000 gain by December โ and the April harvest opportunity is gone forever. Investors who treat harvesting as an annual December task will systematically underperform those who monitor continuously and harvest losses as they emerge, regardless of the time of year.
A summary of the rules every harvesting investor must know
To harvest a loss validly: sell the security at a price below your adjusted cost basis, do not purchase the same or substantially identical security within 61 days centered on the sale date, and document which specific lots you are selling if using the specific identification method. The loss is then available to offset capital gains of the same character first, then gains of the opposite character, then up to $3,000 of ordinary income, with any remainder carrying forward indefinitely.
To avoid wash sales: track purchases across all accounts you control, including IRAs and accounts managed by a spouse. Suspend automatic dividend reinvestment on positions you intend to harvest. Choose replacement securities that are economically similar but not substantially identical โ generally, a different fund tracking a different but correlated index is safe, while a different share class of the same fund is not.
The rules themselves are manageable. What is difficult is applying them continuously, across a real portfolio with many positions and multiple accounts, throughout a full year of market movements. That is the problem that separates investors who capture most of the available tax alpha from those who capture only a fraction of it โ and it is exactly what systematic, automated tax management is built to solve.

