Nobody likes seeing an investment fall in value. But a loss in a regular taxable brokerage account can still do some good. Tax loss harvesting means selling an investment at a loss on purpose so the loss can cancel out capital gains, and in some cases trim a bit of your ordinary income too. This guide covers how the rules work, the wash-sale trap that trips people up, and a few worked examples with real dollar figures.
What tax loss harvesting is
When you sell an investment for less than you paid, you have a capital loss. When you sell for more, you have a capital gain. The IRS lets you use your capital losses to offset your capital gains, so you pay tax only on the net amount. IRS Topic 409 explains the basics, and IRS Publication 550 has the full details.
Harvesting is simply being deliberate about it. Near the end of the year (or any time the market drops), you look for holdings that are worth less than you paid, sell them to lock in the loss, and usually reinvest the money in something similar so you stay invested.
Short-term vs. long-term: how losses get netted
Every gain or loss is either short-term or long-term. Per IRS Topic 409, if you held the investment more than one year, it’s long-term. If you held it one year or less, it’s short-term. This matters because net short-term gains are taxed at your ordinary income rates, while net long-term gains usually get lower rates.
The netting works in this order:
- Add up short-term gains and short-term losses to get a net short-term result.
- Add up long-term gains and long-term losses to get a net long-term result.
- If one is a gain and the other is a loss, combine them.
- Whatever is left is your net capital gain or net capital loss for the year.
Example: netting in action
Say you have $4,000 of short-term gains and $1,500 of short-term losses. That’s a net short-term gain of $2,500. You also have $3,000 of long-term gains and $7,000 of long-term losses, a net long-term loss of $4,000. Combine the two and you end up with a net capital loss of $1,500. That whole $1,500 can come off your ordinary income, and the $2,500 short-term gain, which would have been taxed at your regular rate, is fully wiped out.
The $3,000 limit on offsetting ordinary income
If your losses are bigger than your gains, you can use the extra loss against other income like wages, but only up to a limit. According to IRS Topic 409, the amount you can deduct is the lesser of $3,000 ($1,500 if married filing separately) or your total net loss shown on line 16 of Schedule D.
Carrying unused losses forward
Losses above the yearly limit aren’t lost. IRS Publication 550 says you can carry the unused part to the next year and treat it as if you had it in that year, and keep carrying it over until it’s used up. A carried-over loss keeps its character, so a long-term loss stays long-term and a short-term loss stays short-term. When you figure the carryover, short-term losses are used first against the $3,000 limit.
Example: a big loss year
Say you sold some stock you’d held for six months at a $10,000 loss, and you also had a $6,000 long-term gain from a fund you’d held for years. The $10,000 short-term loss wipes out the $6,000 gain, leaving a $4,000 net loss. You deduct $3,000 against your ordinary income this year and carry the remaining $1,000 forward as a short-term loss for next year.
If you were married filing separately with a $5,000 net loss, you’d deduct $1,500 this year and carry $3,500 forward.
Want to see what your gains would cost before and after harvesting? Try our capital gains tax calculator.

The wash-sale rule
This is the rule that catches people. Per IRS Publication 550, you can’t deduct a loss from selling stock or securities if, within 30 days before or after the sale, you:
- Buy substantially identical stock or securities,
- Acquire them in a fully taxable trade,
- Acquire a contract or option to buy them, or
- Acquire substantially identical stock for your IRA or Roth IRA.
That’s a 61-day window in total: the day of the sale plus 30 days on each side. The rule also applies if your spouse or a corporation you control buys substantially identical stock. The IRS addressed IRA purchases directly in Revenue Ruling 2008-5.
What happens to a disallowed loss
In most cases the loss isn’t gone for good. It gets added to the cost basis of the new shares, which postpones the deduction until you sell those shares. Your holding period for the new shares also includes the time you held the old ones.
The big exception is the IRA case. Pub 550 specifically leaves IRA and Roth IRA purchases out of the basis adjustment, so a loss disallowed because you bought the same stock in your IRA generally can’t be recovered later. That makes it the most costly wash-sale mistake.
Example: a wash sale
You bought 100 shares for $5,000 and sold them for $3,800, a $1,200 loss. Two weeks later you bought 100 shares of the same stock in your taxable account for $3,900. Because that’s within 30 days, you can’t deduct the $1,200 loss now. Instead, your basis in the new shares becomes $3,900 plus $1,200, or $5,100. You’ll get the benefit when you eventually sell.
To harvest a loss and stay invested, many people buy a fund or stock that isn’t substantially identical, or wait 31 days before buying back. Whether two investments are substantially identical depends on the facts, so if you’re unsure, check with a tax professional.
When tax loss harvesting doesn’t help
- Tax-advantaged accounts. IRS Publication 550 notes its rules don’t apply to investments held in IRAs, 401(k) plans and other qualified retirement plans. Gains and losses inside those accounts don’t show up on Schedule D, so there’s nothing to harvest.
- The 0% long-term rate. Some or all net capital gain may be taxed at 0% if your taxable income is low enough, as IRS Topic 409 explains. If your long-term gains would already be taxed at 0%, using losses against them saves little or nothing. The income cutoffs change every year, so check Topic 409 for the current figures.
- A lower basis means more tax later. If you rebuy something similar at a lower price, your future gain will be bigger. Harvesting often defers tax rather than erasing it.
- Costs and drift. Trading costs, or a replacement investment that doesn’t match your plan, can eat into the benefit.
How to report it
Sales go on Form 8949 and the totals carry to Schedule D. The Instructions for Schedule D include a capital loss carryover worksheet. Your broker’s Form 1099-B will usually flag wash sales it can see, but it won’t know about purchases in your spouse’s account or your IRA, so keep track yourself.
Quick checklist
- Only harvest in taxable brokerage accounts.
- Know whether each loss is short-term or long-term.
- Don’t buy the same or substantially identical investment within 30 days before or after the sale, in any account, including your spouse’s and your IRA.
- Remember the $3,000 yearly limit ($1,500 married filing separately) and carry the rest forward.
- Check whether your gains would already be taxed at 0%.
For more tax guides and tools, visit our Taxes hub, and see our Investing hub and basics of stock market investing in the USA. If you are choosing a replacement fund, our guide to index funds vs. ETFs can help. You can also estimate your overall bill with the federal income tax calculator.
This article is general information, not tax, legal or investment advice. Tax rules and income thresholds change, so check current IRS guidance or talk with a qualified tax professional before you act.