Managing the Tax Impact of Capital Gains Stacking

Understanding all the income sources and deductions that drive your tax bill can help you identify opportunities to lessen their tax impact.

Charles Rotblut leads a class in AAII's new Essential Investing Video Course. Go to https://www.aaii.com/ves for more information and to subscribe.

  • How capital gains stacking works and why investment income is taxed based on how it layers on top of ordinary income
  • Why crossing tax thresholds can raise effective marginal tax rates on both income and investments
  • Tax-planning strategies to manage taxes and improve aftertax returns

The discounted tax rates on your long-term capital gains and qualified dividends are applied in a progressive manner. In simple terms, long-term capital gains and qualified dividends stack on top of your ordinary income—a concept known as capital gains stacking. It is not apparent when you look at your Internal Revenue Service (IRS) Form 1040, but it can impact any investor with taxable investments.

Here is the core principle: When the IRS calculates your tax bill, your ordinary income goes first. Then, your capital gains and qualified dividends are layered on top. The larger your amount of ordinary income, the more of your long-term and qualified dividends will be pushed into either the 15% or 20% tax tiers.

Understanding the dynamics at play can help you better manage your taxes and avoid unwanted surprises.

How Capital Gains Stacking Works

To help you understand how capital gains stacking works, let’s start with the basics.

Long-term capital gains and qualified dividends are taxed differently from ordinary income. They are taxed at 0%, 15% or 20% depending on your taxable income.

Taxable income includes—but is not limited to—your salary, interest income, Social Security benefits, withdrawals from traditional individual retirement accounts (IRAs) and Roth IRA conversions. Taxable income also factors in your standard deduction or itemized deductions, enhanced senior deduction (2026–2028) and other deductions you qualify for.

Let’s call this ordinary taxable income to simplify the explanation.

The second component of taxable income consists of qualified dividends and long-term capital gains (or losses). This qualified investment income sits on top of ordinary taxable income when determining your effective marginal tax rate. The effective marginal rate that applies to each additional dollar of income (taxable or qualified investment) depends on where your qualified investment income lands in the overall income stack, not on the investment gains themselves in isolation.

This is where we get the term capital gains stacking. Your capital gains stack on top of your ordinary taxable income to determine your effective marginal tax rate.

An Example of Stacking

Consider Frank and Paula, a retired couple who are making tax projections based on what they expect to earn this year (2026). The couple will receive $80,000 of ordinary taxable income from Social Security, pension benefits and required minimum distributions (RMDs). Thanks to the Tax Cuts and Jobs Act (TCJA) of 2017 and the One Big Beautiful Bill Act (OBBBA) of 2025, no taxes are levied on capital gains and qualified income for taxable income of up to $98,900.

Based on this, it may seem logical that the couple will qualify for the 0% tax rate on qualified investment income. This will be the case as long as their qualified investment income does not exceed $18,900 ($80,000 + $18,900 = $98,900).

If the couple earn $1 more of ordinary taxable income, it will be taxed at an effective rate of 27%. How is this possible? The couple pay a marginal tax rate of 12% on their ordinary income. In addition, since capital gains and qualified dividends stack on top of ordinary taxable income, $1 of their qualified investment income will now be taxed at 15%. Put another way, the couple’s income would be $1 above the $98,900 threshold (Table 1).

TABLE 1

The Cost of Going $1 Over the Threshold

Frank and Paula are married and retired. They forecast their 2026 ordinary taxable income from Social Security, pension benefits and required minimum distributions (RMDs)—adjusted for the standard deduction, additional senior deduction and new enhanced senior deduction—to total $80,000.

The couple also anticipate realizing $18,900 of qualified investment income (long-term capital gains and qualified dividends). This amount will exactly fill the remaining room in the 0% capital gains bracket ($80,000 + $18,900 = $98,900). Should Frank and Paula’s forecast prove to be right, every dollar of their qualified investment income will be tax-free at the federal level.

Now suppose that the couple’s forecast underestimates their ordinary taxable income by $1. That single dollar incurs a effective marginal tax rate of 27% due to capital gains stacking, as shown in the table below.

TABLE 1 The Cost of Going $1 Over the Threshold

