A red number in your brokerage account doesn’t feel like good news. But before December 31, a losing position can actually do some work for you. Selling it on purpose, so the loss offsets gains you already took this year, is what people call tax-loss harvesting.
This guide walks through it the way you’d do it at the kitchen table: one step at a time, with a running number table. We’ll use a single example the whole way, an $11,000 paper loss next to a $6,000 gain, so you can swap in your own figures. The rules come from IRS Topic No. 409 and Publication 550, checked November 3, 2026. It’s general information, not tax advice.

The rules in one short paragraph
Capital losses first cancel out capital gains. If losses are bigger than gains, you can use the extra loss to lower your other income, but only up to $3,000 a year ($1,500 if you’re married filing separately). Whatever is left over carries forward to later years. And if you buy the same or a “substantially identical” investment within 30 days before or after the sale, the wash-sale rule pushes the loss into the future instead.
Meet the example investor
Dana is a single filer. Earlier this year she sold Fund A, which she’d held for several years, for a $6,000 long-term gain. She also owns Stock B, bought for $25,000 and now worth $14,000. That’s an $11,000 unrealized loss. She plans to stay invested in the market either way.
To keep the tax math simple, we’ll assume her long-term gains are taxed at 15% and her ordinary income at a 24% marginal rate. Your rates may differ; our capital gains tax guide explains how the 0%, 15% and 20% long-term rates work.
Step-by-step: running the numbers
Step 1: List the gains you’ve already realized
Pull your realized gains from your broker’s year-to-date tax page. Keep short-term (held one year or less) and long-term (held more than one year) apart, because short-term gains are taxed like ordinary income. Dana has $6,000, all long-term.
Step 2: Find positions with a loss you’d be okay selling
Look for holdings where today’s value sits below what you paid. Dana’s Stock B shows an $11,000 loss. If it’s held more than a year, the loss is long-term too.
Step 3: Net the loss against the gain
$6,000 gain minus $11,000 loss leaves a $5,000 net capital loss. The $6,000 gain is now fully cancelled, so there’s no capital gains tax on it this year.
Step 4: Apply the $3,000 limit
Of the $5,000 net loss, Dana can use $3,000 against her wages and other income. That’s the lesser of $3,000 or her total net loss, as Topic 409 puts it. The loss goes on Schedule D and then onto her Form 1040.
Step 5: Carry the rest forward
The remaining $2,000 rolls into 2027. It can offset gains next year, or another slice of ordinary income if she has no gains. The IRS Capital Loss Carryover Worksheet in Publication 550 tracks it.
| Step | What happens | Running total |
|---|---|---|
| 1 | Realized long-term gain (Fund A) | +$6,000 |
| 2 | Sell Stock B at a loss | −$11,000 |
| 3 | Net capital result | −$5,000 |
| 4 | Deduct against ordinary income (cap) | −$3,000 used |
| 5 | Carryover to 2027 | −$2,000 left |

What it’s worth in dollars
Here’s the estimated tax effect under our assumed rates. It’s a rough guide, not a promise, since your brackets, state tax and other income all change the picture.
| Piece | Amount | Assumed rate | Estimated tax saved |
|---|---|---|---|
| Long-term gain cancelled | $6,000 | 15% | $900 |
| Ordinary income offset | $3,000 | 24% | $720 |
| This year’s total | about $1,620 | ||
| Carryover for 2027 | $2,000 | depends on next year | later |
If your income is high enough for the 3.8% Net Investment Income Tax, cancelling gains can trim that too. Our NIIT worked examples show where the thresholds start.
The wash-sale rule: where most harvests go wrong
Dana wants to stay in the market, so the natural move is to buy something right back. Publication 550 says a wash sale happens when you sell at a loss and, within 30 days before or after, you buy substantially identical stock or securities, get an option to buy them, or buy them in your IRA or Roth IRA. A purchase by your spouse counts too.
The loss isn’t gone forever in most cases. It’s added to the cost of the new shares, so you get it back when you eventually sell those. The IRS example: buy 100 shares for $1,000, sell for $750, and rebuy within 30 days for $800. The $250 loss is disallowed now, and the new basis becomes $1,050.
The IRA case is different. Publication 550 excludes it from that basis adjustment, so a repurchase inside an IRA can wipe out the benefit. If you’re also funding retirement accounts this year, our 401(k) vs IRA guide covers the order to fill them; just keep an eye on what those accounts buy around your sale date. For the bigger picture on where to park that money, see our guide to 401(k) and IRA contribution limits for 2026-2027.

A quick checklist before you sell
- Check that the position is in a regular taxable account. Losses inside an IRA or 401(k) don’t count.
- Look back 30 days. Did you, your spouse or an automatic dividend reinvestment buy the same holding?
- Decide what you’ll hold for the next 31 days. Something that isn’t substantially identical keeps you invested without tripping the rule.
- Sell before year-end, and confirm the trade shows on your broker’s realized gain/loss report.
- Save the confirmation. You’ll report the sale on Form 8949 and Schedule D.
Frequently asked questions
Does the $3,000 limit cap how much gain I can offset?
No. Losses first cancel gains without a cap. The $3,000 limit ($1,500 if married filing separately) applies only to the net loss left over that you use against other income, per IRS Topic 409.
Can I harvest losses in an IRA or 401(k)?
No. Publication 550 says its rules don’t apply to investments in IRAs, 401(k)s and other qualified plans, so there’s no deductible loss to harvest there.
How long can I carry a capital loss forward?
Topic 409 says you can carry the excess loss forward to later years. Use the Capital Loss Carryover Worksheet in Publication 550 or the Schedule D instructions to track it.
Does the wash-sale rule apply if I buy before I sell?
Yes. The window is 30 days before or after the sale, so buying extra shares in the month before a loss sale can also trigger it.
Sources: IRS Topic No. 409, Capital Gains and Losses; IRS Publication 550, Investment Income and Expenses. Example figures are illustrative. This article is for general education and is not tax advice.




























