Skip to main content
Capital Gains: Short vs Long-Term

Netting Capital Gains and Losses: How to Minimize Your Tax Bill

Pomegra Learn

How Netting Capital Gains Against Losses Reduces Your Tax Bill

One of the most powerful tax-reduction tools available to investors is simple: offset your gains with losses. When you sell an appreciated stock at a gain and sell a depreciated stock at a loss in the same year, you can "net" them—subtract the loss from the gain—and pay tax only on the remainder. If losses exceed gains, you can deduct up to $3,000 of net loss against ordinary income, with unlimited carryforward of excess losses. Understanding how to execute netting strategically can cut thousands off your annual tax bill.

Quick definition: Netting is the IRS process of combining your capital gains and losses within each category (short-term and long-term) to calculate your net taxable gain. Losses offset gains dollar-for-dollar, and excess losses can offset ordinary income or carry forward.

Key takeaways

  • The IRS requires netting: short-term gains are netted against short-term losses first, and long-term gains against long-term losses
  • Within each holding period category (short-term and long-term), losses offset gains on a dollar-for-dollar basis until one is exhausted
  • If one category has a net gain and the other has a net loss, you offset the gain with the loss (short-term loss can offset long-term gain and vice versa)
  • Capital losses in excess of capital gains can offset up to $3,000 of ordinary income per year
  • Unused losses carry forward indefinitely to future tax years, with no expiration date
  • The IRS has strict wash-sale rules: you cannot repurchase "substantially identical" securities within 30 days before or after a loss sale (61-day window total)
  • Strategic loss harvesting in December can lock in losses and offset annual gains, deferring tax into future years

The Netting Process Step-by-Step

The IRS imposes a mandatory netting hierarchy. You cannot pick and choose which gains to offset with which losses; instead, you follow a prescribed formula.

Step 1: Net Short-Term Gains and Losses

First, combine all your short-term capital gains and losses. These are profits and losses from securities held one year or less.

Example:

  • Sold Stock A at a gain: +$2,000 (short-term)
  • Sold Stock B at a loss: -$3,000 (short-term)
  • Sold Stock C at a gain: +$1,500 (short-term)
  • Short-term net: $2,000 - $3,000 + $1,500 = $500 net short-term gain

Step 2: Net Long-Term Gains and Losses

Next, combine all your long-term capital gains and losses. These are profits and losses from securities held over one year.

Example:

  • Sold Stock D at a gain: +$10,000 (long-term)
  • Sold Stock E at a loss: -$2,000 (long-term)
  • Sold Stock F at a gain: +$3,000 (long-term)
  • Long-term net: $10,000 - $2,000 + $3,000 = $11,000 net long-term gain

Step 3: Combine the Two Categories

If both categories have gains (or both have losses), you report them separately. If one has a gain and the other has a loss, you offset the loss against the gain.

Example (continuing above):

  • Short-term net: $500 gain
  • Long-term net: $11,000 gain
  • Total net capital gain: $500 + $11,000 = $11,500

You report $500 as short-term capital gain (taxed as ordinary income) and $11,000 as long-term capital gain (taxed at preferential 0%, 15%, or 20% rate depending on income).

Alternative example:

  • Short-term net: $500 gain
  • Long-term net: -$7,000 loss
  • Offset: The $7,000 loss reduces the $500 gain to zero, plus $6,500 of loss remaining
  • Result: $0 short-term gain, $6,500 excess long-term loss to carry forward

Step 4: Claim Loss Against Ordinary Income (or Carry Forward)

If you have a net capital loss (total losses exceed total gains), you can deduct up to $3,000 of the loss against your other income—wages, interest, rental income, etc.—in the current year. Any loss beyond $3,000 carries forward to the next tax year indefinitely.

Example:

  • Year 1: Net capital losses = $8,000
  • Deduction against ordinary income: $3,000
  • Carryforward loss to Year 2: $5,000

In Year 2, if you have capital gains, the $5,000 carryforward loss offsets them first. If Year 2 has no gains, you can deduct another $3,000 against ordinary income, and carry forward another $2,000 to Year 3.

The Netting Hierarchy Visualized

Real-World Examples of Netting

Scenario 1: Offsetting a Major Gain

You made a large profit on a long-held stock:

  • Sold XYZ Corp at a long-term gain: +$15,000
  • Sold 3 other stocks at long-term gains: +$2,500 total
  • Sold 2 stocks at long-term losses: -$8,000 total
  • Net long-term: $15,000 + $2,500 - $8,000 = $9,500

