Managing the Tax Impact of Capital Gains Stacking
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.
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).
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.
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.






