A capital gain increases your adjusted gross income by the full amount of the gain, even when the gain qualifies for the lower long-term rate. That is the piece most sellers miss when they look at how capital gains affect AGI: the preferential 0%, 15%, or 20% rate changes only how the gain is taxed, not whether it counts toward AGI. The higher AGI then ripples through the rest of your return and into Medicare, quietly costing more than the capital gains tax alone.
Gains Enter AGI at Full Value
A capital gain is the profit from selling an asset for more than its adjusted basis. The IRS sorts those gains by holding period. Assets held one year or less produce short-term gains, taxed at ordinary income rates. Assets held longer than a year produce long-term gains, taxed at 0%, 15%, or 20% depending on taxable income.1Internal Revenue Service. Topic No. 409, Capital Gains and Losses
Both types add to AGI identically. A $100,000 long-term gain adds $100,000 to AGI whether it is taxed at 15% or at your ordinary rate. AGI appears on line 11 of Form 1040 and is calculated by totaling gross income (which includes your net capital gain) and subtracting above-the-line adjustments such as traditional IRA contributions and student loan interest.2Internal Revenue Service. Adjusted Gross Income
Two special categories still enter AGI the same way, even though they carry higher maximum rates: collectibles gains (capped at 28%) and unrecaptured Section 1250 gain from depreciated real estate (capped at 25%).1Internal Revenue Service. Topic No. 409, Capital Gains and Losses3Office of the Law Revision Counsel. 26 USC 1250 – Gain From Dispositions of Certain Depreciable Realty
Netting Happens Before AGI
Only your net capital result reaches AGI. The IRS requires you to group short-term gains and losses in one bucket, long-term gains and losses in another, and then combine the two.4Office of the Law Revision Counsel. 26 USC 1222 – Other Terms Relating to Capital Gains and Losses
A net gain flows into gross income in full. A net loss can offset other income, but only up to $3,000 per year ($1,500 if married filing separately), with any excess carrying forward indefinitely.1Internal Revenue Service. Topic No. 409, Capital Gains and Losses That $3,000 annual ceiling is why a single bad year can shelter only a small slice of AGI at a time.
One trap kills the strategy for many investors. If you sell at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the wash sale rule disallows the loss and adds it to the basis of your replacement shares instead.5Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities The rule reaches across accounts, including IRAs, and extends to options on the same security. A disallowed loss never reduces AGI in the year of sale.
What a Higher AGI Costs You
The tax rate on a capital gain is only the first bill. A larger AGI pulls several other levers on your return and on programs tied to your income.
Medicare Premium Surcharges
Medicare bases Part B and Part D premiums on your modified AGI from two years earlier. Above certain thresholds, you owe a monthly surcharge called the Income-Related Monthly Adjustment Amount. For 2026, individual filers pay no surcharge up to $109,000 of MAGI, then $81.20 monthly from $109,001 to $137,000, rising through the brackets to $487.00 monthly at $500,000 and above. Joint-filer thresholds start at roughly double, near $218,000.6Centers for Medicare & Medicaid Services. 2026 Medicare Parts A and B Premiums and Deductibles
The two-year lookback is the sting. A rental sale in 2024 raises your 2026 premiums. At the top tier, that is up to $5,844 in extra premiums per person for the year, all triggered by a one-time AGI spike.
The 3.8% Net Investment Income Tax
An additional 3.8% tax applies to the lesser of your net investment income or the amount your MAGI exceeds $200,000 (single) or $250,000 (married filing jointly).7Internal Revenue Service. Net Investment Income Tax Capital gains are a primary component of net investment income.
Take a single filer with $180,000 in salary and a $60,000 long-term gain. MAGI is $240,000, so the excess over the $200,000 threshold is $40,000. NIIT applies to the lesser of $60,000 or $40,000, producing an extra $1,520 in tax.8Internal Revenue Service. Questions and Answers on the Net Investment Income Tax These thresholds are not indexed for inflation, so more taxpayers cross them each year.
Deduction Floors Get Higher
Several deductions use AGI as a floor. Medical and dental expenses are deductible only above 7.5% of AGI.9Internal Revenue Service. Publication 502 (2025), Medical and Dental Expenses With $100,000 in AGI, the floor is $7,500. Add a $50,000 gain and the floor jumps to $11,250, erasing $3,750 of deductible medical costs. Personal casualty and theft losses face an even steeper 10% floor after a separate per-event reduction.10Office of the Law Revision Counsel. 26 USC 165 – Losses
Credits Phase Out
The Child Tax Credit starts phasing out at $200,000 for single filers and $400,000 for joint filers, dropping by $50 for every $1,000 of AGI above the threshold. The American Opportunity Tax Credit phases out between $80,000 and $90,000 of modified AGI (single) or $160,000 to $180,000 (joint), and disappears entirely above the top of the range.11Internal Revenue Service. American Opportunity Tax Credit A gain that pushes you past the upper limit costs you the full credit, worth up to $2,500.
The Section 199A qualified business income deduction also depends on taxable income, which moves with AGI. For 2026, the limitations begin at $201,750 of taxable income for most filers and $403,500 for joint filers. A capital gain that lifts taxable income past those levels can reduce or eliminate a deduction worth up to 20% of business income.
Gains That Do Not Enter AGI
Two common exclusions can keep some or all of a sale out of AGI in the first place.
The primary residence exclusion lets you exclude up to $250,000 of gain ($500,000 for joint filers) if you owned and used the home as your main residence for at least two of the five years before the sale.12Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Only the gain above that limit gets reported.
Inherited assets receive a stepped-up basis equal to fair market value on the date of the previous owner’s death.13Internal Revenue Service. Gifts and Inheritances Stock a parent bought for $10,000 that was worth $100,000 at death carries a $100,000 basis in your hands. Sell for $102,000 and only $2,000 reaches AGI.
Managing the AGI Impact
Because AGI drives so much beyond the gains tax itself, timing and structure often save more than the rate calculation suggests.
Harvest losses against gains. Realized losses net directly against realized gains before anything flows to AGI. Just avoid the wash sale window; you can immediately buy a different, non-identical investment to maintain market exposure.5Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities
Donate appreciated assets instead of selling. Giving long-term appreciated stock directly to a qualified charity avoids recognition of the gain entirely and generates a deduction for the full fair market value, capped at 30% of AGI. That beats selling, paying tax, and donating cash.
Spread gains across years. Installment sales let you recognize gain over multiple years, keeping each year’s AGI lower and possibly under the IRMAA, NIIT, and credit thresholds. Even splitting a discretionary sale between late December and early January can cut the AGI impact in either year.
Plan now for QOF deferrals ending in 2026. Any capital gain previously deferred through a Qualified Opportunity Fund must be included in income no later than December 31, 2026.14Internal Revenue Service. Opportunity Zones Frequently Asked Questions That forced recognition will inflate 2026 AGI and may drag other consequences along with it.
A Big Gain Can Trigger Estimated Tax Penalties
Withholding rarely covers a large mid-year gain. You generally owe estimated tax if you expect to owe at least $1,000 after credits and withholding. The safe harbor is the lesser of 90% of current-year tax or 100% of prior-year tax, rising to 110% of prior-year tax if your prior-year AGI exceeded $150,000 ($75,000 married filing separately).15Internal Revenue Service. Large Gains, Lump Sum Distributions, Etc.
A gain in the third quarter does not require retroactive payments for the first two quarters. You can annualize income and increase the payment for the quarter in which the gain occurred. Waiting until April to settle up almost always triggers a penalty.