If you were taxed on the full $17,500 gain, the tax at 20% would be $3,500. With netting, you pay 20% × $9,500 = $1,900—a savings of $1,600 on a single portfolio.

Scenario 2: Converting a Gain into a Loss Deduction

You have a $15,000 long-term gain but sold a depreciated stock at a loss:

  • Long-term gains: +$15,000
  • Long-term losses: -$18,000
  • Net loss: -$3,000

You can deduct the full $3,000 against ordinary income in the current year. The remaining $15,000 unused loss carries forward indefinitely. In the next year, if you have capital gains, the $15,000 loss offsets them.

If you earn $100,000 in salary and have a $15,000 capital gain and $18,000 capital loss, your net capital loss of $3,000 reduces your taxable ordinary income to $97,000. If in a 22% federal bracket, that saves $660 in federal tax.

Scenario 3: Multiple Short-Term and Long-Term Transactions

A day-trader with many short-term positions and a long-term holding:

  • Short-term gains: +$8,000 (multiple day trades and quick flips)
  • Short-term losses: -$6,000
  • Long-term gains: +$5,000 (one position held 3 years)
  • Long-term losses: -$2,000

Netting:

  • Short-term net: $8,000 - $6,000 = $2,000 (taxed as ordinary income at trader's marginal rate, up to 37%)
  • Long-term net: $5,000 - $2,000 = $3,000 (taxed at preferential rate, likely 15%)
  • Total net capital gain: $5,000

The Wash-Sale Rule: A Critical Constraint

The wash-sale rule is the IRS's safeguard against "loss harvesting abuse." You cannot claim a loss on a sale if you repurchase the same or substantially identical security within 30 days before or after the sale. The disallowed loss is added to the basis of the repurchased shares.

Understanding the 61-Day Window

The rule is symmetrical: 30 days before the sale, the sale date itself, and 30 days after = 61 days total.

Timeline:

  • January 1: You want to sell Stock X at a loss
  • Wash-sale window: December 2 (30 days before) through February 1 (30 days after)
  • If you bought or repurchased Stock X anywhere in this window, the loss is disallowed

What Counts as "Substantially Identical"?

The IRS considers these substantially identical:

  • The same stock purchased at any price
  • The same bond issued by the same company
  • Call options on the same stock (in many cases)

The IRS does not consider these substantially identical (you can use one to replace the other):

  • Stock in Company A vs. stock in a different company (even competitors)
  • Index fund A vs. Index fund B (they track different indexes, though correlated)
  • Stock in a sector ETF vs. stock in an individual company in that sector

Typically, different funds tracking the same index (e.g., two S&P 500 ETFs) are considered substantially identical, though the IRS has given some relief in recent guidance. Check current rules before assuming you can swap.

Example: Harvesting a Loss Properly

You own 100 shares of Tech Growth Fund (TGF) with a $8,000 basis, currently worth $5,000. You want to lock in the loss but stay invested in the tech sector.

Wrong approach: Sell TGF on December 15, realize a $3,000 loss, then repurchase TGF on December 20. Result: The $3,000 loss is disallowed (repurchase within 30 days), and the loss is added to your new TGF basis, increasing it to $8,000 for the new shares.

Right approach: Sell TGF on December 15, then immediately buy a similar but non-identical tech fund (different index, different holdings). After 31 days (January 16), you can repurchase TGF if desired. Result: The $3,000 loss is claimed in Year 1, and you've maintained tech sector exposure in the interim.

Alternatively, you can buy the similar fund and simply never repurchase TGF—the loss is locked in, and you're invested in a correlated but different holding.

The Strategic Loss-Harvesting Calendar

Sophisticated investors plan loss-harvesting systematically:

October–December: Review positions with unrealized losses. Sell losers before year-end to claim losses on the current year's tax return. Immediately replace with similar but non-identical funds or stocks to maintain desired asset allocation.

January–September: If wash-sale restrictions are expiring, you can repurchase the original holding after 31 days (or let it go). Monitor for new losses that might arise; harvest opportunistically.

Year-end: Final pass through portfolio. Harvest remaining losses if any holdings have dipped below cost.

After selling at a loss: Document the sale and the replacement investment. If audited, you need to show you weren't trying to "hide" the loss by immediately repurchasing identical securities.

Carryforward Losses: Perpetual Tax Benefits

Unused capital losses don't expire. If you harvest $10,000 of losses in Year 1 but have no gains, you deduct $3,000 against income and carry forward $7,000. If Year 2 has no gains either, you deduct another $3,000 and carry forward $4,000. This process continues for as long as you live.

Critical point: Capital loss carryforwards can be lost if you die. Your heirs do not inherit the right to deduct your unused losses. This is one reason to strategically harvest losses before retirement and passing away—to claim them while alive and benefiting from them.

Upon death, any unused losses are lost forever for tax purposes (though they may offset gains in the decedent's final return). If you're in late retirement with large losses and declining income, prioritize harvesting those losses to enjoy their tax benefit while you can.

Common Mistakes

Skipping loss harvesting because of wash-sale fear. The wash-sale rule applies only if you repurchase the identical security. Swap to a similar but different fund, harvest the loss, and you're fine. Many investors forgo real tax savings due to misunderstanding this rule.

Forgetting to track carryforward losses. You claim a $10,000 loss, deduct $3,000, and carry $7,000 forward. If you don't document this, you may forget the carryforward exists in Year 2. Keep a separate log of losses on a spreadsheet or in your tax files.

Not tracking wash-sale adjustments. When a wash-sale occurs, the IRS adjusts your cost basis, but it's your responsibility to track this. Many investors don't adjust basis for wash-sales and end up overstating gains years later.

Netting short-term and long-term incorrectly. An investor believes they can choose to offset long-term gains with long-term losses and leave short-term losses for ordinary income. The IRS requires netting within each category first. You cannot manipulate the order.

Harvesting losses late in December without considering Year 2 plans. You harvest a loss, but your broker processes the trade in early January due to settlement timing. The loss is reported in Year 2, not Year 1. Sell by mid-December to ensure reporting in the current tax year.

Failing to consider wash-sales on reinvestment. You harvest a loss in a stock and reinvest dividends from similar holdings within the wash-sale window. The dividend reinvestment may not trigger wash-sale directly (reinvested dividends are typically exempt), but repurchasing the underlying stock does. Clarify this with a tax professional.

FAQ

Can I harvest the same loss twice? No. Once you claim a loss, it's gone (either deducted or carried forward). You can repurchase the security later, but the original loss cannot be claimed again.

If I have a $10,000 capital loss, can I deduct all $10,000 in one year? No, you can deduct only $3,000 of capital loss against ordinary income per year. The remaining $7,000 carries forward to future years at $3,000/year until exhausted or offset by capital gains.

Can excess capital losses offset other investment income like dividends? Capital losses offset capital gains first. Any excess offsets ordinary income up to $3,000/year. Dividends are a separate category of income and are not reduced by capital losses (though if you harvest losses and reduce ordinary income, your overall tax bill decreases, indirectly reducing the relative tax burden on dividends).

What if I inherit stock with unrealized losses? Inherited securities receive a step-up (or step-down) in basis to fair market value at the date of death. If the inherited stock is worth less than the ancestor's cost basis, the "loss" is erased—it never generates a tax loss for the heir.

Can I use capital losses to offset capital gains in prior years? No, capital losses cannot be carried back. They can only offset gains in the current year or carry forward to future years. If you had a large gain in Year 1 and a loss in Year 2, you cannot amend Year 1 to claim the Year 2 loss (unless it's part of a formal amended return in specific circumstances; consult a tax professional).

If I sell a mutual fund at a loss and buy a different fund in the same company, is that a wash-sale? Not necessarily. If the funds track different indexes or strategies, they may not be "substantially identical." However, two broad-market funds from the same company may be considered substantially identical. Check the fund prospectuses or consult your tax advisor.

Can I harvest losses and still maintain my desired investment allocation? Yes, by replacing the sold security with a similar but distinct investment. Sell a domestic large-cap fund at a loss, replace it with a different domestic large-cap fund. Both provide similar market exposure but are not substantially identical, so wash-sale doesn't apply.

Summary

Netting capital gains and losses is a mandatory IRS process that reduces your taxable gains dollar-for-dollar with losses. Short-term and long-term categories are netted separately, and excess losses can offset ordinary income up to $3,000 per year, with unlimited carryforward. The wash-sale rule prevents you from claiming a loss if you repurchase an identical security within 61 days, but you can harvest losses strategically by replacing depreciated investments with similar but distinct alternatives. Understanding netting empowers you to harvest losses effectively, potentially saving thousands in annual taxes while maintaining your desired portfolio allocation. Tax rules evolve, so verify current regulations with the IRS or a qualified professional.

Next

Capital Loss Carryforwards