WealthCornerstone
Taxes

What Is Tax-Loss Harvesting and How Does It Work?

Learn how to offset capital gains by strategically selling losing investments

By Jordan Hayes··12 min read

Tax-loss harvesting is a simple way to use your investment "oopsies" to pay less in taxes to the government. If you sell a stock or a fund for less than you paid for it, you can use that loss to cancel out the taxes you would normally owe on your winning investments. This strategy, known as tax loss harvesting, is a common way for investors to keep more of their money working for them rather than handing it over to the IRS. By strategically selling losing assets, you can offset capital gains and potentially reduce your ordinary taxable income, making it a cornerstone of any sophisticated investment tax strategy.

Understanding how to manage your tax liability is just as important as picking the right stocks. Imagine you had a great year and sold some shares of a tech company for a $10,000 profit. Under normal circumstances, you might owe the government $1,500 or more in capital gains taxes. However, if you also have a different investment that has dropped by $10,000 and you sell it, those two cancel each other out. You end up with a net gain of zero for tax purposes, even though you still have the original $10,000 profit in your pocket. This article is for educational purposes only and does not constitute personalized financial advice. Consult a qualified financial advisor before making significant financial decisions.

The Mechanics of an Effective Investment Tax Strategy

The central framework of tax-loss harvesting relies on the concept of "realizing" a loss. On paper, your investments might go up and down every day, but these are only "unrealized" gains or losses. The IRS only cares when you actually sell the asset. Once you sell, that loss becomes "realized," and it can be used as a powerful tool on your tax return. To make this work, you must understand the priority of offsets. The IRS requires you to first use short-term losses to offset short-term gains, and long-term losses to offset long-term gains. If you have excess losses in one category, they can then be applied to the other.

Consider the case of Marco, a 45-year-old marketing director with a taxable brokerage account. Marco had a stellar year with his holdings in a semiconductor ETF, which he sold for a $15,000 long-term capital gain. However, he also held a clean energy fund that had declined significantly, showing an unrealized loss of $12,000. By selling the clean energy fund before December 31, Marco realized that $12,000 loss. When he files his taxes, his $15,000 gain is reduced by the $12,000 loss, leaving him with a net taxable gain of only $3,000. Depending on his tax bracket, this move could save Marco over $1,800 in immediate tax payments.

To execute this strategy effectively, you should follow these three steps:

  1. Identify underperforming assets: Review your taxable accounts for any investments currently worth less than your "cost basis" (the price you paid for them plus any commissions or fees).
  2. Calculate your net position: Determine your total realized gains for the year across all your accounts to see how much of a "tax bill" you are currently facing.
  3. Execute the sale: Sell the losing positions to lock in the capital loss, ensuring you do so before the final trading day of the calendar year.

The Foundation: Offsets and the $3,000 Income Rule

A common question for many investors is what happens if your losses are actually greater than your gains. This is where tax-loss harvesting becomes even more beneficial for high-income earners. If your total capital losses exceed your total capital gains for the year, the IRS allows you to use up to $3,000 of those excess losses to offset your ordinary income, such as your salary or wages. If you still have losses left over after that $3,000 deduction, you don't lose them; you can "carry forward" those losses to future tax years indefinitely.

Let's look at Jennifer, a software engineer who experienced a significant market downturn. Jennifer sold several stocks at a total loss of $20,000 but only had $5,000 in capital gains for the year.

  • First, her $20,000 loss wiped out her $5,000 gain, leaving her with $15,000 in remaining losses.
  • Second, she applied $3,000 of that remainder to her $110,000 salary, reducing her taxable ordinary income to $107,000.
  • Finally, the remaining $12,000 in losses is carried forward to next year, where she can use it to offset future gains.
Tax Scenario No Harvesting With Strategic Harvesting
Realized Capital Gains $10,000 $10,000
Realized Capital Losses $0 ($13,000)
Net Capital Gain/Loss $10,000 Gain ($3,000) Loss
Ordinary Income Offset $0 ($3,000)
Taxable Amount Change +$10,000 -$3,000
Estimated Tax Impact* Pays ~$1,500 tax Saves ~$700-$1,000 tax

