Tax loss harvesting for stocks and funds: how it saves tax

Tax loss harvesting means selling investments that are worth less than you paid to realize losses that offset capital gains and up to $3,000 of ordinary income a year, while a similar but not substantially identical fund keeps your money invested.

By Sonic Wallet Editorial Team· Updated · 9 min read

Key takeaways

  • Tax loss harvesting means selling an investment that trades below its cost to realize a capital loss. The loss offsets capital gains first and then up to $3,000 of ordinary income a year ($1,500 if married filing separately), with any excess carried forward. Buying a fund that tracks a different index keeps you invested without repurchasing the same holding.
  • A harvested loss is worth the tax rate it avoids: $10,000 of losses saves nothing against long-term gains in the 0% band, $1,500 against gains taxed at 15%, and $4,080 against short-term gains taxed at 37% plus the 3.8% surtax.
  • In a worked 2026 example, a married couple in the 22% bracket harvests $18,000 of losses against $13,000 of gains, cutting that year's federal tax by $3,030 and carrying $2,000 of loss into 2027.
  • Harvesting mostly defers tax: the replacement shares carry a lower basis, so more gain is taxed when they are sold. The lasting benefit comes from rate differences, the income deduction, years of deferral and the basis step-up at death.
  • The wash sale rule disallows the loss if you, your spouse or your IRA buy substantially identical shares within 30 days before or after the sale, so check every account and pause dividend reinvestment before you sell.

Tax loss harvesting is selling an investment that is worth less than you paid so the loss can cut your tax bill, then reinvesting the money so your portfolio stays on course. The loss offsets capital gains first, then up to $3,000 a year against ordinary income ($1,500 if married filing separately), and anything unused carries forward to later years. This guide explains how the offsets work, how carryforwards behave, what a harvested loss is worth at different tax rates, a full worked example, a method for replacing what you sell without breaking the wash sale rule, and the limits that make harvesting less valuable than it first looks. Tax rules change and the value depends on your whole return, so treat the numbers as illustrations and run your plan past a tax professional. More on investing and tax sits on the stocks and investing hub.

What is tax loss harvesting?

Tax loss harvesting is the deliberate sale of an investment trading below its cost basis, made to realize a capital loss you can use on your tax return.

A paper loss does nothing for your taxes; the sale turns it into a realized loss. Most harvesters then buy a different but similar investment, so their market exposure barely changes while the loss goes on the return. It works only in a taxable brokerage account, because gains and losses inside IRAs and 401(k)s are never reported; Roth vs traditional IRA explains how those accounts are taxed instead.

Year-end is the traditional season, but a loss can be harvested whenever a holding dips below cost, and sharp market falls create the most opportunities. The trade date sets the tax year, so a sale on Thursday, December 31, 2026 still counts for 2026. The underlying rates and netting rules are explained in capital gains tax on stocks; this page is about using them on purpose.

How do harvested losses offset gains and income?

Harvested losses cancel capital gains first, and if losses exceed gains, the excess comes off other income up to the annual limit.

The order matters because short-term and long-term gains are taxed so differently. On Schedule D, short-term losses net against short-term gains and long-term losses against long-term gains; only then does a net loss on one side reduce a net gain on the other. A harvested short-term loss is most valuable when you have short-term gains, which are taxed at ordinary rates, while a long-term loss first absorbs long-term gains taxed at 0%, 15% or 20%.

When total losses exceed total gains, the excess reduces wages and other ordinary income by up to $3,000 a year, or $1,500 for married people filing separately. Capital gain distributions from mutual funds and ETFs count as long-term gains, so harvested losses absorb those too, even though you never chose to realize them.

How do capital loss carryforwards work?

Losses beyond the annual limit carry forward to future years with no expiry date during your lifetime, keeping their short-term or long-term character.

Each year a carryforward is treated much like a loss realized that year: it offsets that year's gains first, then up to $3,000 of income, and the remainder rolls on. Publication 550 uses short-term losses before long-term ones against the $3,000, and its worked example is a couple with a $7,000 net loss who deduct $3,000 and carry $4,000 forward. The publication includes a capital loss carryover worksheet for tracking the figures from one return to the next.

Carryforwards have two limits. They end at death, because a decedent's capital loss can be used only on the final return. And when spouses who filed jointly start filing separately, each keeps only the carryover from their own losses. Short of those events, a large carryforward works as a reserve that shelters future gains when you rebalance or sell a winner.

How much does tax loss harvesting save at different tax brackets?

A harvested loss saves whatever rate would otherwise have applied to the gain or income it cancels, from 0% up to 40.8% federally.

The 2026 long-term rates are 0% up to $49,450 of taxable income (single) or $98,900 (married filing jointly); 15% above that; 20% above $545,500 (single) or $613,700 (joint), while short-term gains and ordinary income face rates of up to 37%. Above certain incomes, the net investment income tax applies on top of either: 3.8% on the smaller of net investment income and the amount by which modified AGI exceeds $200,000 (single) or $250,000 (married filing jointly).

