Tax loss harvesting is selling investments at a loss to reduce the taxes you owe on investment gains elsewhere
Tax loss harvesting is a strategy where you sell an investment that has lost value, then use that loss to offset gains you made on other investments. When you sell an investment for more than you paid for it, you owe taxes on that profit. But when you sell an investment for less than you paid, you create a loss. The IRS lets you use losses to cancel out gains, which lowers your total taxable income for the year.
The mechanics are straightforward: you own Stock A, which gained $5,000 in value. You also own Stock B, which lost $3,000 in value. If you sell Stock B at its current price, you lock in a $3,000 loss. That loss reduces your taxable gain from Stock A from $5,000 to $2,000. You pay taxes only on the $2,000 instead of the $5,000. The tax you save depends on your tax bracket — someone in the 24% bracket saves $720 on that $3,000 loss.
This is legal and common among people who manage their own investments or work with financial advisors. It does not require special permission from the IRS. You simply report the loss when you file your tax return.
Key Takeaways
- Selling an investment at a loss creates a deduction that can offset investment gains and reduce your taxable income for the year.
- You can carry unused losses forward to future years if your losses exceed your gains in the current year.
- 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 is disallowed.
- Tax loss harvesting works best when you have significant investment gains and are in a higher tax bracket.
- You must track the cost basis of each investment and report losses on Schedule D when you file your tax return.
How losses offset gains in a single year
When you sell investments during a calendar year, the IRS groups all your sales together. Gains and losses are netted against each other. If you sold five investments and three were winners and two were losers, you add up all the gains and all the losses, then subtract the losses from the gains. The result is your net capital gain or loss for the year.
The order in which you sell does not matter. You could sell the losing investment first in January and the winning investment in December, or vice versa. The IRS treats them as if they happened at the same time for tax purposes. What matters is the total gain or loss across all your sales in that year.
What happens when losses exceed gains
If your losses are larger than your gains, you have a net capital loss. You can use up to $3,000 of that loss to reduce your ordinary income in the current year. Ordinary income is the salary, wages, and other non-investment income you report on your tax return. A $3,000 capital loss reduces your taxable ordinary income by $3,000.
Any loss beyond $3,000 does not disappear. Instead, you carry it forward to the next year. If you have a $7,000 net capital loss, you use $3,000 against ordinary income this year, and the remaining $4,000 rolls into next year. In the next year, you can use another $3,000 against ordinary income, and carry the remaining $1,000 forward again. This continues until the loss is fully used or you die.
This carryforward feature makes tax loss harvesting valuable even in years when you do not have gains. You can build up a loss reserve that shields future gains from taxes.
The wash-sale rule and how it blocks harvesting
The wash-sale rule is the main constraint on tax loss harvesting. It says you cannot claim a loss on an investment if you buy back the same or substantially identical investment within 30 days before the sale or 30 days after the sale. The window is 61 days total: 30 days before, the day of sale, and 30 days after.
If you violate the wash-sale rule, the loss is disallowed. The IRS does not let you use it to offset gains. Instead, the loss is added to the cost basis of the replacement investment you bought. This delays the tax benefit but does not eliminate it entirely.
Substantially identical is the key phrase. It means the same security or one so similar that the IRS treats it as the same. Selling Apple stock and buying Apple stock again is clearly a violation. Selling Apple and buying a technology index fund that includes Apple is a gray area — some advisors argue it is safe, but the IRS has not ruled definitively. The safest approach is to buy a different investment entirely, or wait 31 days before buying back into the same position.
Cost basis and record-keeping requirements
To calculate your loss or gain, you need to know the cost basis of each investment. Cost basis is what you paid for it, including any fees or commissions. If you bought 100 shares of a stock at $50 per share, your cost basis is $5,000 (plus any trading fees).
When you sell, you subtract the cost basis from the sale price. If you sold those 100 shares for $4,000, your loss is $1,000. If you sold for $6,000, your gain is $1,000.
Most brokers track cost basis for you and report it on your tax forms. But you should keep your own records as well. Save confirmation statements from each purchase and sale. If you inherited investments, received them as a gift, or bought them decades ago, the cost basis calculation becomes more complex, and you may need to research historical prices or consult a tax professional.
When tax loss harvesting makes financial sense
Tax loss harvesting is most useful if you have large investment gains and are in a higher tax bracket. Someone with $50,000 in gains and a $30,000 loss saves more in taxes than someone with $5,000 in gains and a $3,000 loss, because the tax rate is applied to a larger amount.
It is also more valuable if you are in the 24% federal tax bracket or higher. In lower brackets, the tax savings are smaller. A $3,000 loss saves $360 in the 12% bracket but $720 in the 24% bracket.
Tax loss harvesting is less useful if you rarely sell investments or if most of your money is in retirement accounts like 401(k)s or IRAs. Retirement accounts do not generate taxable gains or losses, so there is nothing to harvest against. It is also less useful if you have no gains to offset — though the $3,000 ordinary income deduction still provides some benefit.
Reporting losses on your tax return
You report capital gains and losses on Schedule D, which is part of your federal tax return. Schedule D asks for the date you bought the investment, the date you sold it, the cost basis, the sale price, and the gain or loss. Your broker will send you a Form 1099-B that lists all your sales for the year. You use that form to fill out Schedule D.
If you have a net capital loss that exceeds $3,000, you report the $3,000 deduction on your tax return and carry the excess forward. The IRS has a worksheet to help you track carryforwards across multiple years. If you use tax software, it usually handles this calculation for you.
If you made a wash-sale mistake, the IRS will not automatically catch it, but if you are audited and the auditor finds it, the loss will be disallowed and you will owe back taxes plus penalties. It is worth getting this right.
Frequently Asked Questions
Can I harvest losses in a retirement account like a 401(k) or IRA?
No. Retirement accounts are tax-deferred, so you do not owe taxes on gains inside the account. There is nothing to harvest against. The IRS does not allow losses in retirement accounts to be used outside the account either.
What if I sell a stock at a loss and buy it back after 31 days?
The loss is allowed because you waited longer than the 30-day wash-sale window. You can use the loss to offset gains. However, you will have missed 31 days of potential gains or losses on that investment, so the financial outcome depends on how the stock performed during that period.
Do I have to report tax loss harvesting to the IRS when I do it?
No. You only report it when you file your tax return. You do not need to notify the IRS at the time of the sale. Your broker reports the sale to the IRS on Form 1099-B, and you report the loss on Schedule D.
Can I use losses from one type of investment to offset gains from another?
Yes. A loss on a stock can offset a gain on a bond, mutual fund, or any other investment. The IRS treats all capital gains and losses together, regardless of the type of investment.
What if I inherited an investment that is now worth less than what the previous owner paid?
Your cost basis is the value of the investment on the date the previous owner died, not what they originally paid. If that value is higher than the current price, you have a loss you can harvest. If it is lower, you have no loss to harvest.