Skip to content
The Evergreen Edit
Save app to home screen
Financial Independence

Tax-Gain Harvesting: How to Use the 0% Capital Gains Rate to Reset Your Cost Basis, With Worked Examples

If your taxable income is low enough, long-term gains can be taxed at 0%. Here's how tax-gain harvesting works, how to measure your room under the threshold, and the side effects to check first, with worked examples.

By Kiara Miller, Founder & Editor

Published · Last reviewed: · 9 min read

An electronic stock ticker board in San Francisco showing share prices and gains for companies including Intel and Facebook
Photo: Francisco Gonzalez via Wikimedia Commons (CC BY 2.0)

In a low-income year, some investors can sell winning investments, owe no federal tax on the gain, and buy them right back at a higher cost basis. The math is simple once you know where the 0% line sits, but the side effects deserve a close look.

What is tax-gain harvesting?

Tax-gain harvesting means selling investments that have risen in value during a year when your taxable income is low enough for long-term gains to fall in the 0% federal capital gains bracket. You pay no federal tax on that gain, and if you buy back, your new cost basis is higher, shrinking future taxable gains.

It is the mirror image of tax-loss harvesting, where you sell losers to create deductible losses. Gain harvesting is popular with early retirees and people pursuing financial independence because their income often drops sharply after they stop working full time. A year or two of low income before Social Security and required withdrawals begin can open a window that may not come back.

The strategy only applies to investments held in a regular taxable brokerage account. Gains inside a 401(k), traditional IRA or Roth IRA are not taxed as capital gains when you sell inside the account, so there is nothing to harvest there.

How the 0% capital gains rate works

The IRS taxes long-term capital gains at 0%, 15% or 20%, depending on your taxable income. A gain is long-term if you held the asset for more than one year before selling, according to IRS Topic 409. Gains on assets held one year or less are short-term and are taxed like ordinary income, so they never qualify for the 0% rate.

The income lines move every year with inflation. For the 2026 tax year, the 0% rate applies while your total taxable income, including the gain, stays at or below these amounts, according to Kiplinger and Thomson Reuters Checkpoint:

  • Single and married filing separately: $49,450
  • Married filing jointly: $98,900
  • Head of household: $66,200

Above those lines, the 15% rate applies up to $545,500 for single filers and $613,700 for joint filers in 2026, and 20% applies above that. Because these numbers change each year, check the current figures on irs.gov or in your tax software before acting.

The most important detail is that this is based on taxable income, not salary. Taxable income is what remains after deductions. For 2026, the IRS standard deduction is $16,100 for single filers, $32,200 for married couples filing jointly and $24,150 for heads of household. That means a married couple could have up to $131,100 of total income ($98,900 plus the $32,200 deduction) in a year with only long-term gains and qualified dividends and still owe 0% federal tax on all of it, before any other deductions or credits.

There's one more rule that makes this work: gains stack on top of ordinary income. Your wages, pension, IRA withdrawals and interest fill the brackets first. Long-term gains sit on top. Whatever room is left below the 0% line can be filled with gains at a 0% rate.

Worked example 1: an early-retired couple fills the 0% bracket

Maria and James are married, retired at 52 and file jointly. In 2026, they expect $40,000 of ordinary income from part-time consulting and a small traditional IRA withdrawal. They take the $32,200 standard deduction.

Their taxable ordinary income is $40,000 minus $32,200, or $7,800. The 0% line for joint filers is $98,900. Their room for 0% gains is $98,900 minus $7,800, which equals $91,100.

They own shares of a broad index fund in a taxable account. One lot cost $60,000 several years ago and is now worth $151,100, a long-term gain of $91,100. In December, they sell that lot and buy the same fund back right away.

Their 2026 taxable income becomes $98,900: $7,800 of ordinary income plus $91,100 of long-term gain. The entire gain sits at or below the 0% line, so they owe $0 in federal capital gains tax on it. Their ordinary income is taxed exactly as it would have been without the sale.

The payoff shows up later. Their new cost basis in those shares is $151,100 instead of $60,000. If they sell in a future year when they're in the 15% bracket, they'll avoid tax on the $91,100 they already harvested. At 15%, that's $13,665 of federal tax they won't owe on that gain.

Worked example 2: what happens if you overshoot

Suppose Maria and James misjudge their income and realize $100,000 of gain instead of $91,100. Their taxable income is now $107,800, which is $8,900 above the $98,900 line.

Only the portion above the line is taxed at 15%: $8,900 times 15% is $1,335. The first $91,100 of gain still gets the 0% rate, and their ordinary income tax doesn't change. Overshooting isn't a disaster, but it turns a free reset into a taxable one for the extra amount. That's why many people harvest late in the year, once they can estimate their income closely.

Worked example 3: a single saver with a smaller window

Dana is single and still working. She expects $58,000 in wages in 2026 and takes the $16,100 standard deduction, leaving $41,900 of taxable income. The 0% line for single filers is $49,450, so her room is $49,450 minus $41,900, or $7,550.

