investing

Tax-Loss Harvesting and the Wash Sale Rule: A Worked Capital Loss Example for 2026

An investor holds a position in a taxable brokerage account that is worth far less than its purchase price, and the calendar year ends on December 31. What the IRS lets that loss do, and what it takes away if the sale is followed by a repurchase, comes down to a handful of rules in IRS Topic 409 and Publication 550. This guide runs one clearly labeled hypothetical investor through them from start to finish: the realized gains, the unrealized loss, the sale, the $3,000 limit, the carryover and the wash sale traps.

This is general information drawn from IRS documents, not personalized tax advice, and it is not a recommendation to buy or sell anything. KnowWiser earns no commission and uses no affiliate links in this piece. Every dollar figure below is attributed to an IRS source or labeled as part of the hypothetical.

Should you harvest a capital loss before December 31?

Short answer: it depends on four facts about you: whether you have gains to offset, how large the loss is compared with trading costs, how your tax rate now compares with later, and whether you can avoid every wash sale. The sections below work through each with arithmetic, and the framework near the end turns them into questions you can answer from your own records.

Keep one point in mind throughout: harvesting mostly changes when you pay tax, not whether you ever do.

What can a realized capital loss do on your 2026 return?

It first offsets capital gains, then up to $3,000 of other income, and whatever is left carries forward. The IRS describes the sequence this way.

  • Holding period decides the label. IRS Topic 409 says that if you hold an asset more than one year before you dispose of it, the gain or loss is long-term; one year or less is short-term. Net short-term capital gains are taxed as ordinary income at graduated rates.
  • Gains and losses are netted. IRS Publication 550 has you combine short-term gains and losses into a net short-term figure and long-term gains and losses into a net long-term figure, then combine those two (Schedule D, line 16) into a total net gain or loss.
  • The deduction has a cap. Publication 550 says the allowable capital loss deduction is the lesser of $3,000 ($1,500 if married filing separately) or your total net loss, and that you can use that net loss to reduce your income dollar for dollar up to the limit. Topic 409 states the same $3,000 and $1,500 limits.
  • The rest carries over. Publication 550 says the unused part can be carried to the next year and treated as if incurred then, and to later years until it is used up. The carried-over loss stays long-term or short-term, and a long-term carryover reduces that year’s long-term gains before it reduces short-term gains. The carryover formula also takes taxable income into account, so Publication 550 points to Worksheet 4-1 for the exact figure.

A loss you have not sold is not a loss the IRS counts. The sale is what realizes it.

How does one hypothetical investor’s harvest work, step by step?

In this hypothetical, a $12,000 realized loss wipes out $7,000 of realized gains, takes $3,000 off ordinary income, and leaves $2,000 to carry forward. The investor is invented, and so are all the prices, dates and holdings. Your figures will differ.

The hypothetical investor (single filer, tax year 2026):

  • Taxable income from wages of $70,000, before any capital gains or losses (an assumption, after the standard deduction).
  • Already realized in 2026: a $2,000 short-term gain (Position B, held 8 months) and a $5,000 long-term gain (Position C, held 3 years).
  • Still held: Position A, bought 14 months ago for $20,000 and now worth $8,000, so an unrealized long-term loss of $12,000. Position A is a generic placeholder, not a real stock or fund.
  • The investor sells Position A on November 10, 2026 and puts the $8,000 proceeds into a different investment that is not substantially identical (more on that phrase below).

Table 1. The netting, in order (hypothetical figures).

StepCalculationResult
1. Net short-term$2,000 gain, no short-term losses+$2,000
2. Net long-term$5,000 gain minus $12,000 loss-$7,000
3. Total net gain or loss+$2,000 and -$7,000-$5,000 net loss
4. Deduction allowed this yearLesser of $3,000 or $5,000$3,000
5. Carried forward$5,000 minus $3,000$2,000

The $2,000 carryover is long-term here, because the netting leaves only a long-term loss (Publication 550: a carried-over loss remains long-term or short-term). The investor would still complete the carryover worksheet, since the IRS formula also looks at taxable income.

