RetirementCheck101 logo A Service of RiskCheck101.comRetirementCheck101
Educational content only — not investment, tax, or legal advice. Based on publicly available IRS rules as of 2025. Disclaimer.

Transitioning from an HSA to Medicare

Medicare & HealthcareUpdated 2025-06-07

An HSA can be funded only while you are enrolled in a qualifying HDHP and not enrolled in Medicare. The transition at 65 has one trap that catches thousands of people every year: a six-month retroactive Part A enrollment that the rules apply to anyone who claims Social Security after age 65.

The basic rule

Under IRC §223(b)(7), Medicare enrollment in any part (A, B, C, or D) makes you ineligible to contribute to an HSA. The disqualification applies to the entire month of Medicare enrollment forward. Existing HSA balances remain available for tax-free qualified medical-expense withdrawals indefinitely — only new contributions stop.

The six-month retroactive trap

If you claim Social Security retirement benefits at or after age 65, you are automatically enrolled in Medicare Part A. SSA also applies a "six-month retroactive enrollment" rule: your Part A start date is set to six months before the date of your Social Security application (but no earlier than your 65th birthday month).

The trap: contributions made during those retroactive six months become excess HSA contributions, subject to the 6% excise tax under IRC §4973 unless withdrawn with earnings before the filing deadline. A worker who turns 65 in March, contributes the full year's HSA limit by August, and applies for Social Security in October has just made September–October contributions ineligible (retroactive to April).

The workaround

If you delay Social Security past age 65, Part A enrollment is not automatic — you must actively decline it during Medicare sign-up. Most people delaying Social Security past 65 still enroll in Part A because it is premium-free, but doing so kills HSA eligibility from that month forward.

What to do with the HSA after Medicare

Post-Medicare, the HSA continues to function as a tax-free medical-expense account. Two strategies for the balance:

The post-65 non-medical withdrawal rule

Before age 65, non-medical HSA withdrawals are taxed as ordinary income plus a 20% additional tax under §223(f)(4). At age 65, the 20% penalty disappears — the HSA becomes effectively a Traditional IRA for non-medical purposes, taxable on withdrawal but without the penalty. The "stealth IRA" feature is why some advisors recommend maxing the HSA even for clients with no near-term medical spending.

Spouses and HSAs

HSAs are individual accounts. A 65-year-old spouse who enrolls in Medicare can still benefit from the family-coverage HSA contribution made to the younger spouse's HSA — if the younger spouse has HDHP family coverage and is not yet Medicare-enrolled, the family contribution limit still applies. The older spouse simply cannot contribute to their own HSA.

Common mistakes

Sources

RetirementCheck101 flags the HSA/Medicare timing in your worksheet so the contribution stops before the six-month trap. Explore the free educational tool.