If an investment in a taxable brokerage account is worth less than you paid for it, selling it before December 31 turns that paper loss into a tax deduction. Then you reinvest the money in something similar so your portfolio stays on track. That is tax-loss harvesting. Done right, it can cut this year’s tax bill by hundreds or thousands of dollars without changing your long-term plan.
The rules are simple, but a couple of them catch people every year, and the benefit is often smaller than it first appears. This guide covers both.
How Capital Losses Offset Taxes
When you sell an investment for less than its cost basis, the difference is a capital loss. The IRS lets you use those losses in a fixed order:
- Losses offset gains of the same type first. Short-term losses (assets held one year or less) offset short-term gains. Long-term losses offset long-term gains.
- Any remaining loss crosses over to offset the other type of gain.
- Up to $3,000 of net loss can then offset ordinary income such as wages ($1,500 if married filing separately).
- Anything left carries forward to future years with no expiration, following the same order each year.
This order matters because short-term gains are taxed at your ordinary income rate, while long-term gains get lower rates. Here are the 2026 long-term capital gains brackets, based on taxable income:
| Long-Term Rate | Single | Married Filing Jointly |
|---|---|---|
| 0% | Up to $49,450 | Up to $98,900 |
| 15% | $49,451 to $545,500 | $98,901 to $613,700 |
| 20% | Over $545,500 | Over $613,700 |
Higher earners may also owe the 3.8% net investment income tax once modified AGI passes $200,000 (single) or $250,000 (joint). Our guide on how tax brackets work explains how these layers stack on top of your ordinary rate.
A Worked Example
A married couple with about $180,000 of taxable income is in the 24% federal bracket. Earlier this year they sold some company stock for an $8,000 long-term gain. They also own an index fund, bought in early 2025 for $40,000, that is now worth $29,000.
| Step | Amount | Tax Effect |
|---|---|---|
| Sell the index fund, realizing a long-term loss | −$11,000 | |
| Offset the long-term gain | $8,000 | $1,200 saved at 15% |
| Deduct against ordinary income | $3,000 | $720 saved at 24% |
| Federal tax saved this year | $1,920 |
They reinvest the $29,000 the same day in a similar but not identical fund, so their market exposure barely changes.
The Wash-Sale Rule
The IRS disallows the loss if you buy the same or a “substantially identical” security within 30 days before or after the sale. That is a 61-day window in total. A disallowed loss isn’t gone forever. It is added to the cost basis of the replacement shares, but you lose the deduction this year, which defeats the purpose.
The rule reaches further than most people expect:
- It covers all your accounts. Buying the same fund in your IRA or 401(k) within the window triggers it. In that case the loss is permanently lost, because the basis adjustment can’t carry into a retirement account.
- It covers your spouse. A purchase in your spouse’s account counts.
- It covers automatic purchases. Dividend reinvestment and scheduled contributions into the same fund can trigger a partial wash sale. Turn them off for that fund during the window.
The IRS has never precisely defined “substantially identical.” Two S&P 500 index funds from different companies hold nearly the same stocks, and many tax professionals treat that swap as risky. A common, more defensible approach is to switch to a fund that tracks a different index, such as moving from an S&P 500 fund to a total U.S. market fund. After 31 days you can switch back if you want.
For stocks and ETFs, the trade date determines the tax year. A sale executed on December 31 counts for this year even though it settles in January. Mutual fund orders placed after the market close are filled at the next trading day’s price, so don’t wait until the last afternoon.
What Harvesting Really Saves
Tax-loss harvesting mostly defers tax rather than eliminating it. In the example, the couple’s new fund has a cost basis of $29,000 instead of $40,000. When they eventually sell, their gain will be $11,000 larger. At a 15% long-term rate, that is $1,650 of future tax.
So why bother? Three reasons:
- Rate arbitrage. The $3,000 used against wages saved 24% today. If it is taxed later at the 15% long-term rate, the swap is a permanent gain. The same applies when a loss offsets short-term gains taxed at ordinary rates.
- Time value. Money not paid in tax today stays invested and compounds. See the time value of money for why a dollar of tax paid in 20 years costs much less than a dollar paid now.
- The deferred tax may never come due. Shares held until death generally receive a stepped-up basis for heirs. Shares donated to charity avoid the gain too. And if you sell in a year when your income puts you in the 0% bracket, the deferred gain is taxed at nothing.
When Harvesting Isn’t Worth It
- Retirement accounts. Losses inside an IRA, 401(k), or HSA are not deductible. Harvesting only works in taxable accounts.
- You are already in the 0% long-term bracket. Offsetting gains that would be taxed at 0% saves nothing. You might do the reverse, called tax-gain harvesting: sell winners to reset their basis higher while the gain is tax-free.
- Small losses with real costs. If trading costs or bid-ask spreads eat most of the benefit, skip it.
- You would hold cash instead of reinvesting. Sitting out of the market for 31 days to avoid the wash-sale rule can cost more than the tax savings if prices rise.
A Year-End Checklist
- Pull your realized gains and losses for the year from your brokerage’s tax center.
- List positions in taxable accounts trading below cost, and note whether each would be a short- or long-term loss.
- Check for purchases of those same funds in the past 30 days, in every account, including your spouse’s and any IRAs.
- Turn off dividend reinvestment on anything you plan to sell.
- Sell, then buy a similar replacement that tracks a different index.
- Mark your calendar for 31 days later if you want to switch back.
- Keep records. Carryforward losses need to be tracked on Schedule D every year until they are used up.
For other moves worth making before the calendar turns, see our year-end money checklist. To see how a deduction changes your total tax, run the numbers through the Tax Bracket Calculator. If you invest in both taxable and retirement accounts, our comparison of 401(k) vs. taxable account growth shows how much tax drag a taxable account carries to begin with.
Capital loss limits, carryforwards, and wash sales: IRS Topic No. 409, Capital Gains and Losses and IRS Publication 550. 2026 long-term capital gains thresholds: Experian, Long-Term Capital Gains Rates for 2026. This article is general education, not tax advice.