Tax-Loss Harvesting: Definition and Example

What Is Tax-Loss Harvesting?

Tax-loss harvesting is the timely selling of securities at a loss to offset the amount of capital gains tax owed from selling profitable assets. This strategy is commonly used to limit short-term capital gains, commonly taxed at a higher rate than long-term capital gains, to preserve the value of the investor’s portfolio while reducing taxes.

Key Takeaways

  • Tax-loss harvesting is a strategy investors can use to reduce capital gains taxes owed from selling profitable investments.
  • The strategy involves selling an asset or security at a net loss.
  • The investor can use proceeds from a sale to purchase a similar asset and maintain the portfolio balance.

Understanding Tax-Loss Harvesting

Tax-loss harvesting is also known as tax-loss selling. Most investors use this strategy at the end of the year when they assess the annual performance of their portfolios and its impact on their taxes. An investment that shows a loss in value can be sold to claim a credit against the profits that were realized in other assets.

Tax-loss harvesting is a tool for reducing overall taxes. A loss in the value of Security A could be sold to offset the increase in the price of Security B, thus eliminating the capital gains tax liability of Security B. Using the tax-loss harvesting strategy, investors can realize significant tax savings.

If your capital losses for the year exceed your capital gains, you can deduct up to $3,000 in net losses from your total annual income. If your net losses exceed $3,000, Internal Revenue Service (IRS) rules allow the additional losses to be carried forward into the following tax years.

Maintaining Your Portfolio

Selling an asset at a loss disrupts the balance of the portfolio. After tax-loss harvesting, investors with carefully constructed portfolios replace the asset sold with a similar asset to maintain the portfolio's asset mix and expected risk and return levels. Investors should avoid buying the same asset that they just sold at a loss which may violate the IRS wash-sale rule.

Losses on your investments are first used to offset capital gains of the same type. Therefore, short-term losses are first used to offset short-term capital gains tax, and long-term losses are first used to offset long-term capital gains tax. But net losses of either type can then be deducted against the other kind of gain.

The Wash-Sale Rule

The wash-sale rule requires an investor to avoid buying the same stock sold at a loss for tax purposes. A wash sale involves the sale of one security and, within 30 days, purchasing a substantially identical stock or security. If a transaction is considered a wash-sale, it cannot be used to offset capital gains, and if wash-sale rules are abused, regulators can impose fines or restrict the individual's trading.

Using ETFs that track the same or similar indexes can be used to replace one another while avoiding violating the wash sale rule in a tax-loss harvesting strategy. If you sell one S&P 500 index ETF at a loss, you can buy a different S&P 500 index ETF to harvest the capital loss.

Example of Tax-Loss Harvesting

Assume a single investor earns an income of $580,000 in 2023. The investor's marginal income tax rate is 37% and is subject to the highest long-term capital gains tax category, where gains are taxed at 20%. Short-term capital gains are taxed at the investor's marginal rate.

Below are the investor's portfolio gains and losses and trading activity for the year:


  • Mutual Fund A: $250,000 unrealized gain, held for 450 days
  • Mutual Fund B: $130,000 unrealized loss, held for 635 days
  • Mutual Fund C: $100,000 unrealized loss, held for 125 days

Trading Activity:

  • Mutual Fund E: Sold, realized a gain of $200,000. Fund was held for 380 days
  • Mutual Fund F: Sold, realized a gain of $150,000. Fund was held for 150 days

The tax owed from these sales is:

  • Tax without harvesting = ($200,000 x 20%) + ($150,000 x 37%) = $40,000 + $55,500 = $95,500

If the investor harvested losses by selling mutual funds B and C, the sales would help to offset the gains, and the tax owed would be:

  • Tax with harvesting = (($200,000 - $130,000) x 20%) + (($150,000 - $100,000) x 37%) = $14,000 + $18,500 = $32,500

How Does Tax-Loss Harvesting Work?

Tax-loss harvesting takes advantage of the fact that capital losses can be used to offset capital gains. An investor can "bank" capital losses from unprofitable investments to pay fewer capital gains tax on profitable investments sold during the year. This strategy includes using the proceeds of selling unprofitable investments to buy similar investments that preserve the portfolio's overall balance.

What Is a Substantially Identical Security and How Does It Affect Tax-Loss Harvesting?

The investor cannot violate the IRS' wash sale rule by selling an asset at a loss and buying a substantially identical asset within 30 days before or after that sale. Doing so will invalidate the tax loss write-off. A substantially identical security is defined as a security issued by the same company or a derivative contract issued on the same security.

How Much Tax-Loss Harvesting Can I Use in a Year?

The IRS limits the maximum amount of capital losses used to offset capital gains in a year. An individual taxpayer can write off up to $3,000 in net losses annually. When capital losses exceed $3,000, the excess can be carried forward to future years.

The Bottom Line

Tax-loss harvesting is the timely selling of securities at a loss to offset the amount of capital gains tax owed from selling profitable assets. An individual taxpayer can write off up to $3,000 in net losses annually.

Article Sources
Investopedia requires writers to use primary sources to support their work. These include white papers, government data, original reporting, and interviews with industry experts. We also reference original research from other reputable publishers where appropriate. You can learn more about the standards we follow in producing accurate, unbiased content in our editorial policy.
  1. Internal Revenue Service. "Topic No 409 Capital Gains and Losses."

  2. Internal Revenue Service. "Publication 550: Investment Income and Expenses," Pages 56-57.

  3. Turbotax. "Capital Gains and Losses."

  4. Internal Revenue Service. "IRS Provides Tax Inflation Adjustments for Tax Year 2023."

  5. Internal Revenue Service. "Topic No. 409 Capital Gains and Losses."