How Capital Gains Affect Adjusted Gross Income
Net capital gains are added dollar-for-dollar to your adjusted gross income (AGI), and that higher AGI can trigger cascading tax consequences: phasing out deductions and credits, raising Medicare insurance premiums, increasing the likelihood of the net investment income tax, and pushing ordinary income into a higher tax bracket. The damage extends far beyond the gain itself.
Capital gains join your gross income before AGI is calculated
The starting point: your adjusted gross income (AGI) is gross income minus a handful of deductions (retirement contributions, student loan interest, educator expenses). Capital gains—both long-term and short-term—are included in gross income before this step. That means a $100,000 long-term capital gain immediately raises your gross income by $100,000, even though the federal tax rate on that gain might be only 15%.
Once your AGI is calculated, a cascade of tax rules apply based on that new, higher number. That is where the real cost lies.
Phase-outs: how higher AGI shrinks deductions and credits
Many tax benefits phase out (reduce or disappear) when AGI exceeds certain thresholds. The IRS indexes these thresholds annually for inflation, but the principle is fixed: earn more AGI, claim less benefit.
Charitable contribution deductions cap at 50%, 30%, or 20% of AGI depending on property type; the higher your AGI, the lower the total benefit you can claim. A taxpayer with $100,000 AGI and charitable gifts of $30,000 can deduct perhaps $25,000; the same taxpayer with AGI raised to $150,000 by a capital gain sees that deduction shrink to $20,000 or less.
Medical and dental expenses are deductible only to the extent they exceed 7.5% of AGI (as of 2024). A $10,000 medical bill is undeductible on $100,000 AGI (7.5% = $7,500 floor, $10,000 – $7,500 = $2,500 deduction), but it might be fully deductible on $50,000 AGI. A capital gain raising your AGI by $100,000 could wipe out that medical deduction entirely.
Education credits like the American Opportunity Credit and Lifetime Learning Credit both phase out above AGI thresholds ($80k–$90k for single filers, $160k–$180k for married, 2024). A large capital gain can disqualify a household from claiming these credits, costing thousands in tax benefit.
Deduction for pass-through business income (the Section 199A deduction, often called the QBI deduction) phases out above $182,100 for single filers in 2024. A capital gain pushing you over that threshold can reduce your ability to claim business deductions against your non-investment income.
Modified AGI and the Medicare premium surcharge
Your modified adjusted gross income (MAGI) is not the same as AGI. For many benefits, the IRS adds back certain deductions and includes capital gains, creating a larger number used to determine your eligibility or contribution level.
If you are retired and claiming Medicare, your premiums—Part B (physician) and Part D (prescription)—are income-related. High MAGI triggers a surcharge called Income-Related Monthly Adjustment Amount (IRMAA). In 2024, IRMAA begins for single Medicare beneficiaries with MAGI above $194,500 and married filers above $389,000 (these are 2023 income levels, assessed in 2024 premiums). Each tier of MAGI increases your premium substantially.
Example: A married couple with $400,000 MAGI (including a $200,000 capital gain) pays roughly $800–$1,600 more annually in Medicare premiums compared to a $200,000 MAGI household, even though the tax rate on the gain itself might be only 15%. The surcharge effectively taxes that gain at 15%+ plus the added Medicare cost—a true hidden tax.
Bracket creep and marginal rate impact
Capital gains interact with your ordinary income to determine your effective tax bracket. If you have $100,000 in ordinary income and realize a $50,000 long-term capital gain, the gain does not sit in a lower bracket; it fills in the income above $100,000. If your ordinary income puts you partway through the 24% bracket, the first $10,000 of the capital gain may be taxed at 15% (long-term rate), but the next $40,000 could be taxed at 20% because the long-term capital gains brackets are tied to the ordinary income brackets.
This is called bracket creep: your capital gain pushes ordinary income higher in the bracket, creating an effective tax rate on the gain that exceeds the nominal long-term rate.
The net investment income tax: 3.8% surtax
If your modified AGI exceeds $200,000 (single) or $250,000 (married filing jointly), you owe a 3.8% Net Investment Income Tax (NIIT) on the lesser of (a) net investment income or (b) the amount of MAGI above the threshold.
A $150,000 capital gain triggering $50,000 of NIIT on top of federal and state income tax turns a nominal 15% federal rate into 20.8% just in federal tax. Add state tax, and the all-in rate can exceed 30%.
State income taxes and AGI
States vary in their treatment of capital gains. Some (California, New York, Vermont) tax long-term capital gains as ordinary income and include them fully in AGI. Others (like North Carolina and South Carolina) separate capital gains onto their own tax schedules. A few states—including Nevada, Texas, and Wyoming—have no income tax at all.
If you moved between states during the year or sold property in a state different from your residence, you may owe tax in multiple jurisdictions. Your AGI-raising capital gain increases your total state tax liability, sometimes significantly.
Roth conversion timing and capital gains
A common planning mistake: realizing capital gains in the same year you convert a large traditional IRA to a Roth IRA. The conversion is included in AGI, which then phases out deductions, triggers NIIT, and raises Medicare premiums. Separating the capital gain and conversion into different tax years often cuts total tax by 20% or more.
Harvesting gains strategically to stay below thresholds
The inverse strategy is gain harvesting: deliberately recognizing capital gains in years when your AGI is low (e.g., a sabbatical year, or early retirement before Social Security kicks in) to use the 0% long-term capital gains bracket, fill up the 15% bracket, or stay below Medicare premium thresholds. In low-income years, a $50,000 capital gain might cost nearly nothing in federal tax and save thousands by avoiding phase-outs and surtaxes.
See also
Closely related
- Capital Gains Rate: Zero Percent Bracket — Income limits for 0% long-term capital gains tax.
- Net Investment Income Tax (3.8% Surtax) — How high AGI triggers the additional NIIT surtax.
- Long-Term Capital Gains Tax — Federal rates and how they apply to your income.
- Capital Gains on Rental Property — Example of a large gain and its AGI impact.
- Marginal Tax Rate — How capital gains fill brackets and affect your top rate.
- Tax Bracket — Income thresholds for each federal rate.
Wider context
- Adjusted Gross Income Basics — Core income tax concept.
- Tax Loss Harvesting — Using losses to offset gains and manage AGI.
- Medicare Premiums and High Income — IRMAA and income-related surcharges.