Signing up for Medicare closes a door that many workers do not realize is open in the first place: the ability to keep putting pre-tax money into a health savings account. The rule catches people who work past 65 while covered by an employer’s high-deductible health plan, because Medicare’s enrollment rules can reach backward in time and turn contributions made months earlier into an unwelcome tax problem.
Why any part of Medicare zeroes out HSA eligibility
A health savings account requires enrollment in a qualifying high-deductible health plan and no other disqualifying coverage — and Medicare counts as disqualifying coverage the moment it starts. According to IRS Publication 969, an individual’s HSA contribution limit drops to zero beginning with the first month they are covered by Medicare, and that rule applies regardless of which part triggers the enrollment: Part A, Part B, Part C, or Part D. Someone who signs up only for premium-free Part A while continuing to work and staying on an employer’s HDHP is still disqualified from further HSA contributions, since Part A alone counts as Medicare coverage under the publication’s definition. The stakes are not small: for 2026, workers under 65 with self-only HDHP coverage can contribute up to $4,400 to an HSA, and $8,750 for family coverage, plus a $1,000 catch-up contribution for those 55 and older — all of which disappears the month Medicare coverage begins, regardless of how much of that year’s limit had already been used.
Free retirement updates: Want plain-English help keeping more of your money in retirement? The free Retirement Shield newsletter covers the benefits, deadlines, and money mistakes that cost retirees, a couple times a week. Subscribe free.
The retroactive-coverage trap for people working past 65
The rule that causes the most unexpected damage involves timing, not the enrollment decision itself. Anyone who delays signing up for Medicare while working past 65 and later enrolls in Part A can have that coverage backdated up to six months, but not earlier than the month they turned 65, under Social Security’s standard enrollment rules referenced in Publication 969. Because eligibility for HSA contributions is judged retroactively, any contributions made to the HSA during that backdated coverage window are treated as excess contributions after the fact — even though, at the time the money went in, the account holder had no idea Medicare would later reach back and cover those same months. The practical fix most advisors recommend is stopping HSA contributions at least six months before applying for Medicare, or before turning 65 for anyone planning to enroll right at that milestone. The six-month lookback is capped at the month someone turned 65, so a worker who delays Medicare enrollment until, say, age 68 does not face a three-year retroactive window — the backdating never reaches earlier than their 65th birthday month, which limits how much cleanup is ever required no matter how long enrollment is postponed.
What happens to money already in the account
Losing the ability to contribute does not touch money already sitting in the HSA. The account and its balance remain the owner’s property permanently, and funds can still be withdrawn tax-free for qualified medical expenses at any point after Medicare enrollment, with no deadline attached to spending down the existing balance. Publication 969 specifically confirms that several Medicare-related costs qualify as HSA-eligible expenses even after enrollment, including Medicare Part B premiums, Part D premiums, and Medicare Advantage premiums — though not Medigap premiums. That means a retiree who built up a large HSA balance during their working years can use it to offset Medicare costs for years after contributions stop, effectively converting the account into a tax-free reimbursement fund for premiums that would otherwise come straight out of a Social Security check or a bank account.
Excess contributions and how to unwind them
An account holder who discovers they contributed to an HSA during a period of retroactive Medicare coverage has a standard fix available: withdrawing the excess contribution, along with any earnings it generated, before the tax filing deadline for that year. Done correctly and on time, the withdrawn amount is not subject to the additional 6% excise tax the IRS otherwise applies to excess HSA contributions left in the account past the deadline. Employers who continue making HSA contributions on an employee’s behalf without realizing that employee has already enrolled in Medicare are a common source of this problem, which is why coordinating the exact HSA-stop date with HR, rather than assuming payroll deductions end automatically, matters as much as the Medicare enrollment date itself.
How to keep contributing longer, legally
Workers who want to maximize HSA contributions before Medicare eligibility kicks in have one lever available: delaying Medicare enrollment itself, which is permitted without penalty for anyone still actively working and covered by a qualifying employer group health plan of a large enough employer. Because Part A eligibility begins at 65 automatically for people already collecting Social Security, someone who wants to keep contributing to an HSA past 65 generally needs to have not yet claimed Social Security retirement benefits, since claiming Social Security triggers automatic Part A enrollment. For a worker still years from retiring, that means the decision to delay claiming Social Security and the decision to keep funding an HSA are directly linked — one choice enables the other, and getting the sequencing wrong is what creates the retroactive-contribution problem in the first place.
This article was researched and drafted with the assistance of AI and reviewed by The Financial Wire editorial team.
More Financial Reading
- The ideal retirement withdrawal rate so your savings actually last
- Adding someone to your bank account: tax traps and smart moves



