Capital Gains Harvesting Explained | A Tax Strategy for Long-Term Investors

Most investors have heard of tax-loss harvesting. Fewer have heard of its lesser-known counterpart: capital gains harvesting. The strategy sounds counterintuitive — intentionally selling appreciated assets to realize a taxable gain. Done correctly, it permanently resets your cost basis, potentially at zero federal tax cost, and reduces future tax liability over the life of the portfolio.

Bouchey Financial Group integrates capital gains harvesting into portfolio management and tax planning for clients with significant taxable investment accounts. The firm's CERTIFIED FINANCIAL PLANNER™ professionals and CPAs evaluate these decisions together — not in separate conversations.

What Capital Gains Harvesting Is

Capital gains harvesting means deliberately selling an appreciated position to realize the gain, then immediately repurchasing the same security at the higher price. The result: a permanently higher cost basis with no change in the underlying investment.

The strategy's value comes from the long-term capital gains tax rate structure under IRS Topic 409. Long-term gains — on assets held more than one year — are taxed at 0%, 15%, or 20% depending on taxable income. In years when income is low enough to fall within the 0% bracket, gains can be realized with no federal tax at all.

2026 Long-Term Capital Gains Rate Thresholds

Rate Single Filers Married Filing Jointly
0% Up to $49,450 Up to $98,900
15% $49,451–$545,500 $98,901–$613,700
20% Above $545,500 Above $613,700
+3.8% NIIT MAGI above $200,000 MAGI above $250,000

Source: IRS Topic No. 409, IRS Net Investment Income Tax

The Wash-Sale Rule Does Not Apply to Gains

This is one of the most important distinctions between gain harvesting and loss harvesting. The wash-sale rule disallows a loss when a substantially identical security is repurchased within 30 days. It applies only to losses. When harvesting gains, you can sell a position and immediately repurchase it with no waiting period and no disallowance. The new cost basis is locked in at the sale price.

How the Cost Basis Reset Works

The practical impact becomes clear with an example. An investor holds 500 shares of an index fund purchased at $40 per share — a $20,000 cost basis. The fund is now worth $100 per share, or $50,000 total. If those shares are eventually sold, the $30,000 gain is taxable.

If the investor is in the 0% bracket in a low-income year, they can sell all 500 shares, realize the $30,000 gain at zero federal tax, and immediately repurchase the same fund at $100 per share. Future gains will be measured from $100, not $40. The long-term tax savings on the permanent basis reset can significantly exceed the cost of the gain in that year — particularly if the investor eventually expects to be in the 15% or 20% bracket at sale.

When the Strategy Makes Sense

Capital gains harvesting is most valuable when current-year income is temporarily low. The most common situations:

  • Early retirement before RMDs begin. After earned income ends but before Required Minimum Distributions start at age 73, taxable income often drops to its lowest point in decades. This is the most reliable window for gain harvesting at reduced or zero rates.
  • A year of elevated deductions. Large charitable contributions, a donor-advised fund contribution, or significant itemized deductions can reduce taxable income below the 0% threshold in an otherwise high-income year.
  • Gap years and career transitions. A sabbatical, job change, or business wind-down may temporarily lower income in ways that create a harvesting window.
  • Multi-year gain spreading. High-net-worth investors with large embedded gains can spread realizations across multiple years, managing income to stay below the 20% threshold or NIIT trigger rather than realizing everything at once.

What It Does Not Mean

Capital gains harvesting is not about timing the market or selling because you think a position will decline. The investor immediately repurchases the same security. The investment thesis is unchanged. The only thing that changes is the cost basis on the tax return.

It also does not mean harvesting gains is always free. The 3.8% Net Investment Income Tax applies to net investment income for taxpayers whose modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly), per IRS NIIT guidance. Gains realized above those MAGI thresholds carry a 3.8% surcharge on top of the applicable rate — making the effective maximum federal rate 23.8%.

The Four Planning Interactions That Matter Most

Roth Conversions

Gain harvesting and Roth conversions compete for the same tax bracket space. Both increase taxable income in the year of execution. Coordinating them requires projecting total income across both strategies simultaneously and deciding how to allocate available bracket room between conversion dollars and harvestable gains.

In general, Roth conversions take priority for most retirees because they produce permanent future tax-free growth and reduce RMD obligations. Gain harvesting occupies the bracket space that remains after the conversion is sized.

Social Security Taxation

Capital gains count toward provisional income, which determines how much of Social Security benefits are federally taxable. A $50,000 gain that falls within the 0% bracket can still trigger taxation of up to 85% of Social Security benefits if it pushes provisional income above the relevant thresholds, according to the Social Security Administration.

This creates what advisors call a hidden marginal rate on gains. A gain that appears "free" at the 0% rate can carry an effective combined cost of 8% to 12% once the Social Security interaction is modeled. Always project total provisional income before executing a harvest.

Medicare IRMAA Surcharges

IRMAA surcharges on Medicare Part B and Part D premiums are calculated on modified adjusted gross income from two years prior. A large gain harvest in the current year raises MAGI, which increases Medicare premiums two years later. For retirees near IRMAA thresholds, the true cost of harvesting gains includes this future premium impact.

State Taxes

Federal rates tell only part of the story. States that tax capital gains as ordinary income — including Massachusetts at 5% for long-term gains and 8.5% for short-term — add a layer that affects after-tax outcomes independently of federal planning. Nine states have no income tax at all, giving residents a structural advantage in gain harvesting that residents of high-tax states do not have.

Gain Harvesting vs. Tax-Loss Harvesting