Key Takeaway: Frank and Paula are in the 12% ordinary income bracket. That $1 of additional ordinary income is technically taxed at 12%, but because it pushes $1 of their qualified investment income over the $98,900 threshold, it also triggers a 15% tax on that $1 of gains. The combined cost of that single dollar is $0.27, an effective marginal rate of 27%. This is the capital gains bump zone in its simplest form.

The progressive nature of the tax code is at work here. Income, regardless of whether it is taxed at ordinary or long-term tax rates, always fills up the lowest tax rate bucket first. Any excess then fills up the next tax rate bucket and so on. Because ordinary taxable income determines how full the 0% capital gains and dividend bucket is, capital gains stacking can lead to qualified investment income flowing into either the 15% or 20% bucket, or just the 20% bucket.

The Capital Gains Bump Zone

As you can tell from the last example, capital gains stacking becomes especially important when you are near one of the capital gains rate thresholds. In that situation, adding ordinary income does not just increase the tax you owe on that income at its own rate—it also pushes a portion of your capital gains into a higher bracket. The result is a higher effective marginal rate on that ordinary income than your tax bracket alone would suggest.

Financial planner Michael Kitces describes this as a “capital gains bump zone.” When an extra dollar of ordinary income crosses one of the tax rate thresholds, it is taxed at a higher effective marginal rate than its bracket alone would suggest—because it simultaneously pushes capital gains stacked above it into a higher tier (Table 2).

Table 2 2026 Long-Term Capital Gains Rates and Bump Zones

Frank and Paula were in the 12% income tax bracket and got pushed into the 15% capital gains bracket because of one extra dollar of income. High-income earners also face a capital gains bump zone.

Harold and Stacey expect to have $613,700 of combined ordinary taxable income and qualified investment income. Should the couple earn just one extra dollar of income this year, they will be bumped into the 20% capital gains bracket. That extra $1 will come with an additional 5% tax on top of the 35% income tax, 3.8% net investment income (NII) surtax and 15% capital gains tax rates they were already paying before crossing into the bump zone—bringing the effective marginal tax rate of that dollar to 40%.

The Net Investment Income Tax

As shown in the previous paragraph, the 3.8% NII surtax adds a third layer to the stack for investors above certain income thresholds. It applies to the lesser of your NII or your modified adjusted gross income (MAGI) above $250,000 for married couples filing jointly and $200,000 for single filers. Unlike most other thresholds, these are not adjusted for inflation.

MAGI for most taxpayers is the adjusted gross income (AGI) amount listed on your Form 1040. It is calculated as all taxable income minus specific adjustments to income [e.g., contributions to health savings accounts (HSAs), contributions to self-employed retirement accounts, etc.]. Foreign earned income is generally added back too.

NII subject to the surtax includes short- and long-term capital gains, qualified dividends, taxable interest, rental income and nonqualified annuity income.

The NII surtax can combine with the capital gains bump zone to create even higher effective marginal rates. A married couple in the 24% ordinary income bracket with capital gains straddling the $250,000 MAGI threshold may face a higher marginal rate on even one additional dollar of ordinary income.

Let’s break down the math. One dollar of MAGI crossing the $250,000 threshold will be taxed at a 24% income tax rate. It will also cause $1 of qualified investment income already taxed at 15% to incur an additional 3.8% (NII surtax). The combined effective marginal rate on that extra $1 is 27.8%, compared to the 24% bracket rate alone.

The effect of the NII surtax is that it creates four long-term capital gains rates rather than three: 0%, 15%, 18.8% (15% + the surtax) and 23.8% (20% + the surtax).

Capital Gains Stacking and the OBBBA

While the focus has so far been on how one extra dollar of income impacts how your qualified investment income is taxed, the reverse is also true. One extra dollar of investment income—regardless of whether it is long-term capital gains, qualified dividends, short-term capital gains, interest, etc.—can increase your MAGI above key thresholds.

This is because capital gains and dividends not only stack on top of your ordinary income, but they are also included in all forms of MAGI. The higher your investment income is, the higher your MAGI will be.

