August 21, 2026

Medicare and HSA Contributions

A person who works past 65 and keeps contributing to a health savings account is doing something that feels responsible and is often exactly right, until a single Medicare rule turns those contributions into a tax problem.


A person who works past 65 and keeps contributing to a health savings account is doing something that feels responsible and is often exactly right, until a single Medicare rule turns those contributions into a tax problem. Enrolling in Medicare ends the ability to contribute to an HSA, which most people eventually learn. What almost no one anticipates is that Medicare can reach backward in time, retroactively ending HSA eligibility for months a person already contributed in good faith. Understanding how Medicare and HSA contributions collide, and especially how the retroactive start date works, is what prevents a diligent saver from owing a penalty on money they thought was allowed.


Start with the base rule, because it is absolute. To contribute to an HSA, a person must be covered by a high deductible health plan and have no other disqualifying coverage. Medicare is disqualifying coverage. The moment a person is enrolled in any part of Medicare, including premium-free Part A, their HSA contribution eligibility ends. Because HSA eligibility is generally determined as of the first day of each month, the first full month a person is enrolled in Medicare is a month with no HSA eligibility at all. Once Medicare is in effect, the ability to put new money into an HSA is gone. It does not matter that Part A is free, or that the person is only on Part A and nothing else. Any Medicare enrollment closes the contribution door.

What Medicare does not do is touch the money already in the account. The existing HSA balance remains fully available. A person on Medicare can still spend their HSA tax-free on qualified medical expenses, and after 65 that includes paying Medicare Part B, Part D, and Medicare Advantage premiums, though notably not Medigap premiums. So the account keeps working as a spending tool for the rest of a person’s life. Medicare ends the right to add new money, not the right to use what is there.

Now the part that catches people, and it is the reason this deserves careful attention. When a person enrolls in Medicare after age 65, premium-free Part A is backdated. The coverage start date is set retroactively up to six months before the application, though never earlier than the month the person turned 65. This retroactive start is automatic. A person does not choose it or waive it. And because HSA eligibility ends when Medicare coverage begins, that backdated start date retroactively ends HSA eligibility for the affected months. Contributions the person made during the backdated window, when they believed they were still eligible, become excess contributions after the fact.

This is where the damage happens, because those retroactive months often contain real contributions. Consider someone who turns 65 while working, delays Medicare, and keeps contributing to their HSA through payroll. A year or two later they apply for Medicare. Part A is backdated six months, and the HSA contributions attributable to the months that backdated coverage now covers, including their own deposits, any employer contributions, and payroll deferrals, become excess contributions. Excess HSA contributions carry a six percent excise tax. The person did nothing careless. They simply did not know that the act of enrolling would reach backward and disqualify contributions that were perfectly valid when made.

Social Security is the trigger that catches the most people by surprise here, because it forces Medicare without a separate decision. A person who claims Social Security at or after 65 is automatically enrolled in premium-free Part A and cannot decline it while receiving benefits. So claiming Social Security is, in effect, enrolling in Part A, which ends HSA eligibility, and the same six-month backdating applies. Someone who wanted to keep contributing to an HSA while working past 65 has to delay not only Medicare but Social Security as well, because starting Social Security pulls Part A along with it automatically.

The defense against the retroactive problem is a timing rule that follows directly from the six-month backdating. A person who plans to enroll in Medicare or claim Social Security after 65 should stop all HSA contributions at least six months before they apply. Stopping six months ahead ensures that the backdated Part A start date, which can reach back six months, does not overlap with any month in which a contribution was made. This applies to employer contributions and payroll deferrals too, not just personal deposits, so a person needs to tell their employer or payroll department to stop, not only adjust their own deposits. The single last-minute contribution a person tries to squeeze in before enrolling is often the one that lands inside the backdated window.

The year a person becomes eligible for only part of the year brings a proration rule. In the year HSA eligibility ends because of Medicare, the contribution limit is not the full annual amount. It is prorated based on the number of months the person was HSA-eligible, counted by their coverage status on the first day of each month. The calculation is the annual limit, including any catch-up amount for those 55 and older, divided by twelve, multiplied by the number of eligible months. Because the first-of-the-month test controls, the month Medicare coverage takes effect is generally the first non-eligible month. So a person whose Part A coverage begins, even retroactively, on July 1 was HSA-eligible for the first six months of the year, January through June, and can contribute half the annual limit for that year. Contributing more than the prorated amount produces an excess. There is also a separate last-month rule that can allow a full year’s contribution for someone eligible on the first day of the last month of the year, but it carries its own testing-period requirement, and it does not rescue a person whose eligibility has ended because of Medicare by year end.