Feature Gain Harvesting Loss Harvesting
Purpose Reset basis higher; reduce future tax Offset current gains; reduce current tax
Wash-sale rule applies No Yes (30-day repurchase restriction)
Best timing Low-income years High-gain years
Immediate tax impact May increase current-year tax Reduces current-year tax
Long-term effect Reduces future gain on the position Defers gain; lowers future basis
Can repurchase immediately Yes No (without triggering wash sale)

The two strategies are complementary. In a portfolio with both unrealized gains and unrealized losses, a sophisticated tax plan harvests losses to offset current gains while harvesting remaining gains at a reduced rate — all within the same tax year.

Common Mistakes

Ignoring Social Security provisional income. A gain that appears to fall within the 0% bracket can carry a significant hidden cost once Social Security taxation is modeled. Run the full projection before executing.

Overlooking IRMAA thresholds. MAGI jumps in the harvest year raise Medicare premiums two years later. Plan the gain size with those thresholds in mind, not just the capital gains brackets.

Harvesting all gains at once. Multi-year spreading typically produces better after-tax outcomes than a single large realization. Each year has its own bracket space; using multiple years multiplies the available room.

Treating federal gains as the only variable. State taxes, Social Security, and NIIT together determine the actual cost of a harvest. Modeling all four simultaneously requires multi-year projection, not a single-year calculation.

Putting the Strategy to Work

Capital gains harvesting is most powerful when it is coordinated across multiple years and multiple planning decisions rather than executed opportunistically in a single year. The Bouchey Financial Group team models gain harvesting decisions alongside Roth conversions, investment management, and retirement income planning. 

Contact the team to discuss how capital gains harvesting fits into your financial picture, or explore recent planning topics through the firm's Webinars & Videos library.

Frequently Asked Questions

Does the wash-sale rule apply to capital gains harvesting? 

No. The wash-sale rule applies only to losses. When harvesting gains, you can sell a position and immediately repurchase the same security with no waiting period — the new cost basis is locked in at the sale price.

Can I harvest gains in the 0% bracket every year? 

Yes, as long as taxable income stays within the threshold: $49,450 for single filers and $98,900 for married couples filing jointly in 2026. The window is most reliably available during early retirement before RMDs begin, when income is often at its lowest point.

Does capital gains harvesting increase my cost basis permanently? 

Yes. When you sell and repurchase, the new purchase price becomes your cost basis. Future gains are measured from that higher figure, not the original one — which is the entire point of the strategy.

How does gain harvesting interact with a Roth conversion in the same year? 

Both increase taxable income and compete for the same bracket space. Most advisors size the Roth conversion first, then use remaining bracket room for gain harvesting. Multi-year projection across both decisions produces better outcomes than optimizing each independently.

Does harvesting gains affect Medicare premiums? 

Yes, indirectly. IRMAA surcharges are calculated on MAGI from two years prior, so a large gain harvest can raise Medicare Part B and Part D premiums two years later. Keeping gains below IRMAA thresholds avoids surcharges that can add $500 to $4,000 or more annually.

What is the Net Investment Income Tax, and when does it apply? 

The NIIT adds 3.8% to net investment income for taxpayers with MAGI above $200,000 (single) or $250,000 (married filing jointly). For high-income investors, this makes the effective maximum federal long-term capital gains rate 23.8% rather than 20%.

Should gain harvesting be coordinated with charitable giving? 

Yes. Contributing appreciated securities to a donor-advised fund before selling eliminates capital gains on the donated portion entirely. DAF contributions and gain harvesting often work together in the same tax year to produce better combined outcomes than either strategy alone.

IMPORTANT DISCLOSURE INFORMATION

Please remember that past performance is no guarantee of future results. Different types of investments involve varying degrees of risk, and there can be no assurance that the future performance of any specific investment, investment strategy, or product (including the investments and/or investment strategies recommended or undertaken by Bouchey Financial Group, Ltd. [“Bouchey Financial”]), or any non-investment related content, made reference to directly or indirectly in this blog will be profitable, equal any corresponding indicated historical performance level(s), be suitable for your portfolio or individual situation, or prove successful. Due to various factors, including changing market conditions and/or applicable laws, the content may no longer be reflective of current opinions or positions. Moreover, no portion of this discussion or information contained in this blog serves as the receipt of, or as a substitute for, personalized investment advice from Bouchey Financial. To the extent that a reader has any questions regarding the applicability of any specific issue discussed above to his/her individual situation, he/she is encouraged to consult with the professional advisor of his/her choosing. Neither Bouchey Financial’s investment adviser registration status, nor any amount of prior experience or success, should be construed that a certain level of results or satisfaction will be achieved if Bouchey Financial is engaged, or continues to be engaged, to provide investment advisory services. Bouchey Financial is neither a law firm nor a certified public accounting firm and no portion of the blog content should be construed as legal or accounting advice. A copy of the Bouchey Financial’s current written disclosure Brochure and Form CRS discussing our advisory services and fees is available for review upon request or at www.bouchey.com. Please Note: Bouchey Financial does not make any representations or warranties as to the accuracy, timeliness, suitability, completeness, or relevance of any information prepared by any unaffiliated third party, whether linked to Bouchey Financial’s web site or blog or incorporated herein, and takes no responsibility for any such content. All such information is provided solely for convenience purposes only and all users thereof should be guided accordingly. Please Remember: If you are a Bouchey Financial client, please contact Bouchey Financial, in writing, if there are any changes in your personal/financial situation or investment objectives for the purpose of reviewing/evaluating/revising our previous recommendations and/or services, or if you would like to impose, add, or to modify any reasonable restrictions to our investment advisory services. Unless, and until, you notify us, in writing, to the contrary, we shall continue to provide services as we do currently. Please Also Remember to advise us if you have not been receiving account statements (at least quarterly) from the account custodian.