Where the $12,000 loss goes Hypothetical single filer, tax year 2026 1. Realized loss on Position A: $12,000 Bought for $20,000, sold for $8,000 2. Cancels the long-term gain: $5,000 $5,000 gain minus $12,000 loss is a $7,000 net long-term loss 3. Cancels the short-term gain: $2,000 +$2,000 and -$7,000 net to a $5,000 loss 4. Deducted from ordinary income: $3,000 Lesser of $3,000 or the $5,000 net loss 5. Carried forward to next year: $2,000 $5,000 minus $3,000, long-term in character here Bars start at $0 and are drawn to scale. Hypothetical figures, federal income tax only.

What does the harvest change in tax, and what does it not?

In this hypothetical, the harvest lowers 2026 federal income tax by $1,850, but it also lowers the cost basis of the position, which can hand a bigger gain back later. The dollar amounts depend on two assumed rates.

Two IRS facts set the rates. The 2026 tax rate table in Revenue Procedure 2025-32 puts a single filer’s 22% bracket at taxable income over $50,400 and up to $105,700. The same document sets the 2026 maximum zero rate amount for long-term capital gains at $49,450 for single filers and the maximum 15% rate amount at $545,500. The hypothetical investor’s taxable income of about $70,000 sits in the 22% ordinary bracket and above $49,450, so the long-term gain is assumed to be taxed at 15%. (Our 2026 tax brackets and standard deduction post explains the bracket structure.)

Table 2. Federal income tax effect in 2026 (hypothetical figures, assumed rates of 22% ordinary and 15% long-term).

Do not sell Position ASell Position A
Short-term gain of $2,000 taxed as ordinary income$440$0 (offset by the loss)
Long-term gain of $5,000$750$0 (offset by the loss)
$3,000 capital loss deduction against ordinary income$0$660 in tax saved
Net federal effect$1,190 of tax on gains$1,190 avoided, plus $660 saved: $1,850 lower

Netting matters because a loss that cancels a short-term gain is worth more per dollar, in this example, than one that cancels a long-term gain: the short-term gain would have been taxed at the 22% ordinary rate, the long-term gain at 15%. The hypothetical is also far below the net investment income tax thresholds in IRS Topic 559 ($250,000 for married filing jointly, $200,000 for single or head of household, $125,000 for married filing separately). That tax is 3.8% on the lesser of net investment income or the amount by which modified AGI exceeds the threshold, and Topic 559 lists net gains from the disposition of stocks, bonds and mutual funds as investment income. Topic 559 does not say how capital losses interact with this tax, so this article makes no claim about it; the Form 8960 instructions or a tax professional can answer that for a higher-income filer.

Harvesting mostly defers tax

Now the counterpoint. The new investment starts with a basis of $8,000, not $20,000. Suppose, purely as an assumption, that it later rises to $20,000 and is sold.

Table 3. The deferral (hypothetical figures, assumed 15% long-term rate on the later gain).

Keep Position A and it recovers to $20,000Harvest, reinvest $8,000, and the new holding reaches $20,000
Basis$20,000$8,000
Taxable gain on sale$0$12,000
Tax at an assumed 15%$0$1,800

Against $1,850 saved this year, the harvest costs up to $1,800 later in this hypothetical, before counting the $2,000 carryover and the value of having the money sooner. That is close to a wash in nominal dollars. What harvesting can change is timing and rate: it can pull a deduction into a high-rate year and push the gain into a lower-rate year, including one where long-term gains are taxed at 0%. If your rate later turns out to be higher, the effect reverses. The figures are assumptions, not a forecast of what any investment will do.

How does the wash sale rule work, and how does it trip up a harvest?

A wash sale happens when you sell at a loss and, within 30 days before or after, you buy substantially identical stock or securities; the loss is then disallowed and added to the basis of the replacement. That wording comes from IRS Publication 550, which also says the holding period of the replacement includes the holding period of what you sold, and that the adjustment postpones the loss deduction until you dispose of the replacement.

Counting the sale date, the window is 61 days. For a November 10 sale in the hypothetical, it runs from October 11 through December 10. Below, “day 29” and “day 31” mean 29 and 31 days after the sale, so December 9 is day 29 (inside the window) and December 11 is day 31 (outside it).