MAGI is a very important component of tax planning because it not only determines the Medicare premiums you will pay (if age 65 or older two years from now) but also your current eligibility for the following new deductions included in the OBBBA.

  • Enhanced senior deduction: The additional deduction of $12,000 for married joint filers (both age 65 or older) and $6,000 for single filers age 65 or older begins phasing out at MAGI above $150,000 and $75,000, respectively. The deduction completely phases out at MAGI of $250,000 and $175,000, respectively.
  • Auto Loan Interest Deduction: The ability to deduct up to $10,000 of interest on qualifying vehicles begins phasing out at MAGI of $200,000 (married joint) and $100,000 (single). The deduction completely phases out at MAGI of $250,000 and $150,000, respectively.
  • State and Local Tax (SALT) Deduction: Up to $40,400 of state and local taxes (income or sales plus property) can be deducted by those married joint and single filers with MAGI of up to $505,000 in 2026. The deduction phases down to a floor of $10,000 for MAGI above those levels.

Neither the enhanced senior deduction nor the auto loan interest deduction are indexed to inflation. The current phaseouts will remain static through 2028, after which both deductions will expire. The SALT deduction and its phaseouts will increase 1% each year through 2029. The SALT deduction will revert to a maximum of $10,000 with no phaseout in 2030.

For all three deductions, every extra dollar of qualified income pushes you closer to or above their respective MAGI thresholds. Proper tax planning must take into account this aspect of capital gains stacking too.

Planning Strategies for Capital Gains Stacking

Tax planning involves understanding what levers can be pulled and how pulling one lever might impact your overall tax bill. Here are strategies you can use to your advantage.

Capital Gains Harvesting in Low-Income Years

Capital gains harvesting involves purposely selling an investment at a profit. Often, investors who engage in this practice will immediately repurchase the investment, thereby resetting its cost basis at a higher level.

Capital gains harvesting is very effective when you expect to temporarily be in the 0% capital gains tax bracket. This can be the period when a person retires but has not filed for Social Security benefits or started taking RMDs. Years with large deductions can also create an opportunity for capital gains harvesting (Table 3).

TABLE 3

Harvesting Gains Around RMDs

Robert and Karen are married and retired. Their 2026 ordinary taxable income from Social Security and a pension totals $78,000. Robert turns age 73 this year and must take his first required minimum distribution (RMD) of $18,000, bringing the couple’s total ordinary taxable income to $96,000. This leaves $2,900 of room below the $98,900 threshold for the 0% capital gains bracket.

The couple hold two stock positions with unrealized gains. Position A has a gain of $2,800, which is small enough to fit entirely within the 0% bracket. Position B has a gain of $3,800, big enough to push $900 of the gain into the 15% bracket.

Table 3 Harvesting Gains Around RMDs

Key Takeaway: By harvesting Position A, Robert and Karen reset their cost basis by $2,800 at no federal tax cost. Harvesting Position B produces a $135 tax bill on the $900 that spills into the 15% bracket. When room in the 0% bracket is limited, fitting in just enough capital gains not to overflow optimizes the tax-free basis reset.

The critical step is calculating your projected taxable income before realizing any gains to confirm how much room remains below the 0% threshold. High-income investors could also target the 15% threshold if they would otherwise be subject to the NII surtax and/or the 20% capital gains bracket.

Combining Expenses in a Single Year

Bunching charitable donations into a single year rather than spreading them out over several years is an effective way of lowering your tax bill. Realizing elective medical costs in years when you expect to exceed the 7.5% AGI floor for deducting such expenses is also effective.

Coordinating Roth Conversions With Capital Gains and Dividends

Roth IRA conversions are taxable as ordinary income in the year they are made. The larger the size of the Roth conversion, the less room there is to stack qualified investment income on top of your AGI. In years when significant gains are unavoidable, it may be worth reducing the size of a planned Roth conversion or deferring it to a year with fewer gains.

Qualified Charitable Distributions

Qualified charitable distributions (QCDs) are an even better way of using your charitable intentions to avoid the adverse impact of capital gains stacking. QCDs reduce your AGI dollar-for-dollar, thereby giving you more room to realize long-term capital gains and qualified dividends without crossing key thresholds.

Withdrawal Sequencing

