Free to Use

🌾 Capital Gains Harvesting Calculator

Long-term capital gains are taxed at 0% for single filers up to about $49,450 of taxable income and married filers up to about $98,900 in 2026. Gain harvesting deliberately realizes gains to fill that free bracket. Losers can be paired with loss harvesting — and losses also offset ordinary income up to $3,000 per year. Enter your numbers to see exactly how much gain you can take at 0%.

After the standard or itemized deduction. Use line 15 of last year's Form 1040 if unsure.
Gains from assets held more than one year that you have already sold this year.
Appreciation sitting in positions you could sell and immediately repurchase (no wash sale rule on gains).
Realized losses on positions you have sold. Losses offset gains dollar for dollar, with no annual cap.
Most states tax capital gains as ordinary income. Nine states have no income tax at all.

📋 Worked Examples

Example 1 — Retiree with a huge free bracket

Scenario: A single retiree has $30,000 of taxable income from a pension and $120,000 of unrealized gains in a broad index fund held for 10 years. Standard deduction already applied.

0% ceiling: About $49,450 for single filers in 2026.

Room at 0%: $49,450 − $30,000 ordinary income = $19,450 of gains taxed at 0%.

Action: Sell $19,450 of the index fund, pay $0 federal tax, and immediately repurchase the same fund at the higher basis — the gain is erased permanently. Repeat every year to ratchet your basis up.

Takeaway: This is the single most valuable tax strategy available to retirees living on modest taxable income, and it is entirely legal. There is no wash sale rule for gains.

Example 2 — Gain harvesting plus loss harvesting in one year

Scenario: A married couple has $70,000 ordinary income, $25,000 of realized long-term gains from selling a stock, and $15,000 of losses from a position that went bad.

Net gain: $25,000 − $15,000 = $10,000.

Married 0% ceiling: About $98,900. With $70,000 of ordinary income, they still have $28,900 of room.

Result: The entire $10,000 net gain falls inside the 0% bracket → $0 federal tax. The losses absorbed gains that would have been free anyway — worth noting the $15,000 of losses could have been saved.

Takeaway: Do not waste loss harvesting absorbing gains that would be taxed at 0% anyway. Save losses for years when you have gains taxed at 15% or 20%, or use them against ordinary income up to $3,000.

Example 3 — High earner whose harvesting triggers NIIT

Scenario: A married couple with $280,000 of ordinary income harvests $40,000 of long-term gains.

0% room: Their ordinary income already exceeds the $98,900 ceiling → no 0% room at all.

Federal rate: Above the 15% threshold, still in the 15% band (the 20% rate starts around $600,050 for married couples in 2026). Tax = $6,000.

NIIT: Their income exceeds the $250,000 MAGI threshold for the 3.8% Net Investment Income Tax, so an additional $1,520 applies.

Takeaway: Above roughly $250,000 of MAGI, every realized gain also faces the 3.8% NIIT. For high earners, gain harvesting is rarely advantageous — the goal becomes deferring gains, not realizing them, because a step-up in basis at death erases them entirely.

📖 The 0% Bracket, Wash Sales & When Harvesting Backfires

Room at 0% = 0% Bracket Ceiling − (Ordinary Taxable Income + Already-Realized Gains)
Net Gain = Realized Gains − Capital Losses. Only gains stacking ABOVE ordinary income land in the 0% band

How long-term gains stack on top of ordinary income

This is the mechanic most people get wrong. Long-term capital gains are not taxed in a separate world — they stack on top of your ordinary taxable income. Your ordinary income fills the brackets first, and gains are then placed on top:

  • Gains that fall below the 0% ceiling are taxed at 0%
  • Gains between the 0% ceiling and the 15% ceiling are taxed at 15%
  • Gains above that are taxed at 20%
  • Any gain pushing your MAGI over $250,000 (married) or $200,000 (single) also faces the 3.8% NIIT

So the free space is not the full 0% bracket — it is the bracket minus your ordinary income. A single filer with $45,000 of ordinary income has almost no 0% room. A retiree with $20,000 of income has nearly the whole bracket available.

2026 long-term capital gains brackets

RateSingleMarried filing jointlyHead of household
0%Up to ~$49,450Up to ~$98,900Up to ~$66,200
15%~$49,450–$545,500~$98,900–$613,700~$66,200–$579,600
20%Above ~$545,500Above ~$613,700Above ~$579,600
+3.8% NIITMAGI above $200,000MAGI above $250,000MAGI above $200,000

These thresholds are indexed annually for inflation, so confirm the current year's figures before filing. Note that short-term gains — assets held one year or less — get no 0% bracket at all; they are taxed entirely at ordinary income rates. Holding period is everything.

Gain harvesting vs loss harvesting

FeatureGain harvestingLoss harvesting
What you doSell winners and rebuy immediatelySell losers and rebuy after 31 days
Wash sale ruleDoes NOT apply — no restriction on rebuyingApplies — 30 days before and after, including in IRAs
Best suited toLow-income years, retirees before RMDs, gap yearsHigh-income years with realized gains, rebalancing
Ordinary income offsetN/AUp to $3,000/year, unlimited carryforward
Main riskTrimming the 0% bracket can pull other income into taxable rangeWash sale disallowance; permanently lowers basis

Why the wash sale rule does not apply to gains — but does to IRAs

The wash sale rule (IRC §1091) disallows a loss if you buy a substantially identical security within 30 days before or after the sale. It applies only to losses. There is no rule preventing you from selling a gain and immediately repurchasing the same fund — which is exactly why gain harvesting works so well. You ratchet your basis up at no tax cost.

