Yes, tax loss harvesting can offset short-term capital gains dollar-for-dollar

When you sell an investment at a loss, you can use that loss to reduce capital gains from other sales in the same year. The IRS treats short-term capital gains (profits from assets held one year or less) the same way it treats long-term gains (held over one year) when you're matching them against losses. If you harvested a loss of $5,000 and realized short-term gains of $8,000, you would report a net gain of $3,000 on your tax return.

The mechanics are straightforward: losses offset gains first, then any remaining loss can reduce up to $3,000 of your ordinary income in that tax year. Losses beyond that carry forward to future years. This is one of the few ways the tax code lets you reduce what you owe without waiting for time to pass or circumstances to change.

Key Takeaways

  • A loss from selling one investment can reduce short-term capital gains from selling another investment in the same calendar year, dollar-for-dollar.
  • After losses offset all your gains, you can deduct up to $3,000 of remaining losses against your regular income, with excess losses rolling into future years.
  • The wash-sale rule prevents you from buying back the same or substantially identical security within 30 days before or after the loss sale, or the loss is disallowed.
  • Tax-loss harvesting works best when you have gains to offset; without gains, the $3,000 annual deduction limit means it takes years to use large losses.
  • Holding periods matter for future gains, not for offsetting current losses—a short-term loss offsets a long-term gain just as effectively as it offsets another short-term gain.

How the offset works in practice

The IRS requires you to net all your capital gains and losses together on Schedule D of your tax return. If you sold Stock A for a $2,000 gain and Stock B for a $3,000 loss in the same year, you would report a net loss of $1,000. That $1,000 loss then reduces your taxable income.

The order in which you sold them does not matter. You do not need to match specific gains to specific losses. The IRS straightforward adds up all your short-term gains, adds up all your short-term losses, and nets them. The same happens for long-term gains and losses. Then the two net figures are combined. If you end up with a net loss overall, that loss begins reducing your ordinary income at $3,000 per year.

This is different from how gains and losses work in a retirement account like a 401(k) or IRA. Inside those accounts, you cannot harvest losses at all—the IRS does not let you deduct investment losses from retirement accounts, even if you withdraw money and close the account.

The wash-sale rule and how to avoid it

The biggest trap in tax-loss harvesting is the wash-sale rule. If you sell a security at a loss and then buy the same security (or one that is substantially identical) within 30 days before or after the sale, the IRS disallows the loss. The 30-day window runs from 30 days before the sale through 30 days after it—a 61-day period total.

Substantially identical means the same stock or bond, or a fund that tracks the same index. Buying a similar but different fund is usually safe. For example, if you sell the Vanguard S&P 500 ETF at a loss, you could buy the iShares Core S&P 500 ETF the next day without triggering the rule, because they are different securities even though they track the same index. But buying the same Vanguard fund again within the window disallows the loss.

The disallowed loss does not disappear. Instead, it gets added to the cost basis of the new security you bought. If you sold 100 shares at a $2,000 loss and bought 100 shares of a similar fund the next day, your new shares would have a cost basis $2,000 higher than what you paid. You would eventually realize that loss when you sell the new fund, but only if you do not trigger the wash-sale rule again.

When tax-loss harvesting makes the most sense

Tax-loss harvesting is most valuable when you have capital gains to offset in the same year. If you realized $10,000 in short-term gains from selling one investment and $8,000 in losses from another, harvesting that loss saves you taxes on $8,000 of income. The tax savings depend on your tax bracket—someone in the 24% federal bracket saves $1,920 in federal tax alone.

It is also useful when you have losses but no gains in the current year. The $3,000 annual deduction against ordinary income is real money. If you are in the 24% bracket, a $3,000 deduction saves $720 in federal tax. But if you have a $15,000 loss and no gains, you can only deduct $3,000 that year. The remaining $12,000 carries forward, and you deduct another $3,000 next year, and so on. This is why large losses are most valuable to people who expect to have gains in future years.