The 61-day wash sale window Hypothetical sale of Position A on Nov 10, 2026 30 days before 30 days after Oct 11 Nov 10 sale Dec 10 Dec 11 Outside A B C D E Where a repurchase lands A Oct 26, 15 days before the sale: wash sale B Nov 20, spouse buys in own account: wash sale C Nov 25, dividend reinvested: likely partial D Dec 9 (day 29), same holding: loss disallowed E Dec 11 (day 31), same holding: loss allowed Hypothetical dates. 30 days + sale date + 30 days = 61 days.

Publication 550’s Example 1 adds a $250 disallowed loss to the $800 cost of the replacement shares to reach a $1,050 basis. Scaled to the hypothetical, the same mechanics work like this. Sell Position A on November 10 for $8,000 (a $12,000 loss) and buy back the same holding on December 9, 29 days after the sale. The loss is disallowed, and the $12,000 is added to the $8,000 cost of the new shares, so the new basis is $20,000. Buy the same holding back on December 11, 31 days after the sale, and the window has closed: the $12,000 loss counts for 2026, and the new basis is just the $8,000 paid.

Table 4. Where the same $12,000 harvest goes wrong (hypothetical, sale on November 10, 2026).

What else happensWash sale?Effect on the $12,000 loss
Same holding bought back on Dec. 11 (31 days after the sale)No, outside the 30 daysAllowed. New basis is what was paid.
Same holding bought back on Dec. 9 (29 days after the sale)YesDisallowed for 2026; added to the new basis, so the deduction is postponed.
Same holding bought on Oct. 26 (15 days before the sale)Yes, the rule works backward tooDisallowed; added to the basis of the shares bought in October.
The investor’s IRA buys the same holding on Dec. 9Yes, per Pub. 550 and Rev. Rul. 2008-5Disallowed, and the IRA’s basis is not increased by it.
The investor’s spouse buys the same holding in their own account on Nov. 20Yes, per Pub. 550Disallowed.
A small dividend is reinvested into the same holding on Nov. 25Likely a partial wash sale (our reading, see below)Only the loss on the matched shares is disallowed.

Notes on the rows:

  • The IRA. Publication 550 lists acquiring substantially identical stock for your IRA or Roth IRA as a wash sale. Revenue Ruling 2008-5 holds that when an individual sells at a loss and causes an IRA or Roth IRA to buy substantially identical securities within 30 days before or after, the loss is disallowed under section 1091 and the IRA’s basis is not increased. So this is more than a delay: the disallowed loss does not become basis anywhere you can use it later.
  • The spouse. Publication 550 says that if you sell stock and your spouse or a corporation you control buys substantially identical stock, you also have a wash sale. The rule follows you and your spouse, not one brokerage account, so check purchases in every account, not just the one you sold from.
  • The reinvested dividend. Publication 550’s wash sale section does not single out dividend reinvestment, but a reinvested dividend is a purchase of shares, so it can fall inside the window like any other purchase. The publication’s “more or less stock bought than sold” rule then matches the shares bought against the shares sold, so only that part of the loss is disallowed. If 100 shares were sold at a $120 loss per share and a reinvested $80 dividend buys one share within the window, $120 of the $12,000 loss would be disallowed and the remaining $11,880 allowed. Because the IRS pages we read do not address reinvestment by name, this is our reading; check it with a tax professional. Switching off automatic reinvestment for the window removes the question.
  • The calendar year-end. The window does not stop at December 31. Publication 550 has an example (a December 27, 2024 sale followed by a purchase on January 10, 2025) in which the January purchase still means the loss on the sold shares is not deductible. A loss harvested in late December can be undone by a purchase in early January.
  • Recurring purchases. A scheduled monthly purchase into the same holding is still a purchase. Check whether one falls inside the 61 days.

Publication 550 also works a partial case: 100 shares sold at a $1,000 loss, with 75 substantially identical shares bought in the 30 days before the sale. The loss on the 75 matched shares ($750) is disallowed and the loss on the other 25 shares ($250) is allowed.