Retirees drawing from multiple account types—traditional IRA, taxable and Roth—have an opportunity to sequence withdrawals in a way that manages the stack. The math starts with how much room you have between your RMDs and the top of the next tax or Medicare bracket.

Married joint filers reach the 15% tax bracket for long-term capital gains and qualified dividends once taxable income exceeds $98,900. Their income tax rate rises to 24% for taxable income above $211,400. Higher Medicare premiums go into effect for MAGI above $218,000 in 2026.

Factoring in the interplay of your withdrawals and the capital gains and income realized from taxable accounts can help you better assess how close you are to crossing one of these three thresholds.

Capital Gains Stacking Can Be Managed

While it is important not to let the tax tail wag the portfolio dog, there are ways you can effectively boost your aftertax returns. Strategically planning around the impact of capital gains stacking is one of those ways.

Sell investments that meet your sell rules while also identifying opportunities to minimize their tax impact—including those outside of your portfolio. As this article explains, looking at all the income sources and deductions that drive your tax bill can help you do so. 

Discussion

ROBERT A from NC posted 4 months ago:

Thank you, Charles, for this article. It prompted me to play around with the IRS's Qualified Dividends and Capital Gain Tax Worksheet to look for ways to defeat the stacking. It's going to burn me this year, since my ordinary income is going to increase while I've "lost" all my dependents, and there's nothing I can think of to do about it. But at least I know what's coming and can plan accordingly.


ROBERT L from PA posted 4 months ago:

Thank you very much for this informative and easy to understand article. I was unaware of this until a few days ago when filing my 2025 taxes. Man was I surprised. I missed a few years of managing my withdrawals as I suspect I have had this happen in previous years. Running out of time before Social Security kicks in and puts me over the lowest threshold. I hope others heed this advice.


Mahlon M from WA posted 3 months ago:

I am new to this. Are you saying that: Up to 98,900 in "ordinary" taxable income is this year taxed at 0%? But then if you have any capital gains on top of that, bringing your total income from between 98,901 to 250,000 -- then that means all the capital gains between those two numbers will be taxed at 15%? And then since that is also part of your total income, you are **also** being taxed the tax on income? So that your final tax bill for that range of 98,901 to 250,00 is both the 15% for capital gains tax **and** whatever it is for "regular" income at that level -- I'm not sure -- let's say 12% (?) -- so you're paying 27% for anything in that range? Is that how this works? I would be very grateful if anyone had the time, please, to offer any clarification.


CHARLES R from IL posted 3 months ago:

Hi Mahlon,

The ordinary income is taxable, but capital gains do not get taxed until the combined ordinary taxable income and qualified investment income exceed the $98,000 amount. Ordinary income and qualified investment income are still taxed at different rates. So you are not paying an additional 15% on your ordinary income.

Hope this helps,

Charles


DAVE G from TX posted 3 months ago:

Charles, In your editor's note you equate the above taxable income $98,900 with the label AGI which is wrong. One is line 11 and the other line 15 at least in 2025. Also, by jumping into the conversation with the term "taxable income" you make it easy to do the math, but completely confuse most tax payers, except those that actually do understand their taxes and the fact that line 15, and even line 11 are after some variables such as "taxable social security." Some taxpayers will end up wondering why in your example instead of adding 27% tax on that extra dollar, they added close to 40%. Last year I reviewed a return where that actually happened to a couple thinking a Roth conversion was going to cost them 12% and it cost them 39%. I don't see in this article how you account for the fact that QD and even tax-free mutual bond income does cause an increase in taxable income well below your $98,900 threshold by increasing taxable income indirectly. My case is a very good example. Prior to the 2025 Senior deduction there was very near zero space in my 12% bracket for LTCG and qualified dividends in the zero percent bracket because my taxable social security had not risen to the 85% level. This is a very important point for most to understand when people are just "stacking" income like you suggest.


ALAN H from MO posted 3 months ago:

