Health savings accounts are among the most tax-advantaged tools available for retirement, offering a deduction going in, tax-free growth, and tax-free withdrawals for medical costs. But there is a hard line built into the rules that catches many older workers off guard. The moment a person enrolls in Medicare, the door to putting new money into an HSA closes. For the growing number of Americans still on the job past 65, that overlap can turn a routine sign-up into an expensive tax mistake.
The eligibility rule that Medicare breaks
An HSA is not something a person can fund at will. To contribute, someone must be covered by a qualifying high-deductible health plan and, just as importantly, must have no other disqualifying health coverage. Medicare is disqualifying coverage. As the IRS spells out in Publication 969, once an individual is enrolled in any part of Medicare, they can no longer make contributions to a health savings account. This applies to Medicare in any form, including Part A alone, even for a worker who keeps a high-deductible plan through an employer and pays nothing extra for that Part A coverage.
The account itself does not vanish. A person can still spend the money already in an HSA on qualified medical expenses, tax-free, for the rest of their life, and that includes using it to pay Medicare premiums and out-of-pocket costs. What ends is the ability to add new money. The distinction between spending an existing balance, which remains allowed, and contributing fresh dollars, which does not, is the crux of the rule.
Free retirement updates: One number can cost or save hundreds a month in retirement. The free Retirement Shield newsletter surfaces the ones worth knowing. Sign up free.
Why the six-month rule is the hidden trap
The sharpest edge of this rule is timing, and it is where working retirees most often stumble. When someone enrolls in Medicare after age 65, their Part A coverage does not simply start on the enrollment date. It is generally backdated up to six months, though never earlier than the month they turned 65. That retroactive start date is what causes trouble, because it can reach back into months during which the person was still contributing to an HSA under the assumption they were eligible.
The result is that contributions made during those retroactive months become excess contributions after the fact, even though they looked perfectly proper when they were made. This most commonly surprises people who claim Social Security, since starting Social Security at or after 65 automatically enrolls a person in Medicare Part A. A worker who files for benefits, or who signs up for Part A near their 65th birthday, may not realize they have simultaneously ended their HSA eligibility, and possibly clawed it back into recent months.
What an excess contribution costs
Money put into an HSA after eligibility ends is treated as an excess contribution, and the IRS does not ignore it. Excess amounts left in the account are generally subject to an excise tax that applies for each year the money stays there, on top of losing the tax deduction that was the whole point of the contribution. The fix is to withdraw the excess contributions, along with any earnings on them, before the tax-filing deadline for that year, which avoids the penalty but still unwinds the intended benefit. Publication 969 describes how excess contributions and their removal are handled, and the correction is far easier to make when caught early than after several years have compounded.
For a person planning to keep working and contributing past 65, the safest approach is to stop HSA contributions several months before Medicare enrollment begins, accounting for that potential six-month retroactive reach. Someone who intends to delay Medicare entirely to keep funding an HSA must also delay Social Security, because the two are linked, and must confirm their employer coverage genuinely allows deferring Medicare without penalty.
What a spouse can still do
The rule shuts off contributions for the person on Medicare, but it does not necessarily freeze a couple entirely. Because a health savings account belongs to one individual, a spouse who is not yet on Medicare and who remains covered by a qualifying family high-deductible plan can generally keep contributing to an account in their own name. The catch is ownership: the still-eligible spouse must be the account holder, because the right to contribute follows the person who qualifies, not the household. A couple moving through this transition can sometimes preserve part of the tax benefit by routing continued contributions through the spouse who is still eligible, provided the family coverage and that spouse’s own status meet the requirements. Catch-up contributions, which the rules allow for account holders past a certain age, likewise have to be made to each spouse’s own account rather than combined into one, so a couple that wants to capture both must maintain separate accounts. The specifics depend on the plan, but the broad point is that one partner enrolling in Medicare does not always mean the household loses every avenue to keep saving in this way.
Planning the handoff before 65
The decision is rarely all bad news; it is a tradeoff that rewards planning. The value of continued HSA contributions has to be weighed against the reasons a person might want Medicare sooner, and against the rules of their specific employer plan. Workers at smaller companies, in particular, may find their employer coverage requires them to take Medicare at 65 regardless, which forecloses the choice. Those at larger employers with qualifying coverage may have real room to delay and keep contributing. The one universal lesson is that Medicare enrollment and HSA contributions cannot coexist, so anyone approaching 65 while still funding an account should map the transition deliberately, confirm how the six-month backdating applies to their own timeline, and stop contributing in time to keep a generous tax benefit from turning into a penalty.
This article was researched and drafted with the assistance of AI and reviewed by The Financial Wire editorial team.
More Financial Reading
- Adding someone to your bank account: tax traps and smart moves
- Bank statements: how long to keep them and when to toss them



