Medicare and HSA
May 20, 2026
Enrolling in Medicare and contributing to a Health Savings Account (HSA) do not mix. An HSA is a tax-advantaged savings account available only to people enrolled in a qualifying high-deductible health plan (HDHP) who have no other health coverage, and Medicare counts as other coverage under federal tax rules. Once Medicare Part A takes effect, typically the hospital insurance portion of Medicare, you must stop making new HSA contributions, even if you keep your HDHP. The timing matters because Part A enrollment can be applied retroactively for up to six months if you sign up for Social Security after age 65. Understanding how Medicare and HSA rules interact before you turn 65 can help you avoid an unplanned tax penalty on contributions made after your coverage technically began.
Quick Answer
You cannot contribute to an HSA once any part of Medicare, typically Part A, is in effect. If you enroll in Social Security after age 65, Medicare backdates Part A coverage by up to six months, and any HSA contributions made during those backdated months become excess contributions subject to IRS penalties. To keep contributing to an HSA past 65, you generally need to delay both Social Security and Medicare Part A enrollment. Existing HSA balances remain tax-free for qualified medical expenses, including many Medicare premiums, at any age.
HSA eligibility depends on three conditions: you must be covered by a qualifying HDHP, you must have no other health coverage, and you must not be enrolled in Medicare. According to IRS Publication 969, an individual who is entitled to Medicare benefits is not an eligible individual for HSA contribution purposes, even if they also carry an HDHP through an employer or the marketplace.
This rule applies once Part A coverage begins, not only Part B. Some people delay Medicare Part B because they have coverage through an employer, but if Part A has already started, HSA eligibility still ends. The only way to remain HSA-eligible is to delay Medicare entirely, including Part A, which usually means also delaying Social Security retirement benefits.
Important
If you claim Social Security retirement benefits after age 65, Medicare Part A coverage is backdated up to six months, but never earlier than your 65th birthday. Any HSA contributions made during that backdated window count as excess contributions and can trigger an IRS excise tax.
The backdating rule catches many retirees off guard. For example, someone who files for Social Security at age 66 could have Medicare Part A coverage applied retroactively to age 65 and six months. Any HSA contributions made in those six months, even though the person had not yet enrolled in Medicare on paper, become excess contributions once the retroactive coverage is applied.
Excess HSA contributions are generally subject to a 6% excise tax for each year they remain in the account, unless they are withdrawn before the tax filing deadline. According to the Social Security Administration, Medicare Part A enrollment ties directly to when you file for Social Security retirement benefits, so if you are mapping out your Medicare enrollment timeline around age 65, factor this look-back period into the date you stop HSA contributions, not just your expected Part A start date.
Action Checklist
- Confirm the exact month your Medicare Part A coverage will start before making further HSA contributions
- Stop HSA contributions at least 6 months before filing for Social Security after age 65, or by the month you file, whichever is earlier
- If you want to keep contributing to an HSA past 65, delay both Social Security and Medicare Part A enrollment
- Review IRS Form 8889 and Form 5329 if contributions were made during a backdated Part A period
- Keep records of your HSA contribution stop date in case the IRS requests documentation
Advantages
- Continued HSA contributions and the associated tax deduction
- More tax-free savings available for future medical and Medicare costs
- Avoids excess-contribution penalties tied to backdated Part A coverage
Considerations
- Delaying Social Security to delay Part A also delays the start of retirement benefit payments
- Without other qualifying coverage, such as active employer group health coverage, delaying enrollment can expose you to a Medicare late enrollment penalty
- HSA funds cannot be used to pay Medicare premiums until you actually enroll
Money already sitting in an HSA remains tax-free for qualified medical expenses at any age, even after Medicare starts. After 65, the list of qualified expenses expands to include several Medicare costs:
- Medicare Part B premiums
- Medicare Part D premiums
- Medicare Advantage premiums
- Deductibles, copays, and coinsurance, including costs that count toward your plan's out-of-pocket maximum
- Most other qualified medical expenses
Medigap (Medicare Supplement) premiums are not a qualified HSA expense. Withdrawals for non-medical expenses after 65 are taxed as ordinary income but are not subject to the 20% early withdrawal penalty that applies before age 65. If you are weighing whether to delay enrollment altogether, review how a Medicare late enrollment penalty could offset any HSA savings before you decide.
Key Takeaway
If you want to keep contributing to an HSA after 65, you need to delay Medicare Part A, not just Part B, and that usually means delaying Social Security too. Otherwise, stop contributions the month before Part A begins to avoid excess-contribution penalties.
Helpful next step
See the full 7-month window for enrolling in Medicare around your 65th birthday.
Learn More
Get plain-language guidance on timing Medicare enrollment around your HSA, with no high-pressure sales.