Your article on "Capital Gains Stacking" had a one-sentence reference about "Higher Medicare premiums go into effect for MAGI above $218,000 in 2026." Since Medicare premiums are based on MAGI two years prior, wouldn't it be that that MAGI above $218,000 in 2024 will result in higher premiums in CY2026? Historically, MAGI adjustments for inflation have been around $6,000 each year, so to avoid that bracket bump from $1 extra income, the target MAGI for Medicare in 2025 would be $224,000 to avoid premium increase in CY2027, and for 2026 would be $230,000 (estimated) to avoid premium increase in CY2028?


DAVE G from TX posted 3 months ago:

Alan, yes you will pay the surcharge in 2026 if your 2024 MAGI was above $218k.


JOE W from WA posted 3 months ago:

Good article, thanks! One aspect not discussed is that there is another zone above the 'bump zone' where combined marginal rate can reduce again. This was an unexpected outcome from my optimization code results. I had manually set withdrawals to stay right at the start of the 15% LTCG bracket to avoid the effective 27% rate, but the optimizer found that continuing to increase taxable income (in this case Roth conversions) well past that limit was a better overall lifetime solution (I optimize for after-tax estate value.) Once all the CG had been taxed at 15%, every taxable income dollar past that point was again taxed at just 22%. For my situation, paying the 15% tax on my entire LTCG had a better outcome than keeping Roth conversions low and avoiding the 15%. Your mileage may vary.


J M from NJ posted 3 months ago:

Here are a few tips that may be helpful to others: Taxable Income, shown Line 15 of Form1040, includes both ordinary income and taxable investment income. The tax return does not show the amount "Ordinary Taxable Income" that is taxed at ordinary rates using the tax tables. A taxpayer can determine their "Ordinary Taxable Income" by subtracting their Qualified Dividends (Line 3a) and their Long Term Capital Gains (Schedule D) from their Taxable Income (Line 15). Form 8960 shows the calculations for the 3.8% surcharge on Net Investment Income. It is worth noting that only the amount of Net Investment Income above the taxpayers Adjusted Gross Income threshold based on filing status (e.g. MFJ = $250K) is subject to the 3.8% tax.


DAVE G from TX posted 3 months ago:

Charles, There is one aspect of the Capital Gains Stacking that you missed and that is the ZONE between the top of the 0% LTCG bracket ($98,900) and the top of the 12% bracket ($100,800) which in 2026 is $1900, but in 2025 it was only $250 so it was barely noticed, especially since tax tables are used and not the exact calculation. This ZONE is a 12% bracket for LTCG, ONLY if you fill up the 0% LTCG with 100% of ordinary income. Here is an example for you to test. A MFJ couple both over 65 have a $60k SS benefit (51k will be taxable), $51.5k RMD, $25k pension, $18.9k Roth Conversion. This gets you to $98,900 taxable ordinary income. Now you have a window of $1900 which if you add $1900 of LTCG you will generate exactly $228 of extra tax for the LTCG (1900 x .12=228). If you mimic the Capital Gains Worksheet properly you will see this is so, as I did, building my one-line tax simulator. In 2025 this zone was only $30 of tax, in 2026 it is $228 tax or $1900 of LTCG taxed at 12%.


BOB C from CA posted 2 months ago:

Hi Charles, Very much enjoyed reading your article. Table 2, 2026 Long-Term Capital Gains Rates and the Bump Zones raised a question for me. What is the 20% bump zone threshold for a married couple filing separately? Is this another example of the marriage penalty or might this be an opportunity for a couple with a large capital gain of $1,000,000 to reduce their capital gains tax? Thanks.


MARTIN V from CT posted 2 months ago:

I've now spent more time than I want to admit to looking at the Qualified Dividends and Capital Gain Tax Worksheet (Page 38 of the 2025 1040 Instructions) and I'm not seeing the "Stacking" that the article refers to. Line 5 of the worksheet subtracts your qualified dividends and capital gains from your line 1 AGI. You then proceed to figure the tax on the gains separately from the remainder of your ordinary income. On line 22 you figure the tax on the remainder (Line 5) income and on Line 23 you total up the separate taxes from your gains and line 5 ordinary income. I don't see any place where any of these sources are taxed more than once.


You need to log in as a registered AAII user before commenting.
Create an account

Log In

Get your free copy of our special report analyzing the tech stocks most likely to outperform the market.

Download the FREE Report Here: