Transitioning from an HSA to Medicare
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
- Stop HSA contributions at least six months before applying for Social Security after age 65.
- Or delay Social Security past the HSA contribution year-end, so the retroactive enrollment falls into a year of zero HSA contributions.
- If you must continue HSA contributions past 65, defer Social Security until you stop contributing.
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:
- Pay Medicare premiums. Part B premiums (including IRMAA), Part C, and Part D premiums are HSA-eligible expenses under §223(d)(2)(C). Medigap premiums are not. Long-term care insurance premiums are eligible up to age-based limits.
- Reimburse prior years' medical expenses. An often-missed feature: there is no time limit on reimbursing eligible expenses paid out of pocket after the HSA was established. Keep records and pull the reimbursement years (or decades) later for tax-free withdrawals on whatever schedule you choose.
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
- Claiming Social Security at 65 without realizing it forces Part A. Social Security and Medicare Part A enrollment are coupled past 65.
- Forgetting the six-month retroactive lookback. Many last-year HSA contributions become excess and trigger penalties.
- Failing to withdraw excess contributions. If you discover an excess, withdraw it (with earnings) before the tax filing deadline to avoid the 6% annual excise tax under §4973.
- Buying Medigap with HSA funds. Medigap premiums are not qualified medical expenses; using HSA money for them triggers tax + 20% penalty (or just tax, if you are over 65).
Sources
- Internal Revenue Code §223(b)(7), Medicare disqualification (Cornell LII): law.cornell.edu/uscode/text/26/223
- Internal Revenue Code §223(d)(2)(C), HSA-eligible insurance premiums after 65: law.cornell.edu/uscode/text/26/223
- IRS Publication 969, Health Savings Accounts: irs.gov/forms-pubs/about-publication-969
- SSA, "Medicare and HSA" guidance: ssa.gov/medicare/sign-up
- Internal Revenue Code §4973, excise tax on excess HSA contributions: law.cornell.edu/uscode/text/26/4973
RetirementCheck101 flags the HSA/Medicare timing in your worksheet so the contribution stops before the six-month trap. Explore the free educational tool.