You cannot open a new HSA once you are on Medicare, but you may keep one you already have

The moment you enroll in any part of Medicare — Part A, Part B, or Part D — you become ineligible to contribute new money to a Health Savings Account. This is a hard rule set by the IRS. If you try to make contributions after Medicare enrollment, the IRS will tax you on that money twice: once as income tax and again as a 20 percent penalty.

However, if you already owned an HSA before you turned 65 or enrolled in Medicare, you can keep that account open. You straightforward cannot add money to it. You can withdraw money from it for any reason without penalty once you turn 65, though non-medical withdrawals will be taxed as ordinary income. Medical withdrawals remain tax-free at any age.

The timing matters. If you are still working and covered by a high-deductible health plan (HDHP) through your employer, you can contribute to an HSA right up until the month you enroll in Medicare Part A or Part B. After that month, contributions stop.

Key Takeaways

  • You cannot contribute to an HSA once you enroll in any part of Medicare, and the IRS penalizes contributions made after enrollment.
  • An HSA you opened before Medicare can stay open, and you can withdraw from it for medical expenses tax-free at any age.
  • After age 65, you can withdraw HSA money for any reason without the 20 percent penalty, though non-medical withdrawals are taxed as income.
  • If you are working past 65 and still on an employer health plan instead of Medicare, you may continue HSA contributions as long as that plan qualifies as an HDHP.

Why Medicare and HSAs do not work together

Medicare is a government insurance program. An HSA is designed to work with private high-deductible health plans. The IRS treats enrollment in Medicare as the moment you stop needing an HSA because you now have government coverage. The agency does not allow you to hold both simultaneously for contribution purposes.

This creates a real problem for people who want to delay Medicare enrollment while still working. If you are 65 or older and your employer offers both an HDHP and Medicare, you face a choice: enroll in Medicare and lose HSA contributions, or decline Medicare and keep contributing to your HSA. Declining Medicare can trigger a lifetime penalty on your Part B premiums if you enroll later, so this is not a straightforward decision.

What happens to money already in your HSA

An HSA you funded before Medicare is yours to keep. The account does not close, and the money does not disappear. You own it the same way you own a savings account.

Once you turn 65, the rules change. Before 65, if you withdraw HSA money for anything other than may have access to medical expenses, you pay income tax plus a 20 percent penalty. After 65, the 20 percent penalty goes away. Non-medical withdrawals are still taxed as income, but there is no extra penalty. This makes an HSA function like a traditional IRA after 65 — you can use it for anything, you just pay tax on non-medical withdrawals.

Medical withdrawals remain tax-free and penalty-free at any age, including after you turn 65 and enroll in Medicare. may have access to medical expenses include Medicare premiums (Part B, Part D, and Medigap), deductibles, copays, and coinsurance. They do not include Medicare Advantage premiums in most cases, though this varies by plan type.

The timing trap: when you must stop contributing

The IRS counts enrollment in Medicare as starting the month you sign up, not the month coverage begins. If you enroll in Part A in March but coverage does not start until April, you cannot contribute to an HSA for March. This matters because some people try to make a final contribution before Medicare kicks in and accidentally violate the rule.

If you are still working and your employer offers an HDHP, you can contribute to an HSA through the last day of the month before you enroll in Medicare. After that, contributions are prohibited. Some employers will catch this and refuse the contribution. Others will not, and you will discover the problem when you file taxes and the IRS flags it.

Delaying Medicare to keep HSA contributions

If you are working past 65 and your employer health plan is an HDHP, you have the option to decline Medicare and continue HSA contributions. This is legal, but it comes with a cost: if you enroll in Part B later, you will pay a 10 percent higher premium for each year you delayed enrollment after turning 65. This penalty is permanent and applies for the rest of your life.

The math depends on how long you delay and how much you value HSA contributions. If you plan to work for only two more years and contribute $4,150 per year to an HSA (the 2024 individual limit), you gain $8,300 in tax-advantaged savings. A two-year delay on Part B costs roughly 20 percent extra on your Part B premium forever. For most people, the lifetime cost of the penalty exceeds the value of two years of HSA contributions, but your situation may differ.

There is one exception: if your employer has 20 or more employees, you may be able to delay Part B without penalty under the working aged exception. This requires that you are still actively employed and covered under your employer's group health plan. You must notify Social Security that you are using this exception, or the penalty will explore anyway.

Using your HSA to pay Medicare costs

Once you are on Medicare, your HSA becomes a source of tax-information programs for Medicare-related expenses. You can use it to pay Part B and Part D premiums directly. You can use it for deductibles, copays, and coinsurance under any Medicare plan. You can use it for Medigap premiums, which cover gaps in Original Medicare.

You cannot use HSA money to pay Medicare Advantage premiums in most cases. Medicare Advantage is Part C, a private alternative to Original Medicare, and the IRS does not classify those premiums as may have access to medical expenses. There are narrow exceptions for certain types of Medicare Advantage plans, but the default rule is no.

If you have prescriptions, you can use HSA money to pay for drugs covered under Part D. If you use your HSA to pay a Part D premium, that payment does not count toward your out-of-pocket spending limit, so it does not help you reach the catastrophic coverage phase faster.

Frequently Asked Questions

What happens if I contribute to an HSA after enrolling in Medicare by mistake?

The IRS will assess income tax and a 20 percent penalty on the contribution when you file your tax return. You can request a correction from your HSA provider, which may allow you to withdraw the money without penalty, but you will still owe income tax on it. Report the error to your HSA provider when ready.

Can I use my HSA to pay for long-term care or nursing home costs?

Yes, if those costs are for medical care. Nursing home care is a may have access to medical expense. Long-term care insurance premiums are also may have access to, up to certain age-based limits set by the IRS. Custodial care or non-medical information is not covered.

If I am still working at 65, do I have to enroll in Medicare?

Not if your employer has 20 or more employees and you are covered under the employer's group health plan. You can delay Part B without penalty under the working aged exception. You must still enroll in Part A at 65 unless you use this exception, and Part A enrollment will stop HSA contributions.

Can my spouse use my HSA if they are on Medicare?

Only if they are the account owner or a designated beneficiary. If you are the sole owner and your spouse is on Medicare, they cannot withdraw from your HSA. If you name them as a beneficiary in your will, they inherit the account after your death, but they cannot access it while you are alive unless you add them as an owner.

What if I enroll in Medicare Part D but not Part B — can I still contribute to an HSA?

No. Enrollment in any part of Medicare — Part A, Part B, or Part D — stops HSA contributions. Part D is prescription drug coverage, and the IRS treats it the same as Part A or Part B for HSA purposes.