How tax loss harvesting works in practice

Tax loss harvesting means selling an investment at a loss, then using that loss to reduce the taxes you owe on investment gains elsewhere. You sell a security (stock, bond, fund) that has dropped in value since you bought it, lock in the loss on paper, and use it to offset gains from other investments that went up. The result is a smaller tax bill.

The mechanics are straightforward: you identify positions in your portfolio that are underwater (worth less than you paid), sell them, and report both the sale and any gains you realized that year to the IRS on Schedule D. The losses reduce your taxable gains dollar-for-dollar. If your losses exceed your gains, you can deduct up to $3,000 of the excess against ordinary income (like wages), and carry forward any remaining losses to future years.

The catch is the wash-sale rule. If you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the IRS disallows the loss. You must wait at least 31 days, or buy something different in the meantime.

Key Takeaways

  • Sell a security worth less than you paid for it, then report the loss on Schedule D when you file taxes to reduce gains from other investments.
  • The wash-sale rule blocks you from claiming the loss if you buy the same or substantially identical security within 30 days before or after the sale.
  • Losses that exceed your gains can reduce ordinary income by up to $3,000 per year, with the remainder carried forward to future tax years.
  • You need a cost basis record (what you paid and when) and the sale price to calculate the loss amount you report.
  • Tax-loss harvesting works best when you have realized gains elsewhere in your portfolio or in prior years that you can offset.

Identifying positions to harvest

Start by reviewing your brokerage statements or portfolio tracker to find securities trading below your cost basis — the original price you paid plus any fees. Most brokers show cost basis and current value side by side. Look for positions where the loss is large enough to matter: a $50 loss on a $10,000 position may not be worth the effort and transaction costs, but a $2,000 loss on a $5,000 position is worth considering.

Prioritize securities you were already planning to sell or rebalance out of anyway. If you hold a bond fund that has underperformed and you wanted to shift to stocks, harvesting the loss as you exit makes sense. If you hold a stock that you still believe in long-term, harvesting the loss means you must either wait 31 days to buy it back or switch to a similar but not identical fund in the meantime — which may not align with your strategy.

Check whether you have realized gains elsewhere in your portfolio that year. If you sold a winning position earlier in the year and locked in a $5,000 gain, a $5,000 loss now cancels it out. If you have no gains to offset, the loss still has value (up to $3,000 can reduce ordinary income), but the tax benefit is smaller.

Executing the sale and avoiding the wash-sale rule

Once you decide to harvest a loss, sell the position at the current market price through your brokerage. Record the sale date and proceeds. The loss is the difference between your cost basis and the sale price.

Now comes the critical step: do not buy the same security or a substantially identical one for at least 31 days. The IRS defines "substantially identical" narrowly for individual stocks (you cannot buy the same stock), but broadly for funds. If you sell a Vanguard total stock market index fund at a loss, buying an iShares total stock market index fund within 30 days is considered substantially identical and triggers the wash-sale rule. Buying a different asset class (bonds instead of stocks, or international stocks instead of U.S. stocks) is safe.

If you want to stay invested during the 31-day window, buy a different security that tracks a similar market segment. If you harvested a loss on a U.S. large-cap stock fund, you could temporarily hold a mid-cap or small-cap fund, or an international equity fund. After 31 days, you can switch back to your original position without penalty.

Mark your calendar for day 31 after the sale. Some brokers flag wash-sale violations automatically, but you are responsible for tracking it. If you accidentally trigger the rule, the loss is disallowed that year and added to the cost basis of the replacement security instead.

Calculating and reporting the loss

The loss amount is straightforward: sale price minus cost basis. If you bought 100 shares at $50 per share ($5,000 total) and sold them at $40 per share ($4,000 total), your loss is $1,000. If you paid a commission or fee to sell, subtract that too.

When you file your tax return, you report the sale on Schedule D (Capital Gains and Losses). List the security name, date acquired, date sold, cost basis, sale price, and the resulting gain or loss. Your broker sends you a Form 1099-B showing all sales; use that as your source document.

On Schedule D, add up all your capital gains and losses for the year. If losses exceed gains, you can deduct up to $3,000 of the net loss against ordinary income (wages, interest, etc.). Any loss beyond $3,000 carries forward to the next tax year, where you can use it again.

