Investment Taxes

Sold a stock for a profit? You can legally cut your tax bill by selling your losers too.

Here's the deal: when you sell an investment for more than you paid, the IRS taxes the profit. But if you also sell some investments for a loss in the same year, those losses cancel out the profits — so you only pay tax on what's left over. This is called tax-loss harvesting, and most people leave thousands of dollars on the table by not doing it.

Even better: if your losses are bigger than your gains, you can knock $3,000 off your regular income (your salary, your business income — whatever) and carry the rest forward to use in future years. Forever. The loss never expires.

The catch: there's a 30-day "wash-sale rule" you have to dodge (we'll explain), and there's a sweet-spot 0% tax bracket most people don't know exists (we'll show you). Plug in your numbers below to see exactly how much you'd save.

Try a sample:

Salary, business income — what you'd report before adding the gains below.

$
Realized investment activity this year

Profits from selling investments held > 1 year.

$

Profits from selling investments held ≤ 1 year.

$

Investments sold at a loss this year (combined ST + LT).

$

Investments currently down — what you could sell to lock in losses.

$
As-is (no harvest)
LTCG bracket15%
ST gains taxed (ordinary)$0
LT gains taxed$3,000
Tax on investment activity$3,000
Net tax cost$3,000
If you harvest the $15,000
ST gains taxed$0
LT gains taxed$750
Tax on investment activity$750
Net tax cost$750
Yes — sell those losing positions. You'd save $2,250 on this year's tax bill.
You'd lock in $15,000 of losses by selling. They cancel out an equal amount of your gains, dropping your investment tax from $3,000 to $750. Just remember the 30-day wash-sale rule when you re-buy.
Walkthrough

A concrete example, step by step

Meet Alex. He sold some Tesla stock this year for a $20,000 profit (held it more than a year, so it's "long-term"). He's in the 32% federal tax bracket. Meanwhile, his old GameStop shares are currently down $15,000 — he's never sold them. Here's what happens with and without harvesting.

Without harvesting (the default)
  1. Alex sells his Tesla position. Profit: $20,000.
  2. He leaves the GameStop position alone (it's still in his account, just down).
  3. At tax time, he owes 15% long-term capital gains tax on the full $20,000 profit.
  4. Tax bill: $3,000. He hands it to the IRS in April.
With harvesting (the smart way)
  1. Alex sells his Tesla position. Profit: $20,000.
  2. Alex also sells the GameStop position. Loss: $15,000.
  3. The $15,000 loss cancels $15,000 of the gain. Now only $5,000 is taxable.
  4. He immediately buys a similar (but not identical) stock — say, Roblox — to keep his money invested.
  5. Tax bill: $750 (15% × $5,000). He saved $2,250.

The key insight: Alex still has the same amount of money invested in the market either way. He just swapped a losing stock for a similar one — the IRS calls that "harvesting the loss." Same risk profile, same exposure, same long-term plan.

The only thing that changed: he booked a paper loss for tax purposes. $2,250 less in taxes this year, and if his losses had been bigger than his gains, he could've used $3,000 of leftover loss against his salary too.

Don't accidentally trigger a wash sale

If you sell an investment at a loss and buy a "substantially identical" one within 30 days before or after the sale, the IRS disallows your loss for that year. The rule applies to your own accounts, your spouse's, and any IRA / 401(k) you control.

How to avoid:

  • Wait 31 days before re-buying the exact same fund / stock.
  • Or swap into a similar-but-not-identical fund (sell VTI → buy ITOT; sell SPY → buy VOO; sell QQQ → buy QQQM).
  • Watch your dividend reinvestment settings — if a position pays a dividend during the wash window and your account auto-reinvests, you can trigger a partial wash on yourself.
  • Most robo-advisors handle this automatically.
Questions

Frequently asked questions

What is tax-loss harvesting?
Imagine you bought 100 shares of Apple stock 3 years ago. Today, half of them are up $10,000 (winners) and half are down $5,000 (losers). If you sell ONLY the winners, you owe tax on the $10,000 profit. But if you sell BOTH the winners and the losers in the same year, the loss cancels out part of the gain — so you only owe tax on $5,000 ($10,000 gain minus $5,000 loss). That's tax-loss harvesting: deliberately selling losing investments to cancel out the tax on your winners. Bonus: if your losses are bigger than your gains, you can knock $3,000 off your regular income tax (salary, business income), and the leftover loss saves you tax in future years too.
Walk me through it with real numbers — what does this look like?
Meet Alex. He sold $20,000 worth of Tesla stock this year for a $20,000 profit. He's in the 32% federal tax bracket, so he owes $3,000 in long-term capital gains tax (15% × $20,000). Meanwhile, his old GameStop position is currently down $15,000 — he never sold it. WITHOUT HARVESTING: he pays the $3,000 tax. WITH HARVESTING: he sells the GameStop position too, locking in the $15,000 loss. That loss cancels $15,000 of his $20,000 gain. Now he only owes tax on $5,000 of gain = $750. He saves $2,250. He can immediately buy a similar but not-identical stock (say, Roblox instead of GameStop) to keep his money invested. Same dollars at risk in the market. $2,250 less in taxes.
Wait — there's a 0% tax rate on investments? Tell me more.
Yes, and most people don't know this exists. If your taxable income for the year is under about $48,000 (single) or $97,000 (married), you pay ZERO federal tax on long-term capital gains. Not 5%, not 1% — actual zero. This is huge in years when your income is temporarily low: sabbatical, parental leave, between jobs, gap year, early retirement. Example: a couple takes a year off to travel. Their income drops to $50,000. They sell $40,000 of appreciated stock — and owe $0 federal tax on the gain. They can immediately re-buy the same stock to lock in the new (higher) cost basis for the future. Free reset. The opposite of tax-loss harvesting — sometimes called 'tax-gain harvesting.'
What's this 'wash-sale rule' and will it bite me?
It's the one big trap with tax-loss harvesting. If you sell an investment at a loss AND buy back the same (or 'substantially identical') investment within 30 days — either before OR after the sale — the IRS disallows your loss for the year. So if you sell $10,000 of Apple stock at a loss on January 1 and buy it back on January 25, your loss doesn't count. THE FIX: wait 31 days, OR buy a similar-but-not-identical investment (sell VTI total-market ETF → buy ITOT total-market ETF). Both ETFs track essentially the same thing, but the IRS treats them as different. WATCH OUT: the rule also applies to your spouse's account and any IRA / 401(k) you control. So if your spouse's IRA auto-buys the same stock during your 30-day window, your loss is wasted. This is why robo-advisors handle this for you — they swap into similar ETFs automatically.
Why does it matter how long I held the stock?
Because the IRS taxes investments very differently based on how long you held them. Held it MORE than 1 year before selling = 'long-term' = favorable rates of 0% / 15% / 20%. Held it 1 year or LESS = 'short-term' = taxed like your salary at 10-37%. So a $10,000 short-term gain for someone in the 32% federal bracket costs $3,200 in tax. The same $10,000 as a long-term gain costs $1,500. That's a $1,700 difference for waiting just one extra day past the 1-year mark. The takeaway: if you bought a stock 11 months ago and it's up, wait one more month before selling.
What's NIIT and do I need to worry about it?
NIIT stands for 'Net Investment Income Tax' — basically an extra 3.8% federal tax slapped onto your investment profits if you make a lot of money. The threshold: total income above $200,000 (single) or $250,000 (married). If you're under those numbers, ignore NIIT entirely — it doesn't apply to you. If you're over: every dollar of investment profit (capital gains, dividends, interest, rental income) gets an extra 3.8% federal tax on top of the regular capital gains rate. So a high earner in the 20% long-term bracket effectively pays 23.8% on stock gains. Tax-loss harvesting reduces this too — fewer gains realized = less NIIT.
Should I harvest losses every year, even if I don't have gains?
Yes, almost always. Even if you have zero gains this year, harvesting a loss gives you a $3,000 deduction against your regular income — saving roughly $720-$1,110 in tax for most middle-class earners. Anything left over (above $3,000) carries forward to NEXT year, and the year after, and forever. So a $30,000 loss this year keeps saving you tax for ~10 years. Think of harvested losses as a 'tax shield' you build up — when you eventually sell appreciated stock or get a big windfall, the carryforward losses cancel out the gains. ONE EXCEPTION: if you're in the 0% capital gains bracket (low-income year), don't harvest long-term losses. They'd be canceling out tax that's already zero — wasted. Save them for a higher-income year.
Do robo-advisors do this for me automatically?
Yes — Wealthfront, Betterment, and most major robo-advisors do tax-loss harvesting automatically at no extra cost. They scan your account every day looking for positions that are down, sell them, immediately swap into a similar ETF (avoiding the wash-sale rule), and book the loss for tax purposes. For taxable accounts above $50,000-$100,000, the tax savings often pay for the entire management fee (0.25%/yr) and then some. If you have a Schwab / Fidelity / Vanguard taxable brokerage account that's NOT auto-managed, you'd need to do this manually — usually once at year-end.
Do I need a CPA to do this, or can I DIY?
DIY is fine for most people. Modern brokerages (Fidelity, Schwab, Vanguard, Robinhood) report all your gains and losses on a 1099-B form at year-end. Tax software (TurboTax, FreeTaxUSA, H&R Block) imports this directly. The only thing you have to actively do is decide WHICH losing positions to sell and WHEN — and that's what this calculator helps with. The wash-sale rule is the one trap to be careful about — keep notes on what you sold and when, and don't auto-rebuy in any of your accounts within 30 days.

See your full tax picture

Capital gains optimization is one tax lever. The full optimizer factors retirement contributions, deductions, entity choice, and more in one place.

Open the full calculator
Security & trust

Your numbers stay yours

Follows IRS tax code
Every formula follows current tax code
Bank-level encryption
Data encrypted in transit and at rest
Never sold
We don't sell or share your data
Transparent formulas
See exactly how every number is built
Free 2-minute calculator

Start your free tax plan in 2 minutes

In 2 minutes, see exactly what you owe — and exactly how to owe less.

Free · no credit card · no signup required
2026 tax-saving moves are available now — the earlier you plan, the more you save.