If Dana holds a fund that has gained at least $7,550 and has been held more than a year, she can sell enough to realize $7,550 of gain and pay no federal tax on it. Her basis rises by $7,550. If she would otherwise pay 15% on that gain later, she'd avoid about $1,132.50 in future federal tax. A smaller window can still be worth using, especially year after year.

The side effects to check before you sell

Gain harvesting is "free" only for federal capital gains tax. The extra income can ripple into other parts of your finances, and these are the ones that most often surprise people.

ACA health insurance subsidies. If you buy coverage through the Health Insurance Marketplace, your premium tax credit is based on your expected household income, and HealthCare.gov lists capital gains as income that counts. A $91,100 harvest could shrink or eliminate your subsidy, costing far more than the tax you saved. Early retirees should run the numbers for both together. Our article on ACA tax credits and the 400% subsidy cliff explains why this can matter so much.

Social Security taxes. If you already collect Social Security, a harvested gain raises the income the IRS uses to decide how much of your benefit is taxable. IRS Topic 423 explains that benefits become taxable when your modified adjusted gross income plus half your benefits exceeds a base amount. A gain taxed at 0% could still make more of your benefit taxable. See how the 50% and 85% rules work for worked examples.

State income tax. The 0% rate is a federal rule. Many states tax capital gains, so a gain that's free federally may still create a state tax bill. Check your state's rules before selling.

Carried-over losses. If you have unused capital losses from earlier years, IRS Topic 409 notes that they reduce your capital gains. A harvested gain would use up those losses first, so you may want to keep them for a year when your gains would otherwise be taxed at 15% or more.

Other income-based programs. Any benefit or credit that looks at your income for the year may count a harvested gain. If you rely on one, check how a one-time gain would be counted before you sell.

Buying back, the holding period and reporting

Because you're selling at a gain, you can buy the same investment back right away if you want to keep your portfolio unchanged. The wash-sale rule, as Charles Schwab explains, is triggered when you sell a security at a loss and buy the same or a substantially identical one within 30 days before or after the sale. Gain harvesting doesn't involve a loss.

There's a catch, though. The shares you buy back start a new holding period. If you sell them again within a year, any gain on them will be short-term and taxed as ordinary income. Plan to hold repurchased shares for more than a year before selling them again at a gain.

Choose which shares to sell with care. If you bought the same fund at different times, your broker may let you pick specific lots. Selling the lot with the largest long-term gain per dollar helps you fill your 0% room without selling more than you need.

Finally, report the sale. The IRS says most sales are reported on Form 8949, with totals summarized on Schedule D of Form 1040. Your broker will send a Form 1099-B listing the sale and your cost basis, so check that the basis on it matches your records.

A step-by-step checklist

Before December, estimate your full-year ordinary income: wages, pension payments, IRA withdrawals, interest, and any short-term gains or nonqualified dividends. Then subtract your standard or itemized deduction to estimate taxable income.

Next, look up the current 0% threshold for your filing status and subtract your estimated taxable ordinary income. Remember that qualified dividends also use up 0% room. Then:

  1. Pick lots in your taxable account held more than one year.
  2. Calculate the gain on each lot and sell only enough to fill your remaining room, leaving a cushion for surprises.
  3. Check the effect on ACA subsidies, Social Security taxation and state tax before placing the trade.
  4. Buy back the same or a similar investment if you want to stay invested, and note the new purchase date.
  5. Keep your trade confirmations and compare them with your Form 1099-B at tax time.

A tax professional can help if your situation includes ACA coverage, Social Security or large carried-over losses, since those interactions are easy to misjudge.

Frequently asked questions

What is the 0% capital gains tax bracket for 2026?

For 2026, long-term capital gains are taxed at 0% while total taxable income stays at or below $49,450 for single filers, $98,900 for married couples filing jointly and $66,200 for heads of household. The thresholds rise with inflation each year.

Does the wash-sale rule apply to tax-gain harvesting?

The wash-sale rule applies when you sell at a loss and buy a substantially identical security within 30 days. Gain harvesting involves a sale at a gain, so you can buy the investment back, though the new shares start a new holding period.

Can capital gains affect my ACA health insurance subsidy?

Yes. HealthCare.gov counts capital gains as income when calculating Marketplace savings, so a large harvested gain can reduce or eliminate your premium tax credit even if the gain is taxed at 0%.

Content on The Evergreen Edit is for educational and informational purposes only and is not individualized financial, investment, tax or legal advice. Learn more.

Which money-saving habit will you focus on next?

This article is for educational purposes only and isn't personalized financial, tax or legal advice. Consider talking with a qualified professional about your situation.

Kiara Miller

Kiara Miller — Founder & Editor

Kiara Miller is the founder and editor of The Evergreen Edit. He has been doing independent finance research for two decades, is a tax preparer, and reviews every article before it's published.

More about Kiara →

Get smarter about your money.

Join readers who get money stories on their chosen topics, daily or as new articles post.

Which topics do you want in your inbox? Pick up to 3
Email frequency

We'll use your answers to send articles you care about and to plan new content. We never sell your info. Privacy Policy

Recommended reading