How Tax Loss Harvesting Works and When It Might Fit Your Portfolio
Tax loss harvesting is selling an investment at a loss to offset gains you made elsewhere, reducing the taxes you owe that year
When you sell an investment for less than you paid for it, you create a loss. The IRS lets you use that loss to cancel out gains from other investments you sold at a profit. If your losses are larger than your gains, you can deduct up to $3,000 of the remaining loss against your ordinary income (like wages or interest) in a single tax year. Any loss beyond that carries forward to future years, where you can use it the same way.
The strategy works because investment losses and gains don't have to happen in the same account or the same month. You can sell a stock fund that dropped 15% in January, lock in that loss, and use it to offset a bond fund you sold at a 20% gain in November. The timing and the accounts are separate — only the tax outcome matters.
Key Takeaways
- You can use investment losses to reduce taxes on investment gains dollar-for-dollar, and carry unused losses forward to future years.
- The wash-sale rule prevents you from buying back the same or substantially identical investment within 30 days before or after the sale, or the loss won't count.
- Tax loss harvesting works best when you have significant gains in a taxable account and investments that have actually declined in value.
- You must track the cost basis of every investment you own to calculate whether you have a gain or a loss when you sell.
How the math works: gains, losses, and what you owe
Suppose you sold a mutual fund for $12,000 that you originally bought for $15,000. That $3,000 loss can offset a $3,000 gain from another investment. If you had a $5,000 gain and a $3,000 loss, your net gain is $2,000, and you pay tax only on that $2,000.
If your losses exceed your gains — say you have $8,000 in losses and only $5,000 in gains — you can deduct $3,000 of the remaining loss against your regular income (wages, salary, interest from savings). That $3,000 deduction reduces your taxable income for the year. The remaining $5,000 loss doesn't disappear; it rolls into next year, where you can use it the same way: first against any gains, then up to $3,000 against ordinary income.
This process continues year after year until you've used up the entire loss. A large loss from a single bad investment can shelter gains for several years.
The wash-sale rule: the main trap
The wash-sale rule is the biggest obstacle to tax loss harvesting. It says you cannot buy back the same investment (or one that is substantially identical) within 30 days before you sell it or 30 days after. If you do, the IRS disallows the loss, and you cannot use it to offset gains or income.
The rule exists to prevent people from selling an investment just to claim a loss, then when ready buying it back. The 30-day window runs from 30 days before the sale through 30 days after — a total span of 61 days. If you sell on January 15, you cannot buy back the same investment from December 16 (the year before) through February 14.
What counts as "substantially identical"? The IRS does not publish a precise definition, but the general rule is that the same fund or stock is obviously identical. A different fund in the same sector or asset class is usually not identical. If you own a total stock market index fund and sell it at a loss, you could buy a different total stock market index fund from another provider and still claim the loss — though some tax professionals recommend waiting a few days to be safe. Buying a bond fund or a different stock fund is clearly not identical.
Which accounts let you harvest losses
Tax loss harvesting only works in taxable accounts — regular brokerage accounts where you report gains and losses to the IRS each year. It does not work in retirement accounts like 401(k)s, traditional IRAs, or Roth IRAs. Those accounts are tax-deferred or tax-free, so you never report gains or losses on individual trades inside them. You cannot harvest losses there because there are no taxable gains to offset.
If you have investments in both a taxable account and a retirement account, you can harvest losses only from the taxable account. The losses stay in that account and reduce the taxes you owe on that year's income.
When tax loss harvesting actually saves you money
Tax loss harvesting saves money only if you have investment gains to offset or ordinary income to reduce. If you have no gains and your income is already low, harvesting a loss does nothing for you that year — though the loss still carries forward.
The size of your tax savings depends on your tax bracket. If you are in the 24% federal tax bracket and you harvest a $10,000 loss, you save roughly $2,400 in federal taxes (24% of $10,000). If you are in the 12% bracket, the same loss saves roughly $1,200. State income tax, if your state has it, adds to the savings.
The strategy also works best when you have significant gains in a taxable account and investments that have actually declined in value. If all your investments are up, there is nothing to harvest. If you have only small gains and small losses, the tax savings may not be worth the effort of tracking and rebalancing.
Cost basis and record-keeping
To know whether you have a gain or a loss, you need to know your cost basis — the original price you paid for the investment, plus any fees or commissions. Most brokers track this automatically and show it on your account statements and tax documents.
When you sell an investment, the broker reports the sale price and your cost basis to the IRS on a Form 1099-B. You report the gain or loss on Schedule D of your tax return. If you bought the same investment multiple times at different prices, you can choose which shares to sell — a method called specific lot identification. This lets you pick the shares with the highest cost basis, which creates the largest loss.
Keep records of every purchase and sale for at least three years after you file your tax return. If you harvest a loss and then buy back a similar investment, document the dates and the names of both investments to show they are not substantially identical.
Rebalancing after a harvest
After you sell an investment at a loss, your portfolio is no longer balanced the way you intended. If you sold a stock fund to harvest a loss, you now have less in stocks and more in cash. You need to decide whether to rebalance back to your target allocation.
Many people rebalance by buying a different investment in the same category — for example, selling a large-cap stock fund at a loss and buying a mid-cap or small-cap stock fund. This keeps you invested in stocks without triggering the wash-sale rule. Others wait a few weeks or months before rebalancing, accepting the temporary shift in their allocation.
The decision depends on your investment goals and how far your allocation has drifted. If you are only slightly off target, waiting may make sense. If you are significantly underweighted in stocks, rebalancing sooner is probably better for your long-term returns.
Frequently Asked Questions
Can I harvest losses in a 401(k) or IRA?
No. Retirement accounts do not generate taxable gains or losses. You never report individual trades to the IRS, so there is nothing to harvest. Tax loss harvesting works only in taxable brokerage accounts.
What happens if I accidentally buy back the same investment within 30 days?
The IRS disallows the loss, and you cannot use it to offset gains or income that year. The loss does not disappear entirely — it gets added to the cost basis of the new shares you bought, which means you will have a smaller gain (or larger loss) when you eventually sell those shares.
Do I have to report tax loss harvesting to the IRS?
You do not file a separate form. Your broker reports the sale on Form 1099-B, and you report the gain or loss on Schedule D of your tax return. The IRS sees the transaction automatically. If you carry a loss forward to a future year, you report that on Schedule D as well.
Is tax loss harvesting worth doing if I only have small losses?
It depends on your tax bracket and how much time you want to spend tracking. If you are in a high tax bracket and have several thousand dollars in losses, the tax savings are real. If you have only a few hundred dollars in losses, the savings may be small enough that the record-keeping is not worth it.
Can I harvest losses from cryptocurrency or other investments?
Yes. The same rules explore to any investment you own in a taxable account — stocks, bonds, mutual funds, ETFs, and cryptocurrency. You report the loss on Schedule D just like any other investment loss.
This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.