What does “substantially identical” mean?

The IRS says it is a facts and circumstances question, and it gives no list of funds or securities that are safe to swap. Publication 550 says that stocks or securities of one corporation are ordinarily not substantially identical to those of another corporation, but that they may be in some cases, for example the predecessor and successor stock in a reorganization. It also discusses bonds or preferred stock that are convertible into common stock of the same corporation.

The publication draws no bright line for two funds that track similar or overlapping indexes, or for two funds from different providers with different names. We could not find an IRS rule that says where that line sits, so this article does not name any pair of funds as safe or unsafe. If a replacement is close to what you sold, treat the question as unresolved and ask a tax professional who can see your whole return.

When is harvesting worth it, and when is it not?

It tends to make the most sense with real gains to offset, a loss well above trading costs, and a tax rate now that is higher than the one you expect later; it makes the least sense inside the 0% long-term bracket. Treat the six questions below as prompts to answer from your own records, not as instructions.

  1. Do you have gains to offset, or ordinary income to reduce? Gains you realized this year are the first thing a loss offsets. With no gains, the loss still reduces ordinary income up to $3,000 ($1,500 if married filing separately), and the rest carries over.
  2. Is the loss large enough to matter after costs? A $200 loss that costs more to trade, or that leaves you out of the market or in a different investment for 31 days, may not earn its keep. Weigh commissions, price differences on the sale and the investment risk of the replacement.
  3. Is your rate now higher than it is likely to be later? Harvesting can shift tax to later years, as Table 3 shows. If you expect a lower rate later, deferral tends to help; if you expect a higher one, it can hurt.
  4. Are you near the 0% long-term bracket? Revenue Procedure 2025-32 sets the 2026 maximum zero rate amount at $49,450 for single filers, $98,900 for married filing jointly and $66,200 for heads of household, measured against taxable income. If your taxable income is inside that band, long-term gains can be taxed at 0%, and a loss that would only offset long-term gains taxed at 0% saves little tax (our reasoning, not an IRS statement). Some investors in that position consider the opposite move, realizing gains up to the top of the band to raise their basis. The wash sale rule applies to losses, not gains. That approach has its own consequences, since extra realized income can affect other parts of a return, so it is a question for a tax professional, not a rule of thumb.
  5. Can you avoid every wash sale? Check every account you and your spouse control, IRAs included, plus automatic purchases and reinvested dividends, for the 61 days.
  6. Are you doing it for the tax, or because you would sell anyway? Tax is one input to an investment decision, not the whole decision. Selling a position you still believe in and swapping it for something you like less is a real cost. (For the investment side, see how to diversify an investment portfolio.)

If you also have self-employment income and make quarterly payments, realized gains and losses change the 2026 tax that the safe harbor tests are measured against; the estimated taxes and annualized method post explains those tests. Other year-end choices, such as a Roth conversion, use the same brackets: see how much to convert to a Roth before year-end.

Which date counts at year end?

The IRS counts the trade date, not the settlement date. Publication 550 says that for securities traded on an established securities market, your holding period ends on the trade date you sold them, and it cautions against confusing the trade date with the settlement date. Its example is a stock sold on December 31 whose sale closed in January: the gain or loss is reported in the year of the trade.

That does not mean any hour of December 31 works. Markets close on their own schedule, brokers set their own order deadlines, and we did not confirm the last trading day of 2026 from an exchange source. Check the exchange calendar and your broker’s cutoff, and do not leave a harvest to the last afternoon.

Your broker’s Form 1099-B and cost basis records then feed Form 8949 and Schedule D, which is how Publication 550 says sales are reported.

What could we not confirm?

A short list, so that nothing here is guesswork.

  • Dividend reinvestment. The IRS pages we read do not name dividend reinvestment as a wash sale trigger. The description above is our reading of the rule that any purchase within the window counts. Check with a tax professional.
  • Similar funds. No IRS list or bright-line rule for funds tracking similar indexes was found. Nothing here says any two funds are safe to swap.
  • Last trading day of 2026. Not confirmed from a primary source. Check the exchange calendar and your broker.
  • Crypto and other digital assets. Publication 550’s wash sale text covers stock, securities, and contracts or options on them. We did not confirm a primary source on digital assets, so this piece says nothing either way.
  • State tax. State rules vary and are not worked here; your state revenue department’s site has its own rules.
  • Net investment income tax thresholds. We report the amounts as Topic 559 states them and make no claim about whether they are adjusted for inflation.

