How Capital Gains Flow Into IRMAA
When a home is sold, the gain (the sale price minus the cost basis, adjusted for qualified improvements and selling expenses) is generally reported on the seller's federal tax return in the year the sale closes. Any portion of that gain not covered by the primary residence exclusion flows through Schedule D into Adjusted Gross Income and, from there, into MAGI. Medicare uses that MAGI two years later to set premiums.
For retirees with otherwise modest income, even a modest taxable gain can push MAGI over an IRMAA threshold. Because the thresholds are cliff-based, one extra penny can cost you thousands in surcharges for the affected year.
The $250,000 and $500,000 Primary Residence Exclusion
Section 121 of the Internal Revenue Code provides a generous exclusion for the sale of a primary residence. A single filer may exclude up to $250,000 of gain. A couple filing jointly may exclude up to $500,000 of gain. The excluded portion never appears on the tax return, so it has no effect on AGI, MAGI, or IRMAA.
This exclusion is not indexed for inflation. The $500,000 cap set decades ago has not moved, even though home values in many markets have grown several multiples in that time. For long-tenured homeowners in high-appreciation markets, the excluded portion may cover only a fraction of the realized gain.
Ownership and Use Tests: Do You Qualify?
To claim the full exclusion, the seller must meet two tests:
- Ownership test: The seller owned the home for at least 2 of the 5 years before the sale
- Use test: The seller used the home as a primary residence for at least 2 of the 5 years before the sale
The 2 years do not need to be continuous. On a joint return, only one spouse needs to meet the ownership test, but both spouses generally need to meet the use test. The full exclusion is also generally only available once every 2 years.
When the Exclusion Is Not Enough
For retirees who bought a home in an appreciating market decades ago, the realized gain often exceeds the exclusion cap.
Example: A couple bought their primary residence in 1990 for $350,000. In 2026, they sell it for $900,000. Their realized gain is $550,000. The joint exclusion of $500,000 covers most of it, leaving a taxable gain of $50,000. That $50,000 is added to the couple's 2026 MAGI.
If their other MAGI for the year was $200,000, the total 2026 MAGI becomes $250,000. On a joint return, that shifts them from the standard premium tier (at or below $218,000) into Tier 1 at $218,000.01. The 2028 Part B premium rises from $202.90 to $284.10 per month per spouse, plus a Part D surcharge of $14.50 per month per spouse.
Timing the Sale: Which Tax Year Counts
The tax year of the sale is determined by the closing date, not the listing date, contract date, or offer date. A sale that closes on December 31 falls in that calendar year. A sale that closes on January 2 falls in the following year.
That distinction matters when the gain could otherwise push a filer over a threshold. Shifting a closing by a few days may allow the gain to land in a year with lower other income, reducing the IRMAA impact. Sellers considering this strategy work with their tax professional and real estate attorney to coordinate timing. Consult a licensed financial advisor or tax professional for personalized planning guidance.
The Two-Year Lookback Effect
IRMAA is always set using the tax return from two years prior. A home sale closing in 2026 appears on the 2026 return, filed in 2027, used by SSA to set 2028 Medicare premiums. The premium impact, if any, shows up in 2028 and typically lasts only that year unless subsequent returns sustain the higher MAGI.
This delay is both a feature and a trap. It is a feature because retirees have two years of advance notice to prepare cash flow for the higher premium. It is a trap because many sellers assume the tax year of the sale is also the year that affects Medicare, and miss the actual impact year entirely.
Strategies to Manage Home Sale IRMAA Exposure
Depending on your situation, several tactics may help reduce or absorb IRMAA impact from a home sale:
- Document basis carefully. Qualified improvements (a new roof, renovated kitchen, additions) increase cost basis and reduce the gain. Keep records
- Time the closing. Align the sale year with a year of otherwise lower MAGI, if possible
- Harvest capital losses in the same year. Losses on other investments can offset the taxable portion of the home sale gain
- Delay other income events. A Roth conversion or large IRA distribution in the same year as a home sale can compound IRMAA. Staging these events across years may help
- Review against the 2026 bracket thresholds. Knowing exactly how far above a threshold the projected MAGI lands drives the decision on timing and strategy
- Check the MAGI guide. Understand which sources add to MAGI and which do not, including the municipal bond interest add-back
Special Cases: Divorce, Death, Rentals, Second Homes
Several situations modify the standard rules:
- Divorce: If a home is sold as part of a divorce settlement, special ownership and use rules may preserve the full exclusion for both former spouses
- Death of a spouse: A surviving spouse may claim the full $500,000 exclusion if the home is sold within 2 years of the spouse's death, provided the other conditions are met
- Partial rental or home office use: Portions of the home used for business or rented out may be excluded from the Section 121 treatment and may trigger depreciation recapture
- Second homes and vacation homes: The primary residence exclusion does not apply to a secondary home. The full gain is generally taxable
- Investment properties: A 1031 like-kind exchange may defer gain on an investment property, but does not apply to a primary residence
Steps to Consider Before Listing
- Estimate the gain. Current value minus cost basis, reduced by qualified improvements and selling costs
- Check eligibility for the full exclusion. Confirm ownership and use tests are met
- Project total MAGI for the year of sale. Add the taxable gain to all other expected income and compare against IRMAA thresholds
- Model the 2-year-out premium impact. Identify which Medicare year will be affected
- Evaluate SSA-44 eligibility. A home sale alone is not a qualifying life-changing event for IRMAA appeal, but a retirement event combined with a sale sometimes is. See our appeal guide for details
- Consult a qualified professional. A CPA or financial advisor familiar with the two-year lookback can help model outcomes. Consult a licensed financial advisor or tax professional for personalized planning guidance
The strategies that work must be in place two years before you enroll, and for retirees, a planned home sale fits inside that same two-year planning window. Running the numbers before listing turns a potential surprise into a known, manageable decision.
See Where You Stand
Our IRMAA Report estimates your projected surcharge exposure based on your income and filing status, including the MAGI impact of a planned home sale on the Medicare premium year two years later.
Get Your IRMAA Report: $25Sources
- Internal Revenue Service, "Publication 523, Selling Your Home," irs.gov
- Internal Revenue Service, "Topic 701, Sale of Your Home," irs.gov
- Centers for Medicare & Medicaid Services, "2026 Medicare Parts A & B Premiums and Deductibles," cms.gov
- Social Security Administration, "Medicare Premiums: Rules for Higher-Income Beneficiaries," ssa.gov
- Internal Revenue Code Section 121, Exclusion of Gain from Sale of Principal Residence