Estimate Time4 min

HSAs and Medicare: Diagnose the possible pitfalls

Key takeaways

  • It's important to understand the implications of Medicare enrollment for future HSA contributions. You could be subject to tax penalties if you make health savings account (HSA) contributions after you enroll in Medicare or when your Medicare coverage begins.
  • When you enroll in any form of Medicare, neither you nor your employer should continue contributing to your HSA.
  • If you enroll in Medicare after turning 65, your coverage can become effective up to 6 months earlier. You and your employer will need to end your HSA contributions up to 6 months before enrolling in Medicare since Medicare back dates your Part A coverage from the date you enroll.

If you're age 60+, you probably have figured out how to use your health savings account (HSA) to help pay for qualified medical expenses—and even save something extra for unanticipated health care expenses you may soon be facing in retirement.

But watch out: There are a few important rules to follow if you want to avoid being subject to stern financial penalties when you enroll in Medicare in a few short years.

Like many things in health care, it's a bit complicated. So it's vitally important that you know when to stop contributing to your HSA along with when you can and cannot use HSA dollars to pay for medical expenses—before, during, and after you enroll in Medicare at age 65.

To get started, let's recap what HSAs offer.

Paying for medical expenses with an HSA—tax-free

HSAs work with HSA-eligible health plans to allow you to pay for qualified medical expenses. HSAs offer triple tax savings1:

  1. You can contribute pre-tax dollars.
  2. You pay no taxes on earnings.
  3. You can withdraw the money tax-free now or in retirement to pay for qualified medical expenses.

You can use your HSA to pay for qualified medical expenses each year and let any leftover funds in the HSA grow for use in the future, including in retirement.2 You can use your HSA to pay for qualified medical expenses in retirement, such as vision and dental care, hearing aids, and nursing services. You can also use your HSA to:

1. Help bridge the gap to Medicare

If you retired before age 65, you still need health care coverage before enrolling in Medicare. You can use your HSA to pay for insurance premiums that cover medical care as long as you did not receive a credit for the premiums you are paying. Premiums ineligible for reimbursement would include those deducted from a paycheck pre-tax, included as itemized medical expenses, or subsidized by the premium tax credit. For example, if gross premiums for a public marketplace plan are $15,000 and net premiums are $5,000, the $5,000 in net premiums can be reimbursed from the HSA, but the $10,000 already covered by the premium tax credit subsidy cannot be reimbursed. Additionally, you can use HSA funds for health coverage purchased through an employer sponsored plan under COBRA. You can also use your HSA to pay health insurance premiums while receiving unemployment compensation. If permissible, paying for insurance premiums from your HSA could be helpful if you lose your job or decide to stop working before turning 65.

Tip: Use our Health Insurance Before Medicare Planner to see what options may be available to you.

2. Cover Medicare premiums

You can use your HSA to pay certain Medicare expenses, including premiums for Part A, Part B, Part C (Medicare Advantage), and Part D prescription drug coverage, but not supplemental (Medigap) policy premiums. Retirees over age 65 who have employer-sponsored health coverage can use their HSA to pay their share of those costs as well.

3. Pay for other expenses

Once you turn age 65, you can use your HSA to pay for any nonqualified medical expenses like buying a boat or new patio furniture, but you don't get to take full advantage of the tax savings; you're required to pay state and federal taxes for such expenditures. (If you're not age 65 or older, you will pay a 20% penalty on nonmedical withdrawals, and you'll also pay taxes for such withdrawals.)

Avoiding the pitfalls

HSA eligibility rules state you can't contribute or receive contributions from your employer to your HSA when enrolled in any part of Medicare. Otherwise, you could be subject to tax penalties.

If you're currently contributing to your HSA and you plan to start your Medicare coverage the month you turn 65:

  • Make sure all HSA contributions end before your 65th birthday month.
  • If your birthday is on the first of the month, make sure you stop your contributions by the beginning of the month before your birthday month.

If you continue to work after age 65 and you or your employer is still contributing to an HSA:

  • Stop making contributions to your HSA up to 6 months before applying for Medicare Part A only or Part A and Part B or starting your Social Security retirement benefits.
  • When you receive Social Security retirement benefits, your Part A coverage is back-dated 6 months (but no earlier than the first month you're eligible for Medicare) to give you 6 months of back-dated benefits. If you contribute to your HSA during those 6 months, you may face a 6% excise tax and an income tax for those contributions.
  • This "6-month lookback" starts when you enroll in Medicare or begin your Social Security retirement benefits. However, you can avoid the excise tax if you do the following:
    1. Withdraw your excess contributions by your due date, including extensions, for the year you made them, and
    2. Withdraw any earnings attributed to the withdrawn excess contributions and include the earnings in "other income" on your tax return for the year you withdrew them.

This HSA restriction leads some working past age 65 to defer Medicare and maintain their current employer-based health insurance coverage so they can keep contributing to their HSA until they retire.

Learn more about excess contributions on the IRS website.

Tip: Remember, after you enroll in Medicare, you can use existing funds in your HSA for qualified medical expenses, including your monthly premiums for Parts A, B, C, and D (but not Medigap premiums).


HSAs allow for spending for short-term qualified medical expenses and saving for long-term costs in retirement. If Medicare is in your near future, don't get penalized for making contributions after you're enrolled or when your Medicare coverage begins.

Get help

Looking for help to navigate your health care and retirement needs? Working with a financial professional can help you plan the course that's right for you.

Start a conversation

Already working 1-on-1 with us?
Schedule an appointmentLog In Required

More to explore

Fidelity Medicare Services®

For residents in select states, enroll in the right Medicare plan for you with help from Fidelity Medicare Services®.

With respect to federal taxation only. Contributions, investment earnings, and distributions may or may not be subject to state taxation.

2. For more about qualified medical expenses, the IRS provides detailed information about medical and dental expenses and health savings accounts.

The information provided herein is general in nature. It is not intended, nor should it be construed, as legal or tax advice. Because the administration of an HSA is a taxpayer responsibility, you are strongly encouraged to consult your tax advisor before opening an HSA. You are also encouraged to review information available from the Internal Revenue Service (IRS) for taxpayers, which can be found on the IRS website at You can find IRS Publication 969, Health Savings Accounts and Other Tax-Favored Health Plans, and IRS Publication 502, Medical and Dental Expenses, online, or you can call the IRS to request a copy of each at 800-829-3676.

This information is intended to be educational and is not tailored to the investment needs of any specific investor.

Fidelity Brokerage Services LLC, Member NYSE, SIPC, 900 Salem Street, Smithfield, RI 02917