What Is Tax-Gain Harvesting?

An artistic rendering of a stock chart

Most investors have heard of tax-loss harvesting: selling losers to offset gains. Tax-gain harvesting is the mirror image. You deliberately sell winners in a year your income is low, pay little or no tax on the profit, and immediately buy the shares back at the higher price — resetting your cost basis for the future.

The short answer

Tax-gain harvesting means realizing long-term capital gains in a year when your taxable income falls inside the 0% capital gains bracket, so you owe no federal tax on the sale. Then you repurchase the same investment right away, which raises your cost basis and shrinks the taxable gain you will owe whenever you eventually sell for good.

Why the 0% bracket makes this possible

Long-term capital gains — profits on investments held more than a year — are taxed at 0%, 15%, or 20% depending on your total taxable income. For 2026, the 0% rate covers taxable income up to $49,450 for single filers and $98,900 for married couples filing jointly. Note that this is taxable income, measured after deductions, so your actual gross income can be meaningfully higher and still qualify.



A worked example

Say you are married, retired early, and living off savings for the year. Your taxable income is $40,000, well inside the 0% bracket. You own $100,000 of an index fund with a $60,000 cost basis — a $40,000 unrealized gain. You sell the whole position and immediately rebuy it.

The $40,000 gain stacks on top of your $40,000 of other income, bringing taxable income to $80,000 — still under the $98,900 joint threshold. Federal tax on the gain: $0. Your new cost basis is $100,000 instead of $60,000, so if you sell years later at $140,000, you will owe tax on $40,000 of gain instead of $80,000. You just erased half a future tax bill for free.

The rebuy trick: no wash-sale rule on gains

Here is the part that surprises people. The wash-sale rule — the one that blocks you from claiming a loss if you rebuy within 30 days — applies only to losses. There is no equivalent rule for gains. You can sell and rebuy the same security seconds later, keep your exact portfolio, and the IRS is fine with it. The only cost is the bid-ask spread and any trading fees.

Who this works best for

Tax-gain harvesting shines in deliberately low-income years: early retirees living off cash before Social Security or pensions start, people taking a sabbatical or gap year, and anyone with a year of unusually low earnings. It also pairs well with Roth conversions — both compete for the same low-bracket “space,” so it pays to plan them together rather than doing either on autopilot.

Four mistakes to avoid

First, harvesting short-term gains. Profits on assets held a year or less are taxed as ordinary income — the 0% bracket does not apply, so only long-term gains qualify. Second, forgetting state taxes. Most states with an income tax treat capital gains as ordinary income with no 0% bracket, so the federal savings can come with a state bill. Third, overshooting the bracket. Gains stack on top of your other income, so harvesting too much pushes the excess into the 15% bracket — still cheap, but no longer free. Fourth, retirees on Medicare: the extra income can trigger higher IRMAA premiums two years later, which can wipe out the savings.

The bottom line

Tax-gain harvesting is one of the few genuinely free lunches in the tax code: pay 0% now instead of 15% later, with no change to your investments. It only works if you plan around your income year by year, which is exactly the kind of planning Mark Quann lays out in Be Smart, Pay Zero Taxes — worth a read if you want a full playbook for keeping more of what you earn.