\Assumes a 15% capital gains rate and a 24% ordinary income bracket.*

Use the calculator below to find your number in seconds.

Monthly Investment Calculator

See exactly how much you should be investing each month.

$
%

Strategic Portfolio Management: The Wash-Sale Rule

The most important rule to keep in mind when practicing tax-loss harvesting is the "Wash-Sale Rule." The IRS does not want people selling a stock just to claim a tax break and then immediately buying it back. If you sell an investment for a loss and buy the same investment—or one that is "substantially identical"—within 30 days before or after the sale, the loss will be disallowed for tax purposes. This 61-day window (30 days before, the day of the sale, and 30 days after) is a critical boundary for any investment tax strategy.

Take the example of Kevin, an enthusiastic investor who sold 100 shares of an S&P 500 index fund to harvest a $4,000 loss. Two weeks later, fearing he would miss out on a market rally, he bought back those same 100 shares. Because he bought the shares back within the 30-day window, the IRS considers this a wash sale. Kevin cannot claim the $4,000 loss on his taxes this year. Instead, that $4,000 loss is added to the cost basis of his new shares, delaying his tax benefit until he sells the new shares and stays out of the position for at least 31 days.

To avoid the wash-sale trap while keeping your money invested in the market, many investors use a "substitution" strategy:

  • Sell an individual stock and buy an ETF: If you sell Ford at a loss, you might buy a Broad Automotive ETF. These are not "substantially identical."
  • Sell one index fund and buy a similar one: You might sell a Vanguard S&P 500 ETF and buy a Charles Schwab Large-Cap ETF. While they track similar companies, they often track different indices, which many advisors believe avoids the wash-sale rule.
  • Wait out the window: Simply move the proceeds into a high-yield money market account for 31 days before moving back into your original position.

Identifying Harvesting Opportunities Across Different Asset Classes

Tax-loss harvesting isn't just for stocks; it can be applied to mutual funds, ETFs, and even cryptocurrencies (though the rules for crypto are currently subject to evolving IRS guidance). The key is to look for "tax alpha"—the extra return you get from managing your taxes efficiently. In a diversified portfolio, it is common for one asset class to be down even when the overall market is up. These periods of volatility are actually the best times to harvest losses.

Consider Sophia, who maintains a balanced portfolio of 60% stocks and 40% bonds. During a year where interest rates rose sharply, her bond funds dropped in value by 12%. Even though her stock holdings were up, Sophia decided to sell her bond fund to realize a $6,500 loss. She immediately used the proceeds to buy a different bond fund with a similar duration and credit quality but from a different fund provider. By doing this, she maintained her 60/40 asset allocation and her exposure to the bond market, but she "locked in" a $6,500 tax deduction that she used to offset the dividends and gains produced by her stocks.

When looking for opportunities, keep these considerations in mind:

  • Check your lots: Don't just look at the average price you paid. Use "Specific Identification" (SpecID) to sell only the specific shares that are currently trading at a loss.
  • Avoid harvesting in tax-advantaged accounts: Tax-loss harvesting only works in taxable brokerage accounts. You cannot harvest losses in a 401(k), IRA, or Roth IRA because those accounts are already tax-deferred or tax-free.
  • Transaction costs: Ensure the tax savings of the harvest are greater than the commissions or "bid-ask spread" costs of selling and buying back a new security.

The Cost of Ignorance: A Tax-Loss Harvesting Mistake Simulation

The most visceral way to understand the importance of doing this correctly is to see what a mistake looks like in real dollars. Many investors accidentally trigger wash sales because they don't realize the rule applies across all their accounts, including their spouse's accounts and their own IRAs. This is often called the "IRA Wash-Sale Trap," and it is one of the most expensive mistakes you can make.

