Skip to main content

HSA Rules When You Enroll in Medicare

Understand how enrolling in Medicare changes your HSA contributions, how to spend existing HSA funds, and how to plan around turning 65.

Published on February 18, 2026

Health Savings Accounts provide a highly effective way to set aside money for medical expenses with valuable tax advantages. However, once you sign up for Medicare, the rules governing HSAs shift considerably. If you are nearing age 65 or mapping out your retirement, it is critical to understand how Medicare and HSAs interact so you can avoid tax penalties and get the most from your savings.

Contributing to an HSA Ends When Medicare Begins

The most important rule is simple: once you are enrolled in any part of Medicare — whether Part A, Part B, or Part D — you are no longer eligible to contribute to a Health Savings Account.

This applies even if you are still employed or have a high-deductible health plan (HDHP) through your employer. Enrollment in any component of Medicare disqualifies you from making new HSA contributions.

If you deposit money into an HSA during any month in which you carry Medicare coverage, those deposits are treated as excess contributions by the IRS. Excess contributions are subject to a 6% excise tax for each year they stay in the account. You would need to withdraw the excess amount plus any earnings on it to stop ongoing penalties.

The contribution cutoff works on a monthly basis. You may contribute for any month during which you are not enrolled in Medicare as of the first day of that month.

Your Existing HSA Funds Remain Available

Although you cannot deposit new money into your HSA after enrolling in Medicare, the funds already in your account are still yours and can be spent tax-free on qualified medical expenses. There is no deadline or expiration for using HSA funds.

Qualified medical expenses you can cover with HSA money include:

  • Medicare Part B premiums
  • Medicare Part D premiums
  • Medicare Advantage plan premiums
  • Deductibles, copays, and coinsurance under Medicare
  • Prescription drug costs
  • Dental and vision care
  • Hearing aids
  • Long-term care insurance premiums (up to age-based limits)

One key exclusion: you cannot use HSA funds tax-free to pay Medigap (Medicare Supplement) premiums. The IRS does not classify Medigap premiums as a qualified medical expense.

After age 65, if you withdraw HSA funds for non-medical purposes, the money is subject to ordinary income tax but no longer triggers the 20% penalty that applies before age 65. This effectively makes your HSA function like a traditional IRA for non-medical withdrawals after 65, although spending the funds on qualified medical expenses remains the most tax-efficient option.

Paying Medicare Costs With Your HSA

Using your HSA to cover Medicare-related expenses is one of the smartest strategies in retirement. Many beneficiaries build up substantial HSA balances during their working years specifically to offset health care costs later on.

Consider a practical scenario. If your monthly expenses include a Part B premium of $203.90, a Part D premium of $30, and average monthly out-of-pocket costs of $100, that adds up to $4,007 per year. An HSA balance of $40,000 could cover those expenses tax-free for more than a decade.

Because HSA withdrawals for qualified medical expenses are excluded from your taxable income, using HSA funds for Medicare costs also helps keep your modified adjusted gross income (MAGI) lower. This can be advantageous for managing IRMAA surcharges and controlling other income-dependent costs.

Timing Decisions Around Age 65

If you are approaching 65, the overlap between HSA rules and Medicare enrollment demands careful timing. Here are the key factors:

If you intend to keep working past 65 and carry an HDHP through your employer, you may opt to postpone Medicare enrollment and continue contributing to your HSA. This is permitted as long as you are covered by an employer group health plan and do not sign up for any part of Medicare. Be aware, however, that if your employer has fewer than 20 employees, Medicare may become your primary payer regardless, and delaying may not be practical.

If you plan to retire at 65 or shortly after, consider maximizing your HSA contributions in the years leading up to Medicare enrollment. The 2026 contribution limits are $4,400 for individual coverage and $8,750 for family coverage, plus an additional $1,000 catch-up contribution for those 55 and older. Maximizing contributions in your final working years builds a larger tax-free medical fund.

Halt contributions before Medicare kicks in. If you know you will enroll in Medicare in July, for example, you should stop HSA contributions no later than June. Coordinate with your employer's benefits department to adjust payroll deductions ahead of time.

The Retroactive Part A Enrollment Pitfall

One of the most frequent and expensive mistakes involves the retroactive enrollment feature of Medicare Part A. When you sign up for Part A after age 65, your coverage can be backdated by up to six months (but not before the month you turned 65).

This is significant for HSA contributors because retroactive Part A enrollment means you were technically covered by Medicare during those earlier months. Any HSA contributions made during that retroactive window become excess contributions, triggering the 6% excise tax.

For example, if you enroll in Part A in October and it is backdated to April, any HSA contributions you made from April through October are excess contributions. You would need to withdraw those amounts and report the correction on your tax return.

To steer clear of this pitfall:

  • Plan your Medicare enrollment date with care. If you want to contribute to your HSA through a specific month, confirm that your Part A enrollment will not be retroactively applied to that period.
  • Consider halting HSA contributions six months before your planned Part A enrollment. This creates a cushion against the maximum retroactive window.
  • Speak with Social Security before enrolling. You can ask about the effective date of your Part A coverage to prevent surprises.

If you are receiving Social Security retirement benefits, keep in mind that you are automatically enrolled in Part A. This means that once you start collecting Social Security, your HSA contribution eligibility ends right away.

Getting the Most From Your HSA in Retirement

The HSA remains one of the most tax-efficient accounts available, even after you can no longer make contributions. To maximize its value alongside Medicare, maintain records of all qualified medical expenses, draw on HSA funds strategically to manage taxable income, and consider letting the account grow through investments if you have other resources to cover current medical costs. A well-managed HSA can serve as a valuable supplement to your Medicare coverage for many years into retirement.

This content is for educational purposes only and does not constitute a recommendation of any specific Medicare plan. Benefits, costs, and availability vary by plan and location. For complete information about your Medicare options, visit Medicare.gov or call 1-800-MEDICARE (1-800-633-4227), TTY: 1-877-486-2048, available 24 hours a day, 7 days a week.