How Capital Gains Affect Your AGI and Tax Rates

A capital gain increases your adjusted gross income by the full net amount of the gain, dollar for dollar, even when it qualifies for the lower long-term tax rates. That is the piece most sellers miss: the preferential 0%, 15%, or 20% rate only governs how the gain is taxed, not whether it counts toward AGI. Understanding how capital gains affect your AGI matters because AGI is the number that drives Medicare premiums, the Net Investment Income Tax, deduction floors, and dozens of credit phase-outs. A gain that looks cheap at a 15% rate can quietly cost you thousands more through those secondary effects.

How the Gain Reaches Your AGI

Before any capital figure touches your return, the IRS requires netting. Short-term gains and losses go in one bucket, long-term gains and losses in another, and the two results are combined.1Office of the Law Revision Counsel. 26 USC 1222 – Other Terms Relating to Capital Gains and Losses Only the net figure flows onto your 1040.

If the net is a gain, the whole amount lands inside gross income alongside wages, interest, and dividends. AGI is then calculated by subtracting above-the-line adjustments like traditional IRA contributions and student loan interest, and the result appears on line 11.2Internal Revenue Service. Adjusted Gross Income If the net is a loss, you can use it to offset other income, but only up to $3,000 per year ($1,500 if married filing separately). Anything beyond that cap carries forward indefinitely and chips away at AGI a little each year.3Internal Revenue Service. Topic No. 409, Capital Gains and Losses

Short-term gains (assets held one year or less) are taxed at ordinary income rates. Long-term gains (held more than one year) qualify for preferential rates of 0%, 15%, or 20%.3Internal Revenue Service. Topic No. 409, Capital Gains and Losses Both types push AGI up by the same amount. A $100,000 long-term gain adds $100,000 to AGI even if the gain itself is only taxed at 15%.

The Wash Sale Trap

If you sell at a loss and buy the same or substantially identical security within 30 days before or after the sale, the IRS disallows the loss and adds it to the basis of the replacement shares.4Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities The rule applies across all your accounts, including IRAs, and extends to options on the same security. If you were counting on that loss to offset a gain, the netting math changes and your AGI stays higher than planned.

Medicare Premium Surcharges Two Years Later

Medicare bases Part B and Part D premiums on your modified AGI from two years prior. Cross a threshold and you owe a monthly Income-Related Monthly Adjustment Amount on top of the base premium. For 2026, the brackets for individual filers run as follows:

  • MAGI up to $109,000: no surcharge
  • $109,001 to $137,000: $81.20 per month
  • $137,001 to $171,000: $202.90 per month
  • $171,001 to $205,000: $324.60 per month
  • $205,001 to $499,999: $446.30 per month
  • $500,000 and above: $487.00 per month

Married couples filing jointly have thresholds roughly double these, starting at $218,000.5Centers for Medicare & Medicaid Services. 2026 Medicare Parts A and B Premiums and Deductibles

The two-year lookback is what makes capital gains so costly here. Sell a rental property in 2024 and the resulting MAGI spike can raise your Medicare premiums in 2026. At the top tier, that is roughly $5,844 extra per person for the year. A single sale creates a recurring premium cost that persists until the lookback window clears.

The 3.8% Net Investment Income Tax

On top of the regular capital gains rate, a 3.8% Net Investment Income 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).6Internal 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 capital gain. MAGI is $240,000, which exceeds the $200,000 threshold by $40,000. The NIIT applies to the lesser of $60,000 or $40,000, producing an extra $1,520 in tax ($40,000 × 3.8%).7Internal Revenue Service. Questions and Answers on the Net Investment Income Tax The NIIT thresholds are not indexed for inflation, so more taxpayers get pulled in every year.

Deductions and Credits That Shrink as AGI Rises

Several deductions use AGI as a floor. A capital gain raises that floor and reduces what you can deduct.

Medical and dental expenses are deductible only to the extent they exceed 7.5% of AGI.8Internal Revenue Service. Publication 502 (2025), Medical and Dental Expenses If your AGI is $100,000, the first $7,500 of medical costs is not deductible. Add a $50,000 capital gain and the floor jumps to $11,250, erasing $3,750 of deductions you would otherwise have claimed. Personal casualty and theft losses face an even steeper 10% floor after a separate per-event reduction.9Office of the Law Revision Counsel. 26 USC 165 – Losses

