If you have spent years saving in a Health Savings Account (HSA) alongside a high-deductible health plan, it is natural to wonder what happens to that money once it is time to enroll in Medicare. The short answer is that the money remains yours, but the rules about when you can keep contributing, and a lesser-known retroactivity rule, can trigger a tax penalty if you do not know about them ahead of time. This guide explains exactly what happens, without invented figures or assumptions, so you can plan your Medicare application with more certainty.
Why Medicare and HSAs do not mix
To contribute to an HSA, the IRS requires that you be covered only by a qualifying high-deductible health plan (HDHP) and have no other non-high-deductible health coverage, including Medicare. The moment your Medicare coverage takes effect, whether Part A, Part B, or both, you no longer meet that eligibility requirement, and the IRS no longer allows you to make new contributions to your HSA starting that month, regardless of whether you also still have your high-deductible plan through work.
Availability, cost, benefits, and eligibility vary by person, product, contract, and insurance company, as well as by your service area. Guarantees are subject to the claims-paying ability of the issuing insurance company. Karla Arámburo is not affiliated with or endorsed by Medicare or the federal government.
Part A's 6-month retroactivity rule
This is where many people are caught off guard. If you file for Medicare (or for Social Security benefits) after turning 65, Medicare Part A can be applied retroactively up to 6 months before your application date, though never earlier than the month you turned 65. In other words, if you apply for Medicare at age 66, your Part A can be considered effective starting 6 months earlier, not from the day you filed the paperwork.
The problem is that if you kept contributing to your HSA during those 6 retroactive months, those contributions count as excess, because in hindsight you were no longer HSA-eligible during that period. That is why the IRS and most advisors recommend stopping HSA contributions at least 6 months before the date you plan to apply for Medicare (or Social Security), or 6 months before turning 65 if you plan to enroll right at that point, whichever is later.
How to use the funds already in your HSA
Once enrolled in Medicare, you can still use the balance already saved in your HSA tax-free, with no deadline, for qualified medical expenses. This includes Medicare deductibles, copays, and coinsurance, as well as premiums for Part B, Part D, and a Medicare Advantage plan. One important exception: the IRS generally does not treat Medigap (Medicare supplement) premiums as a qualified expense, so that particular cost typically cannot be paid from HSA funds without triggering tax.
If you withdraw HSA funds for a non-qualified expense, that withdrawal is added to your taxable income and, if you are under 65, an additional penalty also applies. After age 65, that additional penalty no longer applies, but a non-qualified withdrawal is still subject to ordinary income tax.
What happens if you keep contributing by mistake
Any contribution made to an HSA during a month when you were no longer eligible, including months covered retroactively by Part A, counts as an excess contribution. The IRS applies a special 6% excise tax each year on the excess amount that remains in the account uncorrected. The way to fix it is to withdraw the excess, along with any related earnings, before that year's tax filing deadline, which generally prevents the 6% tax from compounding in later years.
If you are still working past 65
If you continue working past age 65 and your employer offers HDHP-qualifying health coverage, you can delay Medicare enrollment without penalty and keep contributing to your HSA, as long as you have not enrolled in any part of Medicare and have not started collecting Social Security benefits, since collecting Social Security automatically enrolls you in Part A. This generally applies when your employer is considered a 'large group' employer, typically 20 or more employees, which keeps your employer coverage primary over Medicare. Our guide to turning 65 while still working explains in detail when it makes sense to delay Part B, and our Medicare Part B guide covers the costs and enrollment rules in more detail.
I work with families across Southern California, including San Diego and Riverside, who are still working past 65 and want to correctly coordinate their employer coverage, their HSA, and their future Medicare enrollment, without having to guess at the rules on their own.
Free bilingual help planning your enrollment date
I am Karla Arámburo, an independent, bilingual insurance agent licensed in California. I review your 65th birthday, your current work situation, and your Medicare or Social Security application timeline with you, to help identify the date it makes sense to stop contributing to your HSA, in Spanish or English, at no cost to you. To confirm the specific tax details of your situation, I always recommend also consulting your accountant or tax preparer.
You can call or text (619) 321-8733 or schedule a free consultation. This page is general education, not tax advice or individualized guidance.
Frequently asked questions
Does my HSA close when I enroll in Medicare?
No. The account remains yours for life, and the money already in it does not disappear or have to be spent by a deadline. The only thing that changes is that once you are enrolled in any part of Medicare, you can no longer make new contributions to that account.
Why should I stop contributing 6 months early if I have not enrolled in Medicare yet?
Because if you file for Medicare (or for Social Security) after turning 65, Part A can be applied retroactively up to 6 months before your application, though never earlier than the month you turned 65. If you kept contributing to your HSA during those retroactive months, those contributions count as excess, because you were technically no longer HSA-eligible during that period.
Can I still use the money already in my HSA after enrolling in Medicare?
Yes, with no time limit. You can use your existing HSA funds tax-free for qualified medical expenses at any point, even years after enrolling in Medicare, as long as the expense qualifies under IRS rules.
Can I pay my Medigap premium with my HSA?
Generally not. The IRS specifically excludes Medigap (Medicare supplement) premiums from qualified medical expenses payable with HSA funds, unlike Part B, Part D, and Medicare Advantage premiums, which do qualify. It is an important distinction many people are not aware of.
What happens if I mistakenly keep contributing after enrolling in Medicare?
The IRS treats those contributions as an 'excess contribution' and applies a special 6% excise tax each year on the excess amount that remains in the account uncorrected. It is important to withdraw the excess, along with related earnings, before your tax filing deadline to avoid the tax compounding in later years.
I am still working past 65. Can I avoid Medicare and keep contributing to my HSA?
In many cases, yes, as long as you have not enrolled in any part of Medicare and have not started collecting Social Security benefits (collecting Social Security automatically enrolls you in Part A). If your employer coverage qualifies as 'large employer' coverage (generally 20 or more employees), you can generally delay Medicare without penalty while still working and keep contributing to your HSA. If your employer has fewer than 20 employees, the rules change and it is worth reviewing carefully before deciding.
Can you help me calculate the exact date I should stop contributing?
Yes. I review your 65th birthday, your Medicare or Social Security application timeline, and your current work situation with you, to help identify the date it makes sense to stop contributing to your HSA and avoid an excess contribution, at no cost to you. For specific tax matters, I always recommend confirming the details with your accountant or tax preparer.
