Tax-loss harvesting lets you sell investments at a loss to offset capital gains and up to $3,000 of ordinary income per year.[2] Losses beyond that carry forward indefinitely.[3] The wash-sale rule prohibits repurchasing the same security within 30 days of the sale, but you can immediately buy a similar (not identical) investment to maintain market exposure.
How Capital Loss Netting Works
The IRS requires you to net capital gains and losses in a specific sequence before determining your tax liability (IRC §1222):[4]
- Net all short-term gains and losses → get a net short-term number (short-term = held ≤1 year)
- Net all long-term gains and losses → get a net long-term number (long-term = held >1 year)
- If both results have the same sign (both gains or both losses), they remain separate for rate purposes
- If one is a gain and the other a loss, net them against each other
- Net capital losses (after netting) offset ordinary income up to $3,000/year[2]
- Any remaining net capital loss carries forward to future years[3]
Short-term losses are most valuable because they first offset short-term gains (taxed as ordinary income at rates up to 37%) before offsetting long-term gains (taxed at 0%, 15%, or 20%). A $10,000 short-term loss used to offset a $10,000 short-term gain saves up to $3,700 vs. $2,000 if used to offset a long-term gain.
The Wash-Sale Rule: The Main Constraint
IRC §1091[1] disallows a loss if within the 61-day window centered on the sale date (30 days before + day of sale + 30 days after) you acquire a "substantially identical" security. Key points:
- Applies to purchases in a taxable account, IRA, or Roth IRA — not just the same account
- The disallowed loss is added to the cost basis of the replacement shares (deferred, not eliminated)
- "Substantially identical" clearly covers the same stock or fund and does not cover stock of a different company; funds from different issuers that track the same index (e.g., a Vanguard S&P 500 ETF and an iShares S&P 500 ETF) are a gray area the IRS has not ruled on
- Index funds tracking different indexes are generally safe (e.g., selling S&P 500 exposure and replacing with total stock market)
Worked Example: Tax-Loss Harvesting in Practice
Investor holds two positions in a taxable account in November 2026:
- Stock A (held 18 months): cost basis $50,000, current value $65,000 → $15,000 long-term gain if sold
- Stock B (held 14 months): cost basis $30,000, current value $18,000 → $12,000 long-term loss if sold
The investor needs to sell Stock A for liquidity. Without harvesting:
- Tax on $15,000 long-term gain at 15% rate: $2,250
With harvesting (selling both A and B):
- Net long-term gain: $15,000 − $12,000 = $3,000
- Tax on $3,000 at 15%: $450
- Tax saved: $1,800
The investor can immediately replace Stock B with a similar (not substantially identical) position — for example, selling an individual stock and replacing with a sector ETF, or selling one broad index ETF and replacing with another covering a slightly different index. The replacement maintains market exposure while the loss is locked in.
Capital Loss Carryforward: Using Losses Over Multiple Years
If your net capital loss exceeds $3,000, the excess carries forward to future years with no time limit (IRC §1212).[3] Carryforward losses retain their character (short-term or long-term). In a year with no capital gains, you can still deduct $3,000 against ordinary income.[2] In a year with capital gains, the carryforward offsets them first.
Example: You have a $25,000 net capital loss carryforward entering 2026. In 2026, you have $10,000 in capital gains. The $25,000 carryforward first offsets the $10,000 gain (leaving $15,000 carryforward), then $3,000 is applied to ordinary income, leaving $12,000 to carry into 2027.
When Tax-Loss Harvesting Has Limited Value
- 0% long-term capital gains bracket: Taxpayers with taxable income up to $49,450 (single, 2026) owe 0% federal on long-term gains — using harvested losses to offset gains that would have been taxed at 0% provides no tax benefit[6]
- Short holding period: If the replacement investment is sold shortly after purchase (triggering a short-term gain), you may pay more in short-term rates than you saved by harvesting
- Small accounts: The administrative complexity may outweigh benefits for very small loss amounts
- High-basis, low-value positions you plan to hold forever: If you will hold until death (stepped-up basis), there is no future tax to harvest against
Use our capital gains tax calculator to see how harvested losses reduce your net capital gains tax for any income level and state. See also our guide on the wash-sale rule for the constraints on this strategy.