Credits phase out above specific AGI lines. The Child Tax Credit starts phasing out at $200,000 for single filers and $400,000 for joint filers, shrinking by $50 for every $1,000 of AGI above the threshold. The American Opportunity Tax Credit for college expenses phases out between $80,000 and $90,000 of modified AGI (single) and $160,000 to $180,000 (joint), disappearing entirely above the upper limit.10Internal Revenue Service. American Opportunity Tax Credit A gain that pushes you past the top of the range costs you the full credit, worth up to $2,500.

The Section 199A deduction for qualified business income uses a taxable income threshold that depends on AGI. For 2026, limitations begin at $201,750 of taxable income for most filers and $403,500 for married couples filing jointly. A large capital gain can push you past those levels and reduce or eliminate a deduction worth up to 20% of your business income.

Gains That Never Enter AGI

Two common exclusions keep gains out of AGI entirely.

Sell your main home after owning and living in it for at least two of the five years before the sale, and you can exclude up to $250,000 of gain from gross income, or $500,000 for married couples filing jointly.11Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence The excluded portion never reaches AGI. Only the gain above the limit gets reported.

Inherited assets get a stepped-up basis. Your basis is generally the fair market value on the date the previous owner died, not what they originally paid.12Internal Revenue Service. Gifts and Inheritances If a parent bought stock for $10,000 and it was worth $100,000 on the date of death, your basis is $100,000. Selling for $102,000 produces only a $2,000 gain in AGI, not $92,000.

What You Can Do About the AGI Hit

Because AGI drives so many downstream consequences, timing and structuring a sale often saves more than the capital gains rate alone suggests.

Harvest Losses to Offset Gains

Selling investments at a loss to generate offsets is the most common tool. A $30,000 long-term loss cancels $30,000 of long-term gain in the netting process before anything reaches AGI. The wash sale rule is the key constraint: no buying the same or substantially identical investment within 30 days on either side of the sale.4Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities A different investment in the same sector is allowed and lets you keep market exposure.

Donate Appreciated Assets Instead of Cash

Donate long-term appreciated stock or property directly to a qualified charity and you skip recognizing the gain entirely while deducting the asset’s full fair market value. The deduction for donated long-term capital gain property is limited to 30% of AGI for the year. This is more efficient than selling, paying capital gains tax, and donating what remains.

Spread the Gain Across Years

An installment sale lets you recognize the gain over multiple years, keeping each year’s AGI lower and possibly below the IRMAA, NIIT, and credit phase-out thresholds. Even without a formal installment contract, splitting discretionary sales across December and January of consecutive years divides the AGI impact.

Plan for the 2026 Opportunity Zone Deadline

Investors who previously deferred gains through a Qualified Opportunity Fund must include any remaining deferred gain in income no later than December 31, 2026.13Internal Revenue Service. Opportunity Zones Frequently Asked Questions That forced recognition will inflate 2026 AGI and can trigger the secondary consequences described above. If you hold QOF investments with deferred gains, model the AGI spike now.

Pay Estimated Tax on Large Gains

A big gain mid-year can trigger an underpayment penalty if you do not make estimated payments. You generally owe estimated tax if you expect at least $1,000 due after withholding and credits. The safe harbor is the lesser of 90% of current-year tax or 100% of prior-year tax, rising to 110% if your prior-year AGI exceeded $150,000 ($75,000 if married filing separately).14Internal Revenue Service. Large Gains, Lump Sum Distributions, Etc. If the gain hits in the third quarter, you can annualize income and increase that quarter’s payment rather than catching up for earlier periods.

Don’t Forget the State Layer

Federal AGI is only part of the picture. Most states with an income tax also tax capital gains, and many use federal AGI as the starting point for their own calculations. State rates range from 0% in states without an income tax to over 13% in the highest-tax states. Some states also limit or eliminate the capital loss deduction against ordinary income. A gain that looks manageable at the federal level can be meaningfully more expensive once your state return is added in.