DayCents

Investing

Tax-Gain Harvesting Calculator

The 0% long-term capital-gains bracket is one of the tax code's quiet gifts. In a low-income year — early retirement, a gap year, a sabbatical — you can realize gains that fall inside it, pay nothing, and immediately rebuy to reset your cost basis higher for free.

Tested against worked examplesHow we verify

After deductions — wages, interest, and other ordinary income, before capital gains.

2026 figure — about $49,450 single, $98,900 married filing jointly. Confirm the current amount.

Gains you can harvest tax-free: $9,450

Gains you can harvest tax-free

$9,450

This much fits in the 0% bracket; the rest would be taxed.

The gains stack on top of your ordinary income, so realizing them can push part above the threshold — only the portion that stays under the top of the 0% bracket is tax-free. Also check that realizing gains does not raise ACA subsidy or IRMAA thresholds, which key off total income.

Room in the 0% bracket
$9,450
Gains that would be taxed
$10,550
Tax saved versus selling later
$1,418

At the rate you would otherwise pay.

Your gains$20K
Harvested tax-free$9,45047%
Would be taxed$10,55053%

One email with a link back to these numbers. We'll also send our twice-monthly money guide — unsubscribe in one click.

Compare scenariosTry three values of one input
Tax-Gain Harvesting Calculator results for three values of Ordinary taxable income
Ordinary taxable income
Gains you can harvest tax-free$13,450$9,450$4,000$5,450$8,000
Room in the 0% bracket$13,450$9,450$4,000$5,450$8,000
Gains that would be taxed$6,550$10,550+$4,000$14,550+$8,000
Tax saved versus selling later$2,018$1,418$600$818$1,200

Every other input stays at the value you set above — currently $40,000 for ordinary taxable income. Differences are measured against the first column.

Saved scenariosSave this calculation

Saved in this browser only — no account, and nothing is sent to us. Clearing your browser data deletes them.

How this calculator works

The room in the 0% bracket is its top minus your ordinary taxable income. Long-term gains stack on top of that income, so the amount that fits inside the room is harvested tax-free and the rest is taxed. The saving is the tax-free amount times the rate you would otherwise pay when eventually selling.

The 0% bracket top is an input because it changes yearly and doubles for joint filers — enter the current figure. Ordinary taxable income should already be net of deductions. State capital-gains tax, and the secondary effects on ACA subsidies, Social Security taxation, and Medicare IRMAA, are not modelled and can matter more than the federal gain tax itself.

What this assumes

  • Realising gains deliberately in a low-income year to use the 0% long-term capital gains band.
  • There is no wash-sale rule on gains — you can repurchase immediately, which resets the basis higher.
  • Realised gains raise adjusted gross income and can affect credits, subsidies and the taxable share of Social Security.

What changes this number

Your income that year
The 0% band is the whole opportunity, and it exists only in low-income years.
Effect on other thresholds
A realised gain can cost more in lost subsidies than it saves in future tax.
Resetting basis
The point of the exercise: gains taken at 0% raise the basis permanently, reducing future tax.

A worked example

Take the $40k income, $20k gains scenario. These figures are produced by the calculator above, not written alongside it, so they always match what the tool returns.

What you enter

Ordinary taxable income
$40,000
Top of the 0% bracket
$49,450
Long-term gains available
$20,000

What it returns

Gains you can harvest tax-free
$9,450
Room in the 0% bracket
$9,450
Gains that would be taxed
$10,550
Tax saved versus selling later
$1,418

The gains stack on top of your ordinary income, so realizing them can push part above the threshold — only the portion that stays under the top of the 0% bracket is tax-free. Also check that realizing gains does not raise ACA subsidy or IRMAA thresholds, which key off total income.

Try an example

Frequently asked questions

What is tax-gain harvesting?

Deliberately selling appreciated investments held over a year while your income is low enough that the gains fall in the 0% long-term capital-gains bracket. You pay no tax, then rebuy immediately to reset your cost basis higher — so a future sale has a smaller taxable gain. It is the mirror image of loss harvesting.

Who is the 0% capital-gains bracket for?

Anyone with low taxable income in a given year: early retirees before pensions and Social Security start, people between jobs, students, or those taking a sabbatical. Long-term gains that keep total taxable income under the threshold are taxed at 0% federally — a genuine zero, not a deferral.

Is there a wash-sale problem like with losses?

No. The wash-sale rule only disallows losses, so you can sell for a gain and rebuy the same security immediately with no waiting period. That is what makes gain harvesting so clean — you never have to leave the market or change your holdings.

How do gains interact with my ordinary income?

Long-term gains stack on top of ordinary income when deciding which bracket they fall in. If your ordinary income is $40,000 and the 0% bracket tops out at $49,450, only about $9,450 of gains fit tax-free; gains beyond that are taxed at 15%. The room shrinks as your other income rises.

What should I watch out for?

Realizing gains raises your total income, which can reduce ACA health-insurance subsidies, increase the taxable portion of Social Security, or trigger Medicare IRMAA surcharges two years later. The federal tax on the gain may be zero while these secondary effects cost real money — check them before harvesting.

Disclaimer: DayCents provides this calculator for educational purposes only. Results are estimates based on your inputs and the stated assumptions — they are not financial advice, a quote, or an offer of credit. Consult a qualified financial professional before making major money decisions.