What $10,000 of harvested losses offsetsFederal rate avoidedTax saved in 2026
Long-term gains inside the 0% band0%$0
Long-term gains in the 15% band15%$1,500
Long-term gains at 15%, with the surtax18.8%$1,880
Long-term gains at 20%, with the surtax23.8%$2,380
Short-term gains in the 24% bracket24%$2,400
Short-term gains in the 37% bracket, with the surtax40.8%$4,080
No gains: $3,000 of income in the 22% bracket, $7,000 carried forward22% on $3,000$660

Three patterns stand out. Losses are worth most against short-term gains at high incomes and least against long-term gains in the 0% band, where there is no tax to avoid. With no gains at all, only $3,000 a year comes off income, so a big loss can take years to use. And in a year when your long-term gains would be tax-free anyway, the opposite move, harvesting gains, can make more sense: selling a winner inside the 0% band and buying it straight back resets its basis higher at no federal tax cost, and the wash sale rule does not apply to gains. State income tax, where it applies, adds to every figure in the table.

Worked example: harvesting $18,000 of losses in 2026

A married couple filing jointly has $180,000 of taxable income in 2026 before any investment sales, which puts their next dollar of ordinary income in the 22% bracket. By November they have realized $6,000 of short-term gains and $7,000 of long-term gains, $2,000 of it from fund distributions. They hold two positions below cost: an international stock fund bought years ago for $50,000 and now worth $36,000, and a small-company fund bought in March 2026 for $12,000 and now worth $8,000.

Worked example: Two harvested losses for a couple in the 22% bracket

They sell both funds on November 12 and reinvest the $44,000 the same day in funds that track different international and small-company indexes.

Netting for 2026Short-termLong-term
Gains already realized$6,000$7,000
Losses harvested−$4,000−$14,000
Net in each group$2,000 gain$7,000 loss
Combined result$5,000 net loss
Deducted from ordinary income$3,000
Carried forward to 2027$2,000 long-term
Federal tax saved in 2026Amount
$6,000 of short-term gains no longer taxed at 22%$1,320
$7,000 of long-term gains no longer taxed at 15%$1,050
$3,000 deduction against income taxed at 22%$660
Total$3,030
  • Their federal income tax falls from $31,394 to $28,364
  • The replacements cost $44,000, against $62,000 paid for the original funds, so their basis is $18,000 lower
  • If both recover to $62,000 and are later sold as long-term holdings, the extra $18,000 of gain costs $2,700 at 15%
  • The lasting gain is about $630: $3,030 saved now, plus at least $300 from the carryforward when it offsets future long-term gains, minus the $2,700, before counting what the deferred tax earns in the meantime

The $630 comes from rate differences: $9,000 of the losses canceled income taxed at 22%, while the gain that comes back later is taxed at 15%. If the couple holds the replacements until death, the basis step-up described in Publication 551 means the deferred $2,700 is never paid.

Is tax loss harvesting just a tax deferral?

Largely yes: harvesting lowers the basis of what you own, so the tax saved now tends to come back as a larger gain when you sell the replacement.

Deferral still has value, and four things can turn it into a permanent saving:

  • Rate differences. A loss that offsets short-term gains or ordinary income at 22% to 37%, when the later gain is taxed at the 15% long-term rate, keeps the difference for good.
  • Time. Tax saved today can stay invested for years; the compound interest calculator shows how much a deferred sum can grow.
  • Lower future income. If the replacement is sold in a year when your taxable income falls inside the 0% band, as can happen early in retirement, the deferred gain may never be taxed.
  • Step-up at death. Shares held until death take a new basis equal to their market value, so heirs inherit them without the deferred gain.

The reverse can happen too. If your future rate is higher, because of a larger income, a move to a high-tax state or a change in law, the gain that comes back can cost more than the tax you saved.

How do you harvest losses without breaking the wash sale rule?

Sell the losing position, then buy a fund that tracks a different index, so you stay invested without buying anything substantially identical within the window.