Let's simulate a scenario with Robert. Robert has a taxable brokerage account and a Roth IRA. In his taxable account, he sells a technology stock for a $15,000 loss. He plans to use this loss to offset a large gain from a real estate sale. However, on the same day, Robert’s automated dividend reinvestment plan in his Roth IRA buys $200 worth of that same technology stock.

Because the "substantially identical" security was purchased within 30 days in his IRA, the entire loss—or a portion of it—is disallowed. But here is the kicker: in a normal brokerage account, a wash sale just moves the loss to the new shares' cost basis. In an IRA, you cannot increase your cost basis because IRA withdrawals are taxed differently (or not at all). Robert has essentially made that $15,000 tax deduction vanish forever.

The Real Dollar Cost for Robert:

  1. Lost Tax Deduction: $15,000
  2. Estimated Capital Gains Tax Rate: 20%
  3. Immediate Cash Cost: $3,000 in taxes he wouldn't have owed.
  4. Opportunity Cost: If he had that $3,000 and invested it at a 7% return for 20 years, it would have grown to over $11,600.

Robert's small mistake of not turning off his automated dividend reinvestment cost him over $14,000 in long-term wealth. This highlights why precision is vital when executing an investment tax strategy.

Advancing Your Knowledge: Next Steps

Tax-loss harvesting is a powerful tool, but it is just one piece of a much larger puzzle. To truly optimize your financial life, you must understand how these moves fit into your broader year-end planning and retirement goals. If you aren't careful, you could end up in a lower tax bracket today only to face a much higher one in the future, a concept known as "tax bracket arbitrage."

The best next step is to look at your overall tax picture holistically. You should learn more about how different types of income are taxed to ensure you are placing the right investments in the right accounts. For a deeper dive into managing your obligations to the IRS and protecting your wealth, explore our comprehensive guide on broad investment tax strategies. Taking the time to understand these rules today can save you thousands of dollars over your investing lifetime.

By staying proactive, monitoring your "paper losses," and respecting the 30-day wash-sale window, you can turn market volatility into a tax-saving opportunity. Remember that the goal of investing is not just to grow your wealth, but to keep as much of that growth as possible.

Frequently Asked Questions

Can I use tax-loss harvesting for my crypto investments?

Yes, currently the IRS treats cryptocurrency as property, which means you can use losses in Bitcoin, Ethereum, or other tokens to offset your capital gains from stocks or other crypto. One interesting quirk is that, as of current regulations, the "Wash-Sale Rule" technically only applies to "securities," and the IRS has not yet officially classified all cryptocurrencies as such. This has allowed some investors to sell crypto at a loss and buy it back much sooner than 30 days. However, tax professionals often warn that the "Economic Substance Doctrine" could still allow the IRS to challenge these trades, and new legislation frequently targets this specific loophole, so caution is advised.

Does tax-loss harvesting actually "save" taxes or just delay them?

In many cases, tax-loss harvesting is a tax deferral strategy rather than a permanent tax disappearance. When you sell an asset at a loss and buy a similar one, your "cost basis" in the new asset is usually lower than the original one. This means that when you eventually sell the new asset years down the road, your taxable gain will be larger. However, this is still highly beneficial because of the time value of money. By saving $2,000 in taxes today and investing that $2,000 for twenty years, you can significantly outperform the eventual tax bill you will owe in the future.

What is the maximum amount of losses I can claim in one year?

There is no limit to the amount of capital losses you can use to offset capital gains. If you have $100,000 in gains and $100,000 in losses, you can offset the entire amount and owe $0 in capital gains tax. However, if your losses exceed your gains, you are limited to using only $3,000 of that excess to offset your "ordinary income" (like your paycheck). Any remaining losses above that $3,000 limit are not lost; they "roll over" to the next tax year. You can continue rolling these losses over for the rest of your life until they are fully used up.

Try it yourself

Monthly Investment Calculator

See how much more you keep after tax savings
Jordan Hayes

Founder & Lead Editor, WealthCornerstone

Jordan researches and reviews personal finance topics with a focus on accuracy and plain-language explanations. All AI-assisted content is reviewed before publication. Editorial policy