If a person discovers they have over-contributed, there is a correction, and the timing of it matters. Withdrawing the excess contribution, plus any earnings it generated, by the tax filing deadline including extensions generally avoids the six percent excise tax for that year. The withdrawn earnings are taxable in the year the excess was contributed, so the custodian should process it specifically as a return of excess contribution rather than an ordinary distribution. Missing that deadline starts the six percent clock. That excise tax is applied each year the excess remains, calculated as six percent of the excess or of the account’s value at year end, whichever is less. Ordinarily an excess in one year could be absorbed by contributing less in a future eligible year, but once a person is on Medicare there is no future HSA contribution room to absorb it, so withdrawing the excess is generally the only way to stop the penalty.

One point of relief applies to couples, though it has its own condition. HSA eligibility is individual. If one spouse enrolls in Medicare but the other is younger, not yet on Medicare, and personally covered by a qualifying high deductible health plan, that younger spouse can continue contributing to their own HSA under their own eligibility. Their ability to use the family contribution limit depends on their own qualifying coverage, not on the Medicare-enrolled spouse, and the catch-up contribution for someone 55 or older must go into that person’s own HSA. So the still-eligible spouse contributes under their own coverage, unaffected by the older spouse’s Medicare enrollment, as long as their own high deductible coverage continues.


Picture someone who turns 65 in January, keeps working with employer coverage, delays Medicare, and continues contributing to their HSA through payroll the whole time. Two years later, in a later year, they decide to retire and apply for Medicare in, say, October. Their premium-free Part A is backdated six months, to April of that year. The HSA contributions attributable to the months from April onward, personal and employer and payroll alike, fall inside the retroactive Medicare window and become excess contributions. They thought they were contributing legally right up until they enrolled, and in a sense they were, until the backdating rewrote their eligibility. They now have to withdraw those excess contributions and the earnings on them before their tax deadline to avoid the six percent penalty, or pay that penalty as it applies each year the excess sits.

Now picture the same person planning ahead. Knowing they intend to apply for Medicare in October, they stop all HSA contributions, and tell payroll to stop the employer contributions, six months earlier, in April. Because the backdating can reach back only six months, and they stopped six months before applying, there is no month in which they both contributed and were retroactively covered. Their contributions for that year are prorated to the months they were eligible, and none of them become excess. The same enrollment that created a penalty in the first version creates none in the second, purely because they accounted for the six-month reach before it happened.


The resolution is understanding that Medicare and HSA contributions cannot coexist, and that Medicare’s start date can move backward in a way that retroactively ends eligibility. Enrolling in any part of Medicare ends HSA contributions going forward, and the retroactive Part A start date, up to six months back, can turn already-made contributions into excess ones. Claiming Social Security at 65 or later forces Part A and the same backdating. The account can still be spent down tax-free, but new contributions stop.

The variables that determine whether a person has a problem are when they enroll in Medicare or claim Social Security relative to 65, whether they were contributing during the six months before that application, whether they remembered to stop employer and payroll contributions and not just their own, and whether they prorated their contribution for the partial year of eligibility. The defensive rule that prevents nearly all of this is stopping contributions six months before applying, which covers the entire backdating window. For a couple, the younger spouse’s own eligibility continues independently as long as their own qualifying coverage does. The account remains a lasting tool for paying medical costs and most Medicare premiums, but the contribution side ends when Medicare begins, and Medicare can begin further back in time than a person expects.

I write one of these every day, one retirement rule, explained in plain language and verified against the source. The daily email is free: subscribe here.


Full archive, worksheets, and search live at RetirementNewsRundown.com.


Disclaimer

This article is for educational and informational purposes only. It is not tax, legal, or financial advice and does not create an advisor–client relationship. Always consult appropriate professionals regarding your specific situation.

Frequently Asked Questions

Can I keep contributing to my HSA after I turn 65 and enroll in Medicare?

No. Once you enroll in Medicare, you are no longer eligible to contribute to an HSA because Medicare is considered disqualifying coverage. You must stop making contributions immediately upon enrollment to avoid tax penalties.

What happens if I contributed to my HSA before I knew Medicare ended my eligibility?

Medicare can retroactively end your HSA eligibility, meaning contributions you made in good faith before enrolling may be considered ineligible. This can result in taxes and penalties on those earlier contributions, even though you didn't realize they were problematic at the time.

How far back can Medicare retroactively end my HSA eligibility?

The article indicates that Medicare has a retroactive start date that can reach backward in time, potentially covering months you already contributed. The exact timeframe depends on your specific enrollment date, so it's important to understand how this applies to your situation.

What's the key difference between having an HSA and having other health coverage?

To contribute to an HSA, you must be covered by a high deductible health plan and have no other disqualifying coverage. Medicare counts as disqualifying coverage, which is why enrollment in Medicare immediately stops your ability to contribute.

Take this further

All-Access
Get the tools that go with the rules.
All-Access includes every retirement planning and correction tool on the site. $149/year or $19/month.
→
Read the full guide
Browse all retirement guides
→

Get the retirement rule mistakes most people learn too late

Everyday-language breakdowns of IRS rules, contribution limits, and the deadlines that cost people money. Daily. Free.

←
How Roth Conversions Interact With IRMAA
→
Knowledge Blast: How to Correct an Excess SEP Contribution for the Self-Employed