What can the compound interest calculator show here?

It can show how a tax saving that you reinvest might grow over time, and nothing else. Our compound interest calculator takes an initial amount, a monthly contribution, an annual rate and a number of years, and shows the resulting balance.

It does not model capital losses, gain and loss netting, the $3,000 limit, carryovers, wash sales or tax rates. To use it here, you would first work out your own tax effect from your return and the IRS documents below, then type that dollar amount in as the initial amount and choose a rate of your own. The rate is an assumption, not a promise.

Sources

Verified as of 2026-09-30 against the IRS pages above (Publication 550 is the 2025 edition, written for 2025 returns and the edition on irs.gov on that date; its examples use 2024 and 2025 dates): the holding period rules; the $3,000 and $1,500 capital loss limits and the carryover rule; the 30-day wash sale window, the spouse and IRA rules, the basis and holding period adjustment and the partial-match rule; Revenue Ruling 2008-5; the trade date rule; the 2026 single-filer tax rate table (22% bracket $50,400 to $105,700) and the 2026 zero and 15% long-term capital gains rate amounts; and the Topic 559 rate and thresholds. Topic 409 itself still shows 2025 rate amounts, so the 2026 amounts are taken from Revenue Procedure 2025-32. Everything else in the worked example is a labeled hypothetical, including the assumed 22% and 15% rates. Tax rules and IRS figures change; confirm your own numbers on irs.gov, on your broker’s Form 1099-B, or with a tax professional before you act.

Advertisement

Frequently asked questions

What is tax-loss harvesting?

It is the practice of selling an investment in a taxable account for less than its cost so the realized capital loss can offset capital gains and, beyond that, up to $3,000 of other income. Neither Topic 409 nor Publication 550 uses the phrase itself. The rules underneath it are in IRS Topic 409 (capital gains and losses) and Publication 550 (wash sales). The sale itself has to happen, on a trade date inside the tax year.

How much capital loss can you deduct in a year?

IRS Topic 409 says that if your capital losses exceed your capital gains, the amount of the excess loss you can claim to lower your income is the lesser of $3,000 ($1,500 if married filing separately) or your total net loss. Publication 550 adds that any unused part carries over to the next year and later years until it is used up, and that a carried-over loss stays long-term or short-term.

How long is the wash sale window?

IRS Publication 550 says a wash sale occurs when you sell stock or securities at a loss and, within 30 days before or after the sale, you buy substantially identical stock or securities. Counting the sale date itself, that is a 61-day window: 30 days before, the day of the sale, and 30 days after. A repurchase 31 days after the sale falls outside it; one 29 days after the sale falls inside it.

Does buying the same investment in an IRA trigger a wash sale?

The IRS says yes. Publication 550 lists acquiring substantially identical stock for your IRA or Roth IRA as a wash sale, and Revenue Ruling 2008-5 holds that if you sell at a loss and your IRA or Roth IRA buys substantially identical securities within 30 days before or after, the loss is disallowed and the IRA's basis is not increased by it. Unlike a taxable-account wash sale, the disallowed loss is not added to a basis you can use later.

Does tax-loss harvesting eliminate the tax?

Usually it defers it. Publication 550 says a wash-sale adjustment postpones the loss deduction, and the same logic applies to a harvest that reinvests the proceeds: the new position starts with a lower cost basis, so a later sale at the old price produces a bigger taxable gain. What harvesting can change is timing and the rate that applies, for example an ordinary-income offset now against a long-term gain later. Whether that helps depends on your own rates now and later.

KW
KnowWiser Editorial Team — Research & Fact-Checking

Researched guides and comparisons produced and fact-checked by the KnowWiser editorial team, checked against primary sources and dated.