INVESTING · LEVEL 3 · LESSON 1
Three numbers that run this whole lesson
Before you start: this lesson assumes you know the difference between a taxable brokerage account and an IRA, as explained in 401(k), IRA and Brokerage Accounts.
Marcus opened his first brokerage account three years ago. This year, he sold some shares of an S&P 500 index fund to help pay for a new car, and that sale left him with an $8,000 profit. Meanwhile, another fund he bought in a hurry last spring is now worth $5,000 less than he paid. In December, a friend tells him he can “use that loss” to pay less tax. Marcus has no idea what that means.
That move is called tax-loss harvesting, and it is one of the few tax strategies an ordinary investor can use without an accountant. In this lesson, we work through Marcus’s numbers, explain the limits the IRS sets and show you the one rule that ruins the strategy for many people: the wash-sale rule.
What tax-loss harvesting actually does
When an investment loses value, you do not have a loss for tax purposes yet. On paper, the fund is simply worth less. The loss only becomes real, or realized, when you sell. Tax-loss harvesting means selling, on purpose, an investment that is worth less than you paid. That way, you can use the realized loss on your tax return.
According to the IRS rules on capital gains and losses, a realized loss works in three layers:
- First, it cancels out gains. Losses reduce the profits you made from selling other investments in the same year.
- Then, it can reduce your regular income. If your losses are bigger than your gains, you can deduct up to $3,000 of the difference from income such as your salary, or $1,500 if you are married and file separately.
- Finally, the rest waits for later years. Any loss above that limit carries forward to future tax years, with no expiration date for individuals.
This only works in a taxable brokerage account. Gains and losses inside a 401(k) or an IRA do not show up on your yearly tax return, so selling at a loss there saves you nothing. If you want a refresher on how those accounts are taxed, see Roth IRA vs. Traditional IRA.
Why short-term and long-term gains matter
Not every gain is taxed the same way. If you held an investment for one year or less, the profit is a short-term gain and is taxed like your salary. If you held it for more than one year, it is a long-term gain and gets lower rates. For 2026, those rates depend on your taxable income:
| Long-term rate | Single filers | Married filing jointly |
|---|---|---|
| 0% | Up to $49,450 | Up to $98,900 |
| 15% | $49,451 to $545,500 | $98,901 to $613,700 |
| 20% | Over $545,500 | Over $613,700 |
Taxable income thresholds for 2026, as published by the IRS and summarized by Kiplinger. State income taxes are extra in most states.
The IRS also matches losses and gains in a set order. Long-term losses are used against long-term gains first, and short-term losses against short-term gains. Only what is left over crosses to the other type. In practice, this means a loss is most valuable when it cancels a short-term gain, because those gains carry the highest rate.
Marcus’s numbers, before and after
Marcus is single, his taxable income puts him in the 22% bracket, and he held the fund he sold for more than a year. So his $8,000 profit is a long-term gain taxed at 15%. Here is what happens if he does nothing, and what changes if he sells the losing fund before December 31:
| Does nothing | Harvests the $5,000 loss | |
|---|---|---|
| Long-term gain this year | $8,000 | $8,000 |
| Realized loss | $0 | $5,000 |
| Net taxable gain | $8,000 | $3,000 |
| Federal tax at 15% | $1,200 | $450 |
| Tax saved | None | $750 |
Original Money Behaves example. It assumes a 15% long-term rate and ignores state taxes and trading costs.
Now imagine a different year. Suppose Marcus had sold nothing at a profit, but still harvested the same $5,000 loss. In that case, he could deduct $3,000 from his regular income. At his 22% bracket, that cuts his tax by about $660, and the remaining $2,000 carries forward to next year.
Try it with your own numbers
How to use it: enter the gains you have already realized this year, then the loss you could harvest and how long you have held that investment. Next, pick your tax bracket and your long-term rate from the table above. The example starts with Marcus’s numbers.
HARVEST ESTIMATOR
Where would your loss go?
Enter this year’s realized gains and the loss you could harvest. The bar shows how the IRS would use each dollar of that loss.
ESTIMATED FEDERAL TAX SAVED THIS YEAR
–
LOSS LEFT FOR FUTURE YEARS
–
Simplified estimate for a single filer in 2026. It uses the $3,000 yearly limit, follows the IRS order for matching short-term and long-term amounts and taxes short-term gains at your bracket. It ignores state taxes, the 3.8% net investment income tax, trading costs and any losses carried in from earlier years.
The wash-sale rule: the trap that cancels your loss
Here is the catch. Marcus still likes his losing fund and expects it to recover. So his first instinct is to sell it on Monday and buy it back on Tuesday. However, the IRS blocks exactly that move.
Under the wash-sale rule, explained in IRS Publication 550, you cannot claim a loss if you buy the same or a “substantially identical” investment within 30 days before or 30 days after the sale. Together with the day of the sale, that creates a 61-day window.
30 DAYS BEFORE
Do not buy the same fund
SALE DAY
Sell at a loss
30 DAYS AFTER
Do not buy it back
Buying a substantially identical investment anywhere in this window, in any of your accounts, turns the loss into a wash sale.
The window catches more than people expect. For example, a purchase in your IRA counts, and so does a purchase by your spouse. Also, automatic dividend reinvestment can trigger it, because a reinvested dividend is a new purchase of the same fund. So before you harvest a loss, turn off reinvestment for that fund in all your accounts.
A wash sale in a taxable account does not erase the loss forever. Instead, the IRS adds it to the cost of the new shares, so you get the benefit later, when you sell them. The IRA case is harsher. According to IRS Revenue Ruling 2008-5, if you buy the same investment inside an IRA, the loss is simply gone.
How investors stay invested without breaking the rule
The goal of harvesting is to capture the loss, not to leave the market. Fortunately, there are two common ways to stay invested:
- Swap to a similar, not identical, fund. For instance, an investor might sell an S&P 500 index fund and buy a total U.S. stock market fund. Both hold large U.S. companies, but they follow different indexes. The IRS has never defined “substantially identical” precisely for funds, so two funds tracking the same index from different companies sit in a gray area that many investors avoid.
- Wait 31 days and buy the original back. This is the simplest route. The trade-off is that your money sits in cash for a month, and the market could rise while you wait.
If you are not sure how two funds differ, compare their indexes and holdings first. Our guide to ETFs vs. index mutual funds shows where to look, and Expense Ratios Explained helps you check that the replacement does not cost much more each year.
MONEY TRAP
Selling a loser feels like admitting a mistake
Most people hold on to losing investments far longer than they hold on to winners. Economists Hersh Shefrin and Meir Statman named this the disposition effect. Later, Terrance Odean studied thousands of real brokerage accounts in the Journal of Finance paper Are Investors Reluctant to Realize Their Losses? and found that investors sold winning stocks much more readily than losing ones.
The reason is emotional, not financial. As long as you keep the fund, the loss feels temporary. Once you sell, it feels final, and it feels like proof that you chose badly. Interestingly, Odean found one month when the pattern weakened: December, when the tax deadline gives people a reason to sell.
Harvesting is a way to use that reason on purpose. The loss already happened; selling only decides whether the IRS knows about it.
When harvesting does not help
Tax-loss harvesting is useful, but it is not free money. In several situations, it adds little or even works against you:
- Your gains are taxed at 0%. If your taxable income is below the 0% threshold in the table above, your long-term gains already cost nothing, so cancelling them saves nothing.
- The amount is small. If the loss is a few hundred dollars, the tax saving may be smaller than the hassle, the spread on the trade or the risk of a wash-sale mistake.
- You are only delaying the tax. When you buy a replacement, it starts at today’s lower price. So if it recovers and you sell it later, the gain will be larger. In many cases, harvesting postpones tax rather than erasing it, although the delay itself can be worth something.
- The account is tax-advantaged. As explained above, losses inside a 401(k) or an IRA have no effect on your return.
Your year-end checklist
If harvesting makes sense for you, work through these steps in early December rather than on December 30:
- Download your realized gains and losses. Most brokers show them in a “gains and losses” or “tax center” page.
- List the investments below their purchase price. Note whether each one is short-term or long-term.
- Check the last 30 days. Look for any purchase of the same fund in any account, including automatic investments and reinvested dividends.
- Turn off dividend reinvestment for the funds you plan to sell.
- Choose the replacement, or put a calendar reminder 31 days ahead if you plan to buy the original back.
- Place the sale by December 31. The trade date decides the tax year, so a sale on December 31 counts for this year even if it settles in January.
- Keep your records. Your broker reports the sale on Form 1099-B, but it may not catch a wash sale caused by a purchase at another firm or by your spouse.
Common questions
Does tax-loss harvesting work in a 401(k) or an IRA?
No. Gains and losses inside those accounts are not reported each year, so selling at a loss there has no effect on your taxes. Harvesting only applies to taxable brokerage accounts.
Can I harvest losses on cryptocurrency?
Yes, crypto losses can offset gains. However, the treatment of crypto under the wash-sale rule has been the subject of several bills in Congress. Because the rules may change, check the current IRS guidance before you sell and buy back the same coin.
What if my losses are bigger than $3,000?
You use up to $3,000 against regular income this year, and the rest carries forward. In each future year, the carried loss first cancels new gains and then up to $3,000 of income again, until it is fully used.
Do I need a tax professional?
Not for a simple case like Marcus’s. Still, if you have large amounts, several brokers or stock options from an employer, a tax professional can help you avoid wash sales and plan the timing.
ABOUT THE AUTHOR
Lorena founded Money Behaves. She is an economist and a psychology student who focuses on how people make money decisions: how they judge risk, react to percentages and read costs, and what happens when financial information gets complicated. She is not a licensed financial advisor, so every lesson relies on official U.S. sources and published research. See how we write and check our lessons.
INVESTING · LEVEL 3 HAS STARTED