Tax loss harvesting is selling investments at a loss to offset gains elsewhere on your taxes

Tax loss harvesting means deliberately selling an investment that has lost value, then using that loss to reduce the taxable gains you made on other investments. If you sold stocks or mutual funds for a profit during the year, you owe tax on those gains. A loss from a different investment can cancel out some or all of that tax bill. The IRS allows you to carry unused losses forward to future years if your losses exceed your gains.

The strategy works because investment losses and gains offset each other on your tax return. If you made $5,000 in gains and harvested $3,000 in losses, you would report only $2,000 in net gains to the IRS. This is not a deduction — it is a direct reduction in the income you are taxed on. The tax savings depend on your tax bracket, but someone in the 24% federal bracket would save roughly $720 in federal tax on that $3,000 loss.

Tax loss harvesting is legal and common among people who actively trade investments or hold a taxable brokerage account. It requires tracking which investments you sold, when you sold them, and at what price. You will report these transactions on Schedule D (Capital Gains and Losses) when you file your tax return.

Key Takeaways

  • You can only harvest losses from investments held in taxable accounts — retirement accounts like 401(k)s and IRAs do not generate taxable gains or losses.
  • The wash-sale rule prevents you from buying back the same investment within 30 days before or after the sale, or the loss will not count.
  • Losses that exceed gains in a year can be carried forward indefinitely to offset future gains, though only $3,000 per year can offset other income like wages.
  • Tax loss harvesting works best when you have significant investment gains and are in a higher tax bracket, making each dollar of loss worth more.

How the wash-sale rule limits when you can harvest losses

The wash-sale rule is an IRS rule that disallows a loss if you buy back the same or a substantially identical investment within 30 days before or after the sale. The 30-day window runs from 30 days before the sale through 30 days after the sale — a total span of 61 days. If you sell a stock at a loss on January 15 and buy it back on February 10, the loss does not count because February 10 falls within the 30-day window after the sale.

The rule applies to the same security, not just the same company. If you sell shares of Apple stock at a loss, you cannot buy Apple stock back within the window. However, you can buy a different stock or a mutual fund that holds similar companies. Many people harvest losses in one fund and immediately buy a similar but not identical fund to stay invested in that market segment without triggering the wash-sale rule.

If you violate the wash-sale rule, the loss is disallowed and added to the cost basis of the new shares you bought. This means the loss is not erased — it is deferred until you eventually sell the new shares without buying back in. Tracking wash-sale violations is your responsibility, though your brokerage may flag them or report them to the IRS.

What counts as a capital gain or loss for tax purposes

A capital gain occurs when you sell an investment for more than you paid for it. A capital loss occurs when you sell for less. The difference between what you paid (your cost basis) and what you sold it for (the sale price) is the gain or loss. If you bought 100 shares of a stock for $50 per share ($5,000 total) and sold them for $60 per share ($6,000 total), you have a $1,000 capital gain.

Gains and losses are categorized as short-term or long-term based on how long you held the investment. If you held it for one year or less, it is a short-term gain or loss. If you held it for more than one year, it is a long-term gain or loss. Long-term gains are taxed at lower rates than short-term gains — typically 0%, 15%, or 20% depending on your income, compared to your ordinary income tax rate for short-term gains. When harvesting losses, a long-term loss is generally more valuable because it can offset long-term gains, which are taxed at lower rates.

Dividends and interest earned on investments do not count as capital gains unless you sell the investment. Unrealized gains — profits on investments you still own — also do not count. You only trigger a taxable event when you sell.

How losses offset gains and what happens to excess losses

On your tax return, you net all your capital gains and losses together. If you have $10,000 in long-term gains and $4,000 in long-term losses, you report $6,000 in net long-term gains. Short-term gains and losses are netted separately, then the two groups are combined. The result is your total capital gain or loss for the year.

If your total losses exceed your total gains, you can use up to $3,000 of the excess loss to offset other income — such as wages, interest, or rental income — in that tax year. Any losses beyond $3,000 carry forward to the next year, where they can again offset gains or up to $3,000 of other income. This process continues indefinitely. Someone with $20,000 in losses could use $3,000 per year for seven years, then use the final $1,000 in year eight.