If you have a large loss that exceeds $3,000, you will use it over multiple years. A $10,000 loss lets you deduct $3,000 this year and $3,000 next year, with $4,000 remaining for year three. Keep records of carryforward losses so you do not lose track of them.

Tax-loss harvesting in retirement and tax-advantaged accounts

Tax-loss harvesting only works in taxable brokerage accounts. In a 401(k), IRA, or other tax-advantaged account, you do not report gains or losses to the IRS each year, so harvesting a loss has no immediate tax benefit. The wash-sale rule still applies to these accounts, but the loss disallowance is less useful because you were not claiming the loss anyway.

If you hold the same security in both a taxable account and a retirement account, selling it at a loss in the taxable account and buying it in the retirement account within 30 days triggers the wash-sale rule. The IRS treats the accounts as a single portfolio for this purpose. Avoid this by harvesting in the taxable account only, or waiting 31 days before buying in the retirement account.

When tax-loss harvesting makes sense

Tax-loss harvesting is most valuable if you have significant realized gains in the same year. If you sold a winning stock or fund earlier in the year and owe capital gains tax on it, harvesting losses now reduces that bill dollar-for-dollar. The benefit is immediate and concrete.

It also makes sense if you have carried-forward losses from prior years that you have not yet used. If you have a $5,000 loss carryforward from last year and you realize a $3,000 gain this year, harvesting a $2,000 loss now lets you use the entire carryforward and break even on taxes.

If you have no gains to offset and no carryforward losses, harvesting still saves money — up to $3,000 of loss can reduce ordinary income, which is worth roughly $750 to $1,200 depending on your tax bracket. But the benefit is smaller, and you must weigh it against transaction costs and the inconvenience of the 31-day wash-sale window.

Common mistakes and how to avoid them

The most common mistake is buying back the same security too quickly. Set a phone reminder for day 31 after the sale. If you forget and buy back within 30 days, the loss is disallowed and added to your new cost basis, which delays the tax benefit but does not eliminate it.

Another mistake is harvesting losses in a retirement account, where they provide no tax benefit. Before you sell, confirm the account type. Taxable accounts show up as "Brokerage" or "Individual" on your statements; retirement accounts are labeled 401(k), IRA, Roth IRA, or similar.

A third mistake is underestimating the impact of transaction costs. If your broker charges a commission per trade, harvesting a small loss may cost more in fees than you save in taxes. Most modern brokers offer commission-free stock and ETF trades, but check your fee schedule before you proceed.

Finally, do not harvest losses just because they exist. If you hold a position you believe in long-term and the loss is temporary, harvesting forces you to either sit out of the market for 31 days or buy a different security that may not match your strategy. Only harvest when the tax benefit outweighs the disruption to your portfolio.

Frequently Asked Questions

What happens if I accidentally buy the same security within 30 days?

The loss is disallowed for that tax year, and the loss amount is added to the cost basis of the replacement security instead. You do not lose the loss entirely — it just delays the tax benefit until you eventually sell the replacement. To avoid this, set a calendar reminder for day 31 after the sale.

Can I harvest losses on mutual funds and ETFs?

Yes, but the wash-sale rule applies more strictly. If you sell a Vanguard total stock market fund at a loss, buying an iShares total stock market fund within 30 days is considered substantially identical and triggers the rule. Switching to a different asset class (bonds, international stocks, small-cap stocks) is safe.

Do I have to report tax-loss harvesting to my broker or the IRS?

You report it on Schedule D when you file your tax return. Your broker sends you a Form 1099-B listing all sales; use that to fill out Schedule D. You do not need to flag the transaction as a harvest — just report the sale and loss like any other.

Can I use losses to offset capital gains from cryptocurrency or real estate?

Yes. Capital losses from any source (stocks, bonds, funds, crypto, real estate) can offset capital gains from any source. Report all gains and losses on Schedule D, and the IRS nets them together.

What if my loss is larger than my gains for the year?

You can deduct up to $3,000 of the excess loss against ordinary income (wages, interest, dividends). Any loss beyond $3,000 carries forward to the next tax year, where you can use it again. Keep records of the carryforward so you remember to claim it.