When you start investing, you don’t set out with the goal of losing money. But part of having a well-diversified portfolio is embracing the reality that while some stocks perform well, you always pick a few duds.

Luckily, you aren’t destined to be a loser just because some of your stocks are. Tax loss harvesting is an investing strategy that can turn a portion of your investment losses into tax offsets, helping turn financial losses into wins.

What Is Tax Loss Harvesting?

Tax loss harvesting is what happens when you sell some investments at a loss to offset gains you’ve realized in other investments. The result is that you only pay taxes on your net profit, or the amount you’ve gained minus the amount you lost, thereby reducing your tax bill.

In addition, investors can use the proceeds from the sale of their floundering assets to fund purchases of similar investments that may grow over time—presumably more than the investments they just sold—and help recoup their losses. Those future gains can then be offset by any future losses, perpetuating a virtuous cycle of tax savings.

A quick reminder: When you sell an investment asset for a profit, you owe capital gains taxes on the profits based on how long you held the asset. If you owned it for less than one year, you’ll pay your normal income tax rate on any gains. If you held it for more than one year, you’ll owe the preferential long-term capital gains rate, which could be as low as 0% but won’t exceed 20%, even for top earners.

Keep in mind that if you hope to harvest losses and enjoy the benefits they offer, sales transactions must be completed before the end of the tax year. For example, if you want to harvest losses from 2023, the transactions would have had to be completed by December 31, 2023.

Tax Loss Harvesting and Ordinary Income

While investment losses are often used to reduce capital gains taxes, even those who do not report capital gains can benefit from tax loss harvesting. That’s because investment losses can also be used to offset taxes on your ordinary income.

Single filers and married couples filing jointly can deduct up to $3,000 in realized losses from ordinary income. Married couples filing separately can each deduct $1,500 from ordinary income. If you have more than $3,000 in realized losses, the excess losses can be carried over into future tax years in $3,000 increments.

Remember, you must first use capital losses on investments to offset cap gains of the same type. Short-term losses must first be applied against short-term gains, and long-term losses must be deducted against long-term gains. Only then can any remaining losses of either type be used to offset the other type of gain.

Yes, but there are limits. Losses on your investments are first used to offset capital gains of the same type. So, short-term losses are first deducted against short-term gains, and long-term losses are deducted against long-term gains. Net losses of either type can then be deducted against the other kind of gain.

After that, if you still have net losses, you can use those outstanding net losses against ordinary income like wages and pension income.

Additional Considerations for Tax Loss Harvesting

Wash Sales

Besides reducing your taxes, tax loss harvesting also frees up cash so you can buy new assets that may be more likely to generate positive performance. You’ll probably want to buy a similar type of investment to keep your asset allocation and risk profile aligned with your overall investment strategy.

There are rules to keep in mind while navigating your next purchase. You can’t, for instance, sell a stock to realize a loss and minimize your tax burden—and then rebuy that exact same stock, or even one that’s nearly identical.

This maneuver is referred to as a wash sale. A wash sale occurs when you sell securities at a loss and within 30 days before or after the sale buy “substantially” identical securities, or acquire a contract or option to do so.

The wash sale rule does not, however, preclude purchasing securities in the same industry. For example, you can sell shares of Pfizer and replace them with shares of Merck. Alternatively, you could invest in an industry-specific exchange-traded fund (ETF) or mutual fund that fits your investment strategy.

Cost-Basis Calculations

To calculate capital gains and losses (and therefore how much you can harvest), you need to know the cost basis, or what you originally paid for a security. If you bought all your shares at once, this should be easy to find and calculate gains from.

But chances are you accrued your shares over time, using a strategy like dollar cost averaging. While dollar cost averaging can help lower the amount you pay for investments on average, it can also create record-keeping challenges.

You’ll need to know the date and value you purchased each share at so you can calculate how much it’s grown and whether it’s eligible for long- or short-term capital gains taxes. Luckily, your brokerage should at the very least have a record of your original purchase date and price that you can then use to determine your actual gains.

Robo-Advisors and Tax Loss Harvesting

If you’re interested in tax loss harvesting but don’t want to deal with the hassle of the logistics, many leading robo-advisors not only automate the investment process, but they also provide complimentary harvesting of taxable losses to minimize your burden.

Platforms like Betterment and Wealthfront sell low-performing securities and buy replacements for you automatically on a regular basis.

Should You Use Tax Loss Harvesting with Your Investments

For investors who hold securities in taxable accounts (which of course refers to accounts other than your retirement accounts like IRAs and 401(k)s), tax loss harvesting can be a very effective strategy, says David Mullins, a certified financial planner (CFP) at Mullins Wealth in Richlands, Va. “By utilizing these losses, you in essence make lemonade out of lemons,” he says.

In fact, researchers at MIT and Chapman University calculated that tax loss harvesting yielded almost an additional 1% annual return each year from 1928 to 2018.

While investors can benefit from harvesting losses any time, down markets may offer even greater opportunities to realize losses and use sale proceeds to purchase other securities at bargain prices. In addition to offsetting losses against gains, new investments may enhance portfolio performance as the market recovers.

Michael Baughman of Parsec Financial cautions that “harvesting losses is most appropriate and beneficial when it generates tax savings without disrupting or abandoning the primary investment strategy… We harvest losses only when we can immediately reinvest in a suitable (but not identical) replacement that preserves the overall strategy,” he says.

Tax loss harvesting also yields the greatest benefits for investors in higher tax brackets. That’s because the higher your income tax bracket, the more money you can save by minimizing your taxable gains. Moreover, investors in higher tax brackets are also likely to have more invested assets and more opportunity for offsetting transactions.

Meanwhile, those earning $44,625 or less in 2023 ($47,025 in 2024) as single filers or $89,250 or less in 2023 ($94,050 in 2024) as joint filers, for instance, won’t owe anything on their long-term capital gains, making tax-loss harvesting a moot point for them. For those who make more than those cutoffs but who aren’t huge traders, it’s important to weigh factors such as transaction costs and complexity against the potential benefits.

No matter what tax bracket you find yourself in, harvesting losses can create additional burdens. To fully realize the benefits of tax loss harvesting with a minimum of headaches, it’s always wise to work with an experienced financial advisor.