The wash sale rule disallows a loss if you, your spouse or your IRA buy substantially identical securities within 30 days before or after the sale (a 61-day window). A swap list is the standard way to plan around it: for each fund you hold, decide in advance which fund you would switch to, choosing one that follows a different index.

  1. Build a swap list before you need it

    For each position, note the index it tracks and pick a replacement that follows a different index of a similar market. Index providers such as S&P Dow Jones Indices, FTSE Russell, MSCI and CRSP publish their rules and constituents, so you can compare an S&P 500 fund with one tracking a total US market index, or an MSCI international index with an FTSE one. Each fund's prospectus names its index, and our stock and ETF pages show how funds have moved.

  2. Check the 30 days before the sale

    Look for purchases of the same security in every account you and your spouse own, including IRAs, workplace plans and reinvested dividends. A purchase in that period, or in the 30 days after the sale, can disallow part of the loss.

  3. Turn off automatic purchases

    Pause dividend reinvestment and scheduled investments in the position you are selling, in every account, until 31 days after the sale.

  4. Sell the highest-cost lots

    Use specific identification so the shares sold are the ones with the largest loss, and give the instruction before the trade settles. Lots held a year or less give short-term losses, which are most valuable against short-term gains.

  5. Buy the replacement the same day

    Reinvest the proceeds in the fund from your swap list, so your allocation and market exposure stay roughly where they were.

  6. Decide what to do after 31 days

    You can keep the replacement or switch back once 31 days have passed. Switching back sells the replacement, and any gain it made in that month is short-term and taxed at ordinary rates, so keeping it is often simpler.

  7. Check the 1099-B and keep records

    Confirm that box 1g of Form 1099-B shows no unexpected wash sale, report any the broker could not see on Form 8949, and keep a record of the loss and any carryforward for next year's return.

A swap list does not make every pair safe. Under the framework BlackRock publishes for its iShares funds, a fund on a different index carries moderate wash sale risk, an actively managed fund lower risk and a fund on the same index higher risk, and the IRS has issued no definitive opinion on how the rule applies to ETFs. The more two funds' holdings overlap, the closer the call; index funds explained shows how indexes differ. Coins follow different rules, covered in crypto tax-loss harvesting.

What are the limits and risks of tax loss harvesting?

Harvesting lowers your cost basis, costs something to trade and can backfire through wash sales, so its value is smaller than the headline loss suggests.

  • Basis reset. Every dollar of harvested loss lowers the basis of what you own by a dollar, so much of the tax comes back when you sell, as the worked example shows.
  • Transaction costs. Even without a commission, bid-ask spreads, fund trading costs and any short-term redemption fees apply, and a sale pays the SEC's Section 31 fee of $20.60 per $1 million of sales, which is under a dollar on a $36,000 sale.
  • Tracking difference. The replacement fund will not move exactly like the original, so for a month or longer your returns can differ, for better or worse.
  • Wash sales. A reinvested dividend, a spouse's purchase or an IRA buy can disallow part or all of the loss. In 2018 the SEC found that one automated adviser had told clients it monitored all their accounts for wash sales when it did not, and wash sales occurred in at least 31% of the accounts in its harvesting program. Automated harvesting is one of the trade-offs in robo-advisors vs DIY investing.
  • Low brackets. Losses that offset gains in the 0% band save nothing, and $3,000 a year against income can take a long time to use up a large loss.
  • Letting tax drive the portfolio. Selling a holding you still want, or keeping a weak one to avoid a gain, can cost more than the tax involved.
  • Rules change. Rates, brackets and the wash sale rule itself can change, and Congress has considered extending the rule to digital assets. This page reflects the rules as of November 2026 and is not tax advice; a tax professional can check how harvesting fits your whole return.

Frequently asked questions

Is tax loss harvesting worth it for small losses?+

Often yes, because even a few hundred dollars of losses reduces taxable gains or income. The benefit shrinks if trading spreads are wide, if your gains already fall in the 0% band, or if tracking many small lots makes your records unreliable.

Can I harvest losses in an IRA or 401(k)?+

No. Gains and losses inside retirement accounts are not reported on your return, so a falling investment in an IRA or 401(k) creates no deductible loss. Harvesting works only in taxable brokerage accounts.

What is the deadline for harvesting losses for 2026?+

The sale must trade by Thursday, December 31, 2026, a full trading day, because the trade date rather than the settlement date sets the tax year. A repurchase in early January 2027 can still trigger the wash sale rule.

Do robo-advisers handle tax loss harvesting automatically?+

Some automated advisers offer it, but the SEC's investor bulletin warns that its value depends on your tax situation and that it may implicate wash sale rules. An adviser sees only the accounts it manages, so purchases elsewhere remain your responsibility.

What happens to unused capital losses when someone dies?+

They end with that person. Publication 550 allows a decedent's capital loss to be deducted only on the final income tax return, and the estate cannot deduct it or carry it over, so a large carryforward can go unused.

Sources

  1. Topic no. 409, Capital gains and losses, IRS
  2. Publication 550, Investment Income and Expenses, IRS
  3. Revenue Procedure 2025-32 (2026 inflation adjustments), IRS
  4. Net Investment Income Tax, IRS
  5. Publication 551, Basis of Assets, IRS
  6. 26 U.S. Code 1091, Loss from wash sales of stock or securities, Legal Information Institute, Cornell Law School
  7. Investor Bulletin: Robo-Advisers, SEC (Investor.gov)
  8. SEC Charges Two Robo-Advisers With False Disclosures, SEC
  9. Tax loss harvesting at a glance: wash sale rule considerations, BlackRock (iShares)
  10. Section 31 Transaction Fee Rate Advisory for Fiscal Year 2026, SEC

Related guides