Carrying losses forward is automatic if you report them on your tax return. You do not need to file anything special or notify the IRS. However, you must keep records of the loss and the year it occurred so you can claim it in future years.

Tax loss harvesting only works in taxable accounts, not retirement accounts

Tax loss harvesting applies only to investments in taxable brokerage accounts — regular investment accounts where you pay tax on gains and losses each year. Retirement accounts like 401(k)s, traditional IRAs, Roth IRAs, and SEP IRAs do not generate taxable gains or losses when you buy and sell investments inside them. You can buy and sell as much as you want within these accounts without triggering any tax event.

This is one reason retirement accounts are tax-advantaged: the IRS does not tax the trading activity inside them. It also means you cannot harvest losses from retirement accounts. If you have losses in a retirement account, they stay locked inside that account and do not help reduce your tax bill.

If you have both a taxable account and a retirement account, you might consider holding your riskier or more volatile investments in the taxable account, where you can harvest losses if needed, and holding stable investments in the retirement account.

When tax loss harvesting makes financial sense

Tax loss harvesting is most useful if you have significant investment gains in a given year and are in a higher tax bracket. Someone who made $50,000 in capital gains and is in the 32% federal tax bracket saves roughly $960 in federal tax for every $3,000 in losses harvested. Someone in the 12% bracket saves roughly $360 for the same loss. The higher your tax bracket, the more each dollar of loss is worth.

Tax loss harvesting is also more useful if you actively trade or rebalance your portfolio frequently, because you are more likely to have both gains and losses to work with. Someone who buys and holds the same investments for decades may have few opportunities to harvest losses.

The strategy has a cost: selling an investment and buying a replacement may trigger trading fees or commissions, and you may miss out on gains if the replacement investment performs differently than the original. These costs should be weighed against the tax savings. If the tax savings are small — say, $100 or less — the trading costs may outweigh the benefit.

How to report tax loss harvesting on your tax return

You report all capital gains and losses on Schedule D (Capital Gains and Losses), which you attach to your Form 1040 when you file your federal tax return. Your brokerage will send you a Form 1099-B in January or February showing all the sales you made during the previous year, including the sale price and date. You use this form to fill out Schedule D.

On Schedule D, you list each sale separately, showing the date acquired, date sold, cost basis, sale price, and gain or loss. You then total all your short-term gains and losses, total all your long-term gains and losses, and combine them to find your net capital gain or loss. If you have a net loss, you can deduct up to $3,000 against other income, and any excess carries forward to the next year.

If you use tax software or work with a tax preparer, they will guide you through entering this information. The software will calculate the totals and place them on the correct lines of your return. Keeping organized records — a spreadsheet or file with the details of each sale — makes this process much easier, especially if you harvest losses frequently.

Frequently Asked Questions

Can I harvest losses from my 401(k) or IRA?

No. Retirement accounts do not generate taxable gains or losses. You can buy and sell investments inside these accounts without any tax consequence. Losses inside retirement accounts cannot be used to offset gains elsewhere on your taxes.

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

The loss is disallowed and added to the cost basis of the new shares. The loss is not erased — it is deferred until you sell the new shares. Your brokerage may flag this as a wash-sale violation, and you should report it correctly on your tax return.

Can I harvest losses in December and buy back the investment in January?

No. The wash-sale rule runs 30 days before the sale through 30 days after. If you sell on December 15, you cannot buy back until January 15 or later. Buying back on January 10 would trigger the wash-sale rule.

Do state taxes benefit from tax loss harvesting?

Yes, in most states. Capital gains are taxed at the state level in the same way as the federal level, so losses offset state gains as well. A few states do not tax capital gains, so check your state's rules. Your state tax return will use the same Schedule D information as your federal return.

What if my losses are larger than my gains every year?

You can use $3,000 per year to offset other income like wages. Any excess carries forward indefinitely. If you have $20,000 in losses, you can use $3,000 per year for seven years, then $1,000 in year eight, assuming you do not have gains to offset them first.