Yes, long-term capital gains are included in your adjusted gross income. The IRS adds every dollar of net long-term capital gain to gross income on the way to AGI, exactly the way it treats wages. The preferential 0%, 15%, and 20% rates come in later, when your actual tax is calculated on taxable income. By then, the gain has already done its work on AGI, and AGI is the number that governs dozens of other tax benefits.
How the Gain Reaches AGI
You report capital gains on Schedule D and carry the result to Form 1040, where it joins wages, interest, dividends, business income, and retirement distributions in gross income.1Internal Revenue Service. Topic No. 409, Capital Gains and Losses From that total, above-the-line adjustments such as deductible IRA contributions, student loan interest, and self-employment tax come off. What remains is AGI.2Internal Revenue Service. Definition of Adjusted Gross Income
Nothing about the capital gains portion is carved out during that walk. A $100,000 long-term gain raises AGI by $100,000, the same as $100,000 of salary. Many taxpayers assume that because long-term gains get lower rates, they must also sit outside AGI. They don’t. The favorable rate is a rate on the gain; AGI is the total that everything else in the tax code measures against.
What the Higher AGI Costs You
Because Congress pegged a long list of tax breaks to AGI or a close cousin called modified AGI, a large gain can quietly cost more than the capital gains tax itself.
Medical Expense Deduction
You can only deduct medical expenses that exceed 7.5% of AGI.3Office of the Law Revision Counsel. 26 USC 213 – Medical, Dental, Etc., Expenses If your AGI is normally $80,000, the floor sits at $6,000. Realize a $200,000 gain and AGI jumps to $280,000, lifting the floor to $21,000. Medical bills that would have been partly deductible now yield nothing.
Student Loan Interest Deduction
The deduction is worth up to $2,500 and phases out at higher MAGI. For 2026, phase-out begins at $85,000 for single filers and $175,000 for joint filers, and the deduction disappears entirely at $100,000 and $205,000.4Internal Revenue Service. Topic No. 456, Student Loan Interest Deduction A gain that pushes you past the ceiling wipes it out for the year.
Child Tax Credit
The Child Tax Credit begins phasing out once income exceeds $200,000 (or $400,000 for married filing jointly).5Internal Revenue Service. Child Tax Credit A family earning $180,000 in wages keeps the full credit; add a $50,000 capital gain and the credit starts to shrink.
Net Investment Income Tax
The 3.8% Net Investment Income Tax applies to the lesser of your net investment income or the amount your MAGI exceeds $200,000 single, $250,000 joint, or $125,000 married filing separately. Those thresholds are not indexed for inflation.6Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax Capital gains count as net investment income and simultaneously raise MAGI, so a large gain can trigger the NIIT on its own. For someone already in the 20% long-term bracket, the effective federal rate on the gain becomes 23.8%.7Internal Revenue Service. Topic No. 559, Net Investment Income Tax
Medicare Premium Surcharges
Medicare Part B premiums use MAGI from two years earlier. In 2026, the standard premium is $202.90 per month, and the income-related monthly adjustment amount kicks in above $109,000 (single) or $218,000 (joint). At the top tier the total premium reaches $689.90 per month.8CMS. 2026 Medicare Parts A and B Premiums and Deductibles This is where capital gains blindside retirees. Sell a rental property for a $300,000 gain in 2024 and Medicare charges the surcharge in 2026, well after the proceeds may have been spent or reinvested. You can appeal an IRMAA increase after a qualifying life-changing event, but selling an asset isn’t one.
Social Security Benefit Taxation
If you receive Social Security, the IRS decides how much of your benefit is taxable using “combined income,” which is AGI plus tax-exempt interest plus half your benefits.9Internal Revenue Service. IRS Reminds Taxpayers Their Social Security Benefits May Be Taxable Because capital gains are in AGI, they feed directly into that formula. The thresholds are low and have not moved since 1984: for single filers, combined income above $25,000 makes up to 50% of benefits taxable and above $34,000 makes up to 85% taxable; for joint filers, the marks are $32,000 and $44,000.10Office of the Law Revision Counsel. 26 USC 86 – Social Security and Tier 1 Railroad Retirement Benefits A gain of $10,000 to $20,000 is often enough to move a retiree from the 50% level to the 85% level, dragging more Social Security into taxable income.
ACA Premium Tax Credit
The premium tax credit for marketplace coverage is based on household income that starts with AGI. The IRS specifically flags realizing capital gains, including sales of stocks, bonds, or cryptocurrency, as an event that can change the credit.11Internal Revenue Service. Questions and Answers on the Premium Tax Credit An early retiree living on $50,000 of investment income who realizes a $100,000 gain can see household income jump to $150,000 and owe back much of the advance credit received during the year.12Office of the Law Revision Counsel. 26 USC 36B – Refundable Credit for Coverage Under a Qualified Health Plan
Roth IRA Contributions
Roth IRA eligibility phases out based on MAGI. For 2026 the range is $153,000 to $168,000 for single filers and $242,000 to $252,000 for joint filers, with no direct contributions allowed above the ceiling. A gain realized late in the year can retroactively disqualify contributions you already made.
The Preferential Rate Still Applies
Being included in AGI doesn’t cancel the favorable rate. After AGI is reduced by deductions to reach taxable income, the long-term capital gain is pulled out and taxed on its own schedule.13Office of the Law Revision Counsel. 26 USC 1 – Tax Imposed For 2026, single filers pay 0% on gains that fall within taxable income up to $49,450, 15% up to $545,500, and 20% above that; joint-filer breakpoints are $98,900 and $613,700.14Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026
The brackets stack. Ordinary income fills the lower brackets first, and long-term gains sit on top. A single filer with $40,000 of ordinary taxable income and a $20,000 long-term gain sees the first $9,450 of the gain taxed at 0% and the remaining $10,550 at 15%. So a taxpayer can face two things at once: a low headline rate on the gain and a real AGI-driven hit on credits, subsidies, and premiums.
Using Losses to Hold AGI Down
Capital losses work in the opposite direction. If losses exceed gains in a year, up to $3,000 of the net loss ($1,500 if married filing separately) offsets other income and directly lowers AGI.15Office of the Law Revision Counsel. 26 USC 1211 – Limitation on Capital Losses Any excess carries forward indefinitely, keeping its short-term or long-term character, and continues to offset future gains without limit before the same $3,000 annual cap applies against ordinary income.16IRS. 2025 Instructions for Schedule D (Form 1040) Taxpayers expecting a large gain sometimes harvest losses in the same year specifically to hold AGI down and preserve access to income-sensitive benefits.
State Treatment Is Separate
Federal preferential rates do not carry over to state tax. Most states with an income tax treat capital gains as ordinary income, with rates that range from roughly 2% to over 13%. A few states have no income tax, and a few offer partial exclusions or reduced rates for long-term gains. Check your state’s rules before assuming the federal rate is the full picture.