Tax-loss harvesting is least useful when you have no gains and no expectation of gains. If you are holding a losing position in a taxable account and do not plan to sell anything else that year, harvesting the loss gives you a $3,000 deduction now and pushes the rest into future years. That is still valuable, but the benefit is spread thin over time.

Holding periods and future tax treatment

Using a loss to offset a short-term gain does not change how you treat future gains from the replacement security. If you sell Stock A at a loss and buy Stock B the next day, and then sell Stock B two years later at a gain, that gain is long-term because you held Stock B for over one year. The fact that you used a short-term loss to offset something else does not make your future gains short-term.

This matters because long-term capital gains are usually taxed at lower rates than short-term gains. Long-term gains are taxed at 0%, 15%, or 20% depending on your income. Short-term gains are taxed as ordinary income, which can be as high as 37%. So if you harvested a loss and bought a replacement fund, holding it for over a year before selling gives you a tax advantage on the future gain, even though the loss you harvested was short-term.

Losses in excess of gains and carryforward

If your total losses exceed your total gains in a year, you can deduct up to $3,000 of the excess against your wages, self-employment income, interest, dividends, and other ordinary income. Any loss beyond $3,000 carries forward to the next year, where it offsets gains first, then ordinary income up to $3,000 again.

This carryforward has no expiration date. If you have a $50,000 loss and no gains, you deduct $3,000 in year one, $3,000 in year two, and so on until the loss is exhausted. The loss stays on your tax return in future years until it is fully used. You do not need to do anything special to claim the carryforward—you straightforward report it on Schedule D in the year you use it.

Carryforwards are also not affected by the wash-sale rule. If you harvest a loss, trigger the wash-sale rule, and the loss gets added to your new security's cost basis, the carryforward still works the same way. The loss is preserved; it just moves to the new security instead of reducing your taxes when ready.

Documenting your trades and losses

Your brokerage statement shows realized gains and losses when you sell. Most brokers calculate this automatically and report it to the IRS on Form 1099-B. You should keep records of the purchase date, sale date, purchase price, and sale price for each trade, especially if you are harvesting losses. If the IRS questions your return, you need to show that the loss was real and that you did not violate the wash-sale rule.

When you file your tax return, you report all gains and losses on Schedule D. If you have many trades, you may also receive a statement from your broker showing the net gain or loss for the year. Use that as a starting point, but verify it against your own records. Brokers sometimes make mistakes, and you are responsible for the accuracy of your return.

If you are concerned about the wash-sale rule, document the dates you sold the losing security and the dates you bought the replacement. A straightforward spreadsheet with these dates makes it straightforward to confirm you stayed outside the 30-day window. This is especially important if you harvest losses frequently or manage multiple accounts.

Frequently Asked Questions

Can I use a loss from one brokerage account to offset gains in another account?

Yes. The IRS treats all your taxable investment accounts as one portfolio for capital gains and losses. Losses in your individual brokerage account offset gains in your spouse's account, your joint account, or any other taxable account you own. Retirement accounts are separate and do not participate in this netting.

What happens if I sell at a loss but buy back the same stock within 30 days?

The wash-sale rule disallows the loss. The loss amount is added to the cost basis of the new shares you bought. You will realize that loss later when you eventually sell the new shares, but only if you do not trigger the wash-sale rule again with another purchase within 30 days of that sale.

Does tax-loss harvesting work if I have no capital gains?

Yes, but with limits. You can deduct up to $3,000 of losses against your ordinary income in a single year. Any loss beyond that carries forward to future years. If you have a $10,000 loss and no gains, you deduct $3,000 now and $3,000 next year, spreading the benefit over time.

If I harvest a loss in December, can I buy back the same fund in January?

No. The wash-sale rule looks back 30 days before the sale and forward 30 days after it. If you sell in December, you cannot buy the same or substantially identical security until after January 30. Buying on January 31 is safe; buying on January 30 is not.

Does harvesting a loss change whether my future gains are short-term or long-term?

No. The holding period for future gains is determined by how long you hold the new security, not by the loss you harvested. If you buy a replacement fund and sell it two years later, that gain is long-term, regardless of whether the loss you harvested was short-term or long-term.