Tax-loss harvesting means selling an investment in a taxable account for less than you paid, so the realized loss can offset capital gains and up to $3,000 of ordinary income a year. Unused losses carry forward. The strategy defers tax rather than erasing it, and the wash sale rule limits how quickly you can buy back.
It is late in the year, and your brokerage statement shows a mix: a fund you sold earlier at a nice gain, and a couple of positions sitting well below what you paid. You have heard that those losers can "save you taxes" and wonder whether that is real, how much it is worth, and what can go wrong.
How does tax-loss harvesting work?
You sell a position at a loss, and the IRS lets you use that realized loss against your realized gains for the year. A paper loss does nothing for your taxes. Only a sale (or other disposition) turns it into a realized capital loss you can report.
The process has three parts:
- Find positions below your cost basis in a taxable brokerage account.
- Sell them to realize the loss.
- Decide what to do with the cash: hold it, buy something different, or buy back the same investment after the wash sale window closes.
Losses first offset gains of the same type (short-term against short-term, long-term against long-term), then the net amounts offset each other. Because short-term gains are taxed at ordinary income rates, losses that end up offsetting short-term gains are usually worth more. Our guide to short-term vs long-term capital gains tax rates explains how the two buckets are taxed.
What are the tax-loss harvesting rules?
The core rules are the wash sale window, the netting order, the $3,000 ordinary-income cap, the carryforward, and the requirement that the loss happen in a taxable account. This table summarizes them; each is covered in more detail below.
| Rule | What it says |
|---|---|
| Realized losses only | A paper loss counts only after you sell or otherwise dispose of the investment. |
| Wash sale window | Buying substantially identical securities within 30 days before or after the sale disallows the loss (61 days in total). |
| Netting order | Short-term losses offset short-term gains and long-term losses offset long-term gains first; then the net results offset each other. |
| Ordinary income cap | Net capital losses can offset up to $3,000 of other income a year ($1,500 if married filing separately). |
| Carryforward | Unused net losses carry forward to later years and keep their short-term or long-term character. |
| Taxable accounts only | Losses inside IRAs, 401(k)s and other tax-advantaged accounts cannot be deducted. |
| Calendar year | The sale must happen by the last trading day of the year to count for that tax year. |
The $3,000 limit and the carryforward come from IRS Topic 409; the wash sale rule is in IRS Publication 550.
Is there a limit on tax-loss harvesting?
There is no cap on how much harvested loss can offset capital gains: a $50,000 loss can wipe out $50,000 of gains in the same year. The limit applies only to the excess. If your losses exceed your gains, you can deduct up to $3,000 of the excess against other income each year, or $1,500 if married filing separately. According to IRS Topic 409 on capital gains and losses, any net capital loss above that limit carries forward to later years, where it keeps the same short-term or long-term character.
There is no time limit on the carryforward for an individual, so a large loss can keep offsetting future gains and $3,000 of income a year until it is used up.
Tax-loss harvesting in stocks: a worked example
This is a simple illustration with round hypothetical numbers, not a recommendation. Say you realized a $2,000 long-term gain earlier this year by selling one stock. You also hold shares of another stock bought for $20,000 more than a year ago that are now worth $12,000, an $8,000 long-term loss.
| Step | Amount |
|---|---|
| Realized gain this year | $2,000 |
| Harvested loss | ($8,000) |
| Net capital loss | ($6,000) |
| Deducted against ordinary income this year | ($3,000) |
| Carried forward to next year | ($3,000) |
Without the sale, you would owe tax on the $2,000 gain. With it, the gain disappears, $3,000 of salary or other income is offset, and $3,000 is saved for future years.
What is the wash sale rule and how does it affect harvesting?
The wash sale rule disallows the loss if you buy substantially identical stock or securities within 30 days before or after the sale. IRS Publication 550 also counts purchases by your spouse, a corporation you control, and purchases inside your own IRA or Roth IRA.
A disallowed loss is not always gone. In most cases it is added to the cost basis of the replacement shares, which postpones the deduction. The exception is a repurchase inside an IRA, where the basis adjustment does not apply and the loss is effectively lost. Our full guide to the wash sale rule covers what "substantially identical" means and how brokers report it.
Investors who want to stay invested during the 30 days often buy something similar but not identical, for example a fund that tracks a different index in the same asset class. Whether two funds are substantially identical is a facts-and-circumstances question, so a tax professional is the right person to confirm a specific swap.
Does tax-loss harvesting work in an IRA or 401(k)?
No. Investments inside a traditional IRA, Roth IRA, 401(k) or similar account grow tax-deferred or tax-free, so gains and losses inside them are not reported on your tax return and there is nothing to deduct. Harvesting only works in a taxable brokerage account.
Tax-advantaged accounts still matter for harvesting in one way: buying the same security in your IRA within 30 days of selling it at a loss in a taxable account can trigger a wash sale, and in that case the loss is generally lost rather than deferred. If you hold the same funds in both kinds of account, check your IRA's scheduled purchases and dividend reinvestments before you harvest. Our guides to asset allocation and concentration risk help when deciding what to buy with the proceeds.
When does tax-loss harvesting make sense?
It tends to help most when you have realized gains to offset and expect to stay in a similar or lower tax bracket later. It helps least when the account is tax-advantaged or when the trade changes your portfolio in ways you did not intend.
Good fits
- You have realized short-term gains taxed at ordinary rates.
- A position no longer fits your plan and you would sell it anyway.
- You are rebalancing and can sell the lots with losses first.
Weak fits
- The loss is inside an IRA or 401(k). Losses in tax-advantaged accounts are not deductible.
- You are in the 0% long-term capital gains bracket. Offsetting gains that would not be taxed adds little.
- Transaction costs or bid-ask spreads would eat most of the benefit on a small loss.
What are the risks and drawbacks?
The main cost is that harvesting lowers your cost basis, so you may pay more tax later when you sell the replacement. It is a deferral, not a free reduction, unless the shares are eventually held until death or donated.
Other drawbacks to weigh:
- Tracking risk: a replacement fund may perform differently from the one you sold during the waiting period.
- Wash sale mistakes: automatic dividend reinvestment or a purchase in a spouse's account can trigger the rule without you noticing.
- Behavioral drift: selling losers is easy to justify, but repeatedly harvesting can turn a long-term plan into frequent trading. Our piece on behavioral mistakes investors make explains why that usually hurts.
- Record-keeping: you need accurate cost basis by tax lot, which your broker reports on Form 1099-B for covered securities.
Tax-loss harvesting does not guarantee a tax saving. The result depends on your gains, bracket, state taxes and future sales, so check your own situation with a tax professional before acting.
Frequently asked questions
Is tax harvesting the same as tax-loss harvesting?
Usually, yes. "Tax harvesting" is often shorthand for tax-loss harvesting. Some investors also use "tax-gain harvesting" for the opposite move: realizing gains on purpose in a year when they fall in the 0% long-term capital gains bracket.
What is the deadline for tax-loss harvesting?
The sale has to happen by the last trading day of the calendar year to count for that tax year. Settlement timing rarely matters for losses, but check your broker's year-end cutoff.
Does tax-loss harvesting reduce taxes permanently?
Usually it defers them. Your replacement investment has a lower cost basis, so a later sale produces a larger gain. The benefit comes from the time value of paying later and from offsetting gains taxed at higher rates.
Do unused capital losses expire?
For individuals, IRS Topic 409 says losses above the annual limit carry forward to later years. They keep their short-term or long-term character until they are used.
Related: What is a wash sale? · Short-term vs long-term capital gains tax rates · What is a brokerage account? · What is concentration risk? · How do you work with a CPA on investment taxes?
Put real numbers behind this guide with our free Federal income tax calculator, days between dates calculator and retirement savings calculator, and see how it works for you.
