Medicare and HSA: What Happens When You Turn 65
A Health Savings Account (HSA) is one of the most powerful financial tools available to American workers. The ability to contribute pre-tax dollars, grow investments tax-free, and withdraw funds tax-free for qualified medical expenses is a combination you will not find anywhere else.
But when you approach Medicare eligibility, the rules change, and the consequences of getting it wrong can be costly.
This guide explains exactly how Medicare and HSA rules interact, what you can and cannot do once you enroll, and how to avoid one of the most common, and most expensive, Medicare mistakes people make. If you are still weighing when to enroll, our guide on whether you have to sign up for Medicare at 65 if you are still working is a good place to start.
The Core Rule: Medicare and HSA Contributions Do Not Mix
Once you are enrolled in any part of Medicare, you can no longer contribute to a Health Savings Account.
This is an IRS rule, not a Medicare rule. HSAs require you to be covered by a High Deductible Health Plan (HDHP) and have no other “disqualifying” health coverage. Medicare, even just Part A, counts as disqualifying coverage.
The moment your Medicare coverage begins, your ability to make new HSA contributions ends.
The Part A Backdating Problem
Here is where it gets complicated, and where many people unknowingly make expensive mistakes.
When you enroll in Medicare Part A after turning 65, Social Security can backdate your Part A coverage up to 6 months.
Here is how it works:
If you apply for Social Security retirement benefits and you are already 65 or older, Medicare Part A will be effective retroactively up to 6 months before your application date. This is automatic. You do not get to opt out of the retroactive coverage.
Why This Causes a Problem
Suppose you turn 65 in January and you keep working and contributing to your HSA. You apply for Social Security at age 66 in July. Social Security backdates your Part A coverage to January, six months earlier.
Now you have a problem. You were contributing to your HSA during a period when, in hindsight, you had Medicare coverage. Those contributions are now excess HSA contributions, and the IRS will assess taxes and a 6% excise Penalty on them.
This catches many people completely off guard. For more on the timing decisions that lead to situations like this, see our guide on common Medicare mistakes people make when working past 65.
How to Protect Your HSA: The 6-Month Rule
If you plan to apply for Social Security benefits at or after age 65, you should stop contributing to your HSA at least 6 months before your Social Security application date.
This protects you from the backdating problem.
Example:
You plan to apply for Social Security at age 66 in October. To be safe, stop HSA contributions no later than April of that year, six months before your application.
This is conservative but safe. If Social Security backdates your Part A to April, you will have zero excess contributions to worry about.
When Medicare Starts: Key Timelines
Understanding when your Medicare coverage actually begins helps you plan your last HSA contribution. For a full breakdown of enrollment timing, see our guide on when to sign up for Medicare benefits.
If You Take Social Security Before 65
If you are already receiving Social Security benefits when you turn 65, you will be automatically enrolled in Medicare Parts A and B. Your coverage begins the first day of the month you turn 65 (or July 1 if your birthday is June 1).
In this case, you must stop HSA contributions the month before your Medicare effective date.
If You Delay Social Security Until After 65
If you are not collecting Social Security at 65 and do not enroll in Medicare voluntarily, your Medicare does not begin automatically. You can continue contributing to your HSA.
However, when you eventually apply for Social Security, the Part A backdating rule applies. This is the scenario most likely to catch people off guard.
If You Voluntarily Enroll in Medicare at 65
If you sign up for Medicare Part A and Part B at 65 without taking Social Security, your coverage begins based on your enrollment timing (generally the first of the month you turn 65, if you enroll in the three months before your birthday).
Your HSA contributions must stop as of that effective date.
What Can You Still Do With Your HSA After Enrolling in Medicare?
Enrolling in Medicare does not make your existing HSA balance disappear. You simply cannot make new contributions. Here is what you can still do:
Use your balance for qualified medical expenses. You can continue to withdraw funds tax-free for Medicare premiums (except Medigap premiums), deductibles, copays, dental, vision, hearing, and many other qualified expenses.
Use it to pay Medicare premiums. HSA funds can be used tax-free to pay:
- Medicare Part A premiums (if applicable)
- Medicare Part B premiums
- Medicare Advantage (Part C) premiums
- Medicare Part D premiums
You cannot use HSA funds for Medigap premiums. This is an important exception. Medicare Supplement (Medigap) premiums are not considered qualified HSA expenses. For related questions about how Medicare costs interact with your taxes, see our guide on whether Medicare premiums are tax deductible.
Invest and let the balance grow. Your existing HSA funds can remain invested and continue growing tax-free. You are not required to spend them down.
Use for non-medical expenses at 65. After age 65, you can withdraw HSA funds for any purpose without penalty. You will pay ordinary income tax on non-medical withdrawals, similar to a traditional IRA, but there is no additional penalty.
The Interaction Between HSA and High Deductible Health Plans
Some people near 65 are still on an employer’s High Deductible Health Plan and contributing heavily to their HSA while delaying Medicare enrollment.
This is a legitimate strategy for people who have active employer coverage and want to maximize tax-advantaged savings before Medicare begins. It works, as long as you:
- Do not enroll in Medicare while still covered by the HDHP
- Plan your Medicare enrollment timing carefully to avoid the backdating trap
- Stop contributions the month before your Medicare effective date (or 6 months before applying for Social Security if you will be 65 or older when you apply)
This strategy requires coordination. A mistake in timing can result in a tax penalty that wipes out much of the benefit.
What About My Spouse’s HSA?
If your spouse has their own HSA, your Medicare enrollment does not affect their ability to contribute. They can continue contributing as long as they:
- Are covered by a qualifying HDHP
- Are not enrolled in Medicare themselves
- Do not have other disqualifying coverage
However, once they enroll in Medicare, their contributions must stop as well.
A Practical Checklist for HSA and Medicare Coordination
Use this checklist as you approach Medicare enrollment:
- [ ] Determine when you plan to apply for Social Security benefits
- [ ] If applying at or after age 65, stop HSA contributions 6 months before your Social Security application date
- [ ] Confirm your Medicare Part A effective date
- [ ] Stop HSA contributions as of the month before your Medicare effective date
- [ ] Review your HSA balance and decide how you will use it in retirement
- [ ] Note that HSA funds can cover most Medicare premiums but NOT Medigap premiums
- [ ] Consult a tax advisor if you have questions about excess contributions or penalties
Frequently Asked Questions
Can I keep my HSA account after enrolling in Medicare?
Yes. Your account remains open. You just cannot make new contributions. The balance stays in your account, continues to earn or grow, and can be used for qualified medical expenses or other purposes after 65.
What happens if I accidentally contribute to my HSA after enrolling in Medicare?
You have made an excess contribution. You can withdraw it (plus any earnings) by the tax filing deadline to avoid the 6% excise penalty. If you catch it in time, the fix is straightforward. If you miss the deadline, you pay the penalty every year the excess remains in the account.
I enrolled in Medicare Part A but declined Part B. Can I still contribute to an HSA?
No. Even Part A alone, with no Part B, disqualifies you from making HSA contributions. All Medicare coverage is disqualifying coverage under IRS rules.
My employer coverage is primary. Can I still have an HSA if I am also enrolled in Medicare?
No. Having Medicare in addition to your employer plan still disqualifies you from HSA contributions, even if your employer coverage is primary.
Can I use my HSA to pay for my Medigap plan?
No. The IRS specifically excludes Medigap premiums from the list of qualified HSA expenses. You can use your HSA for most Medicare premiums, but not Medigap.
Bottom Line
The intersection of HSAs and Medicare is one of the most misunderstood areas in retirement planning. The backdating rule in particular catches many people off guard, and the resulting tax penalties are avoidable with proper planning.
The key rules:
- Stop HSA contributions when Medicare begins
- Stop at least 6 months before applying for Social Security if you will be 65 or older at application
- Your existing balance is yours to keep and use, just not for Medigap premiums
If you are approaching Medicare eligibility and want to make sure your timing is right, REMEDIGAP’s licensed advisors can help you think through your enrollment strategy at no cost.
This article is for educational purposes only and does not constitute tax or legal advice. Consult a tax advisor for guidance on your specific situation. HSA rules are governed by IRS Publication 969.
💡 Your next step: Your Medicare enrollment window is the best time to get Medigap — no medical Underwriting required. Compare Medicare Supplement plans before your window closes.
Related Articles
Written by Michael Quinn
Licensed Broker, REMEDIGAP Founder
Fact Checked by Joann Quinn
Chief Compliance Officer
As a licensed insurance broker, REMEDIGAP upholds the principles of integrity in our editorial standards and ensures transparency in how we receive compensation from our insurance partners.

