Skip to main content

The Money Overview

Enroll in Medicare and you must stop funding a health savings account, or the IRS adds a tax penalty

A worker who keeps a job past 65 and stays on a high-deductible health plan often assumes the health savings account can keep filling up right through the transition to Medicare. It cannot. The moment a person is enrolled in any part of Medicare, they lose the right to make new HSA contributions, and money added after that point is treated by the IRS as an excess contribution subject to a 6 percent excise tax each year it stays in the account. The trap is sharpened by a backdated enrollment rule most people never see coming.

Why Medicare and an HSA cannot overlap

Health savings accounts are open only to people covered by a qualifying high-deductible health plan and, critically, not enrolled in other disqualifying coverage. Medicare counts as that other coverage. As the IRS lays out in its guidance on health savings accounts, an individual enrolled in Medicare is no longer an eligible individual and cannot contribute for any month that enrollment is in effect. That rule applies to enrollment in any part of the program, not just the medical coverage under Part B.

The distinction that catches people is between being eligible for Medicare and being enrolled in it. Turning 65 does not by itself end HSA eligibility; being signed up does. Someone who delays all parts of Medicare while still working under a qualifying employer plan can keep contributing. But once enrollment takes effect, whether elected voluntarily or triggered automatically, the account converts from an ongoing savings tool into a fund that can only be spent down.


Free retirement updates: Social Security and Medicare change every year, and nobody sends a memo. The free Retirement Shield newsletter breaks down what changed and what to do. Get it free in your inbox.

The six-month lookback that backdates the cutoff

The most damaging wrinkle involves Part A hospital coverage. When a person enrolls in Medicare after 65, Part A coverage is generally made retroactive for up to six months, though never earlier than the month they turned 65. That backdating is invisible in the moment, but it means HSA contributions made during those retroactive months are recharacterized as ineligible after the fact, even though they looked perfectly valid when the money went in.

The scenario plays out most often for someone who claims Social Security at or after 65. Because Social Security ties Medicare Part A enrollment to a benefit claim, filing for retirement benefits pulls Part A along with it, and the six-month lookback then reaches backward into a period the worker was still funding an HSA. A person planning to keep contributing needs to stop well before the enrollment date they expect, because the effective cutoff can sit half a year in the past.

Employer payroll systems add to the confusion. Contributions routed automatically from a paycheck, including any employer match, do not stop just because Medicare has taken effect, so the excess can accumulate quietly across several pay periods. The account holder, not the employer, is the one the IRS looks to when the excess and its penalty come due.

What the 6 percent penalty actually costs

An excess HSA contribution is not a one-time slap. The IRS imposes a 6 percent excise tax on the excess amount for each year it remains in the account, so an ignored overcontribution keeps generating a penalty until it is corrected. The fix is to withdraw the excess, along with any earnings attributable to it, before the tax-filing deadline for that year, which removes the excess from the penalty base going forward.

The enrollment date also reshapes how much a worker may legally set aside for that year. Annual HSA limits are prorated by the number of months a person qualifies as an eligible individual, so someone whose Medicare takes effect midyear can contribute only a fraction of the yearly maximum, counting roughly one-twelfth of the cap for each qualifying month. The extra catch-up amount that account holders 55 and older are allowed to add is prorated the same way. The IRS instructions for Form 8889, the form that reports HSA activity, walk through that month-by-month math, and contributing as though the full-year limit still applied is one of the most common ways an excess is created in the first place.

Getting the timing right in the first place avoids the cleanup entirely. Anyone approaching 65 who intends to keep working and contributing should confirm when their Medicare coverage will actually start, then halt HSA deposits at least six months before that date to stay clear of the retroactive Part A window. Coordinating the stop date with a payroll or benefits office prevents automatic contributions from slipping through after eligibility has ended.

None of this touches money already in the account. Existing HSA balances remain available tax-free for qualified medical expenses at any age, and after 65 they can even cover Medicare premiums for most parts of the program, which makes the account genuinely useful in retirement. The prohibition is narrow: it bars new contributions, not the spending of what has already been saved.

The larger point is that the penalty here rewards planning and punishes assumptions. A worker who treats the HSA as something that automatically winds down with Medicare, and who checks the retroactive start date before making a final contribution, keeps every dollar of the account’s tax advantage. One who lets contributions run on autopilot into an enrollment they did not map out turns a well-designed savings vehicle into a recurring tax bill.

This article was produced with AI assistance and reviewed by The Money Overview editorial team.

More Financial Reading