One trap with losses: wash sales are triggered by purchases in any account, including your IRA or your spouse's IRA. Buying the same fund in a retirement account within the window disallows the loss permanently, and the disallowed amount does not even add to your IRA basis. Coordinate across every account in the household.

Hidden costs of gain harvesting: the second-order effects

The tax on gains is only part of the equation. Realized gains increase your Adjusted Gross Income, which can affect:

  • ACA premium tax credits. A dollar of harvested gain can reduce subsidies much more than the tax it saves — the effective marginal rate can exceed 100% at the subsidy cliff.
  • Roth IRA contribution eligibility. Gains count toward MAGI for the income limits.
  • College financial aid. Realized gains raise the prior-prior year income reported on the FAFSA, potentially reducing aid for two academic years.
  • Social Security taxation. Higher provisional income can make up to 85% of benefits taxable.
  • Medicare IRMAA. A large harvested gain can push you into a higher Part B and Part D premium bracket two years later.
  • State taxes. Wash sales are federally defined, but states vary in whether they conform. State tax on gains often exceeds the federal 0% benefit.

For a retiree in a no-income-tax state with modest income, harvesting is nearly pure upside. For someone on ACA subsidies or approaching an IRMAA threshold, harvesting gains can easily cost more than it saves. Model both sides.

Who should harvest gains

Gain harvesting pays best for: retirees in the gap years between retirement and Social Security or RMDs, people with a low-income year from a sabbatical or layoff, young investors in low brackets, and anyone planning to hold appreciated assets for decades. It pays worst for: high earners above the NIIT thresholds, anyone receiving ACA subsidies, and taxpayers in high-tax states with large existing unrealized gains.

Also weigh the alternative: holding until death gives your heirs a step-up in basis, erasing the gain entirely. Harvesting now is a bet that paying 0% now beats paying 0% later — a wash on taxes, but useful if you want to free up cash, rebalance a concentrated position, or reduce future risk without a tax bill.

❓ Frequently Asked Questions

What is capital gains harvesting and how does it work?
Capital gains harvesting is deliberately selling an appreciated asset to realize a gain while your taxable income is low enough that the gain falls in the 0% long-term capital gains bracket — then immediately repurchasing the same asset. Because the wash sale rule applies only to losses, you can rebuy the identical security the same day. The effect is that your cost basis resets higher and the gain is erased permanently at no federal tax cost. Repeating this annually ratchets your basis up over time.
Why doesn't the wash sale rule apply to gains?
The wash sale rule under IRC §1091 is written specifically to disallow losses when you acquire a substantially identical security within 30 days before or after a sale. It has no application to gains — there is simply no statute preventing you from selling a winner and rebuying it immediately. This asymmetry is what makes gain harvesting possible, while loss harvesting requires you to wait more than 30 days before repurchasing to preserve the deduction.
How much long-term capital gain can I realize tax free in 2026?
It depends entirely on your ordinary taxable income, because gains stack on top of it. For single filers the 0% bracket runs to roughly $49,450 and for married couples filing jointly to roughly $98,900. If your ordinary taxable income is $30,000 as a single filer, you have about $19,450 of room for 0% gains. If your ordinary income already exceeds the ceiling, you have no 0% room at all and every gain is taxed at 15% or more.
Should I harvest gains in a year when I also have capital losses?
Usually not, and this is a common mistake. Losses offset gains dollar for dollar with no annual cap, but if the gains would have been taxed at 0% anyway, using losses against them wastes the loss entirely. Better to carry the losses forward to a year when you realize gains taxed at 15% or 20%, or use up to $3,000 per year against ordinary income, which is taxed at your marginal rate. Banks of unused losses never expire.
What is the Net Investment Income Tax and how does it affect harvesting?
The NIIT is an additional 3.8% tax on the lesser of your net investment income or the amount by which your MAGI exceeds $200,000 as a single filer or $250,000 as a married couple. Because realized capital gains are investment income and also increase MAGI, harvesting above those thresholds triggers the surtax on top of the 15% or 20% rate. For high earners this makes gain harvesting counterproductive — deferral and the step-up in basis at death become the better strategy.
Can harvesting gains hurt my health insurance subsidies or Medicare?
Yes, and this is the biggest hidden trap. Realized gains raise your Adjusted Gross Income, which can reduce ACA premium tax credits significantly — at certain income levels the effective marginal cost of a harvested gain can exceed 100%. For Medicare, a large realized gain can push you into a higher IRMAA bracket for Part B and Part D premiums, assessed on income from two years prior. It can also make more of your Social Security benefits taxable and affect Roth IRA eligibility and college financial aid.
Is capital gains harvesting still worth it if I plan to hold the asset until death?
It is roughly tax-neutral, so the decision turns on non-tax factors. Holding until death gives your heirs a step-up in basis that erases the gain entirely for them. Harvesting now pays 0% instead of 0% later, so the tax outcome is similar — but harvesting gives you a higher basis that lets you sell or rebalance later without a bill, reduces concentration risk, and can fund cash needs without triggering tax. If none of those matter to you, simply holding is fine.

⚠️ Important Disclaimer: This capital gains harvesting calculator provides planning estimates and is not tax advice. Capital gains brackets, standard deductions and phase-out thresholds are indexed for inflation and change annually — confirm the current year's figures against IRS Publication 550 and the Schedule D instructions before acting. State treatment of capital gains varies widely, with nine states imposing no income tax and others taxing gains at ordinary rates or with their own preferential rates. The second-order effects of raising your AGI — ACA premium tax credits, IRMAA Medicare surcharges, Social Security benefit taxation, Roth eligibility, college financial aid and the 3.8% Net Investment Income Tax — are not fully modeled here and can outweigh the tax saved. Consult a CPA or tax professional before executing a harvesting strategy.