Skip to content

Medicare and HSA

The interaction between Medicare and a health savings account is that enrolling in any part of Medicare ends your ability to contribute to an HSA, though you can still spend the balance you already have, including on most Medicare premiums.

Last reviewed by Steven Fox, CFP®, EA on

Quick Summary

  • Enrollment in any part of Medicare, even premium-free Part A, drops your HSA contribution limit to zero from that month forward.
  • It is enrollment, not eligibility, that ends contributions, so a 65-year-old still working with employer coverage who has not enrolled can keep contributing.
  • You can always spend existing HSA funds tax-free on qualified medical costs, including Medicare Part A, B, D, and Advantage premiums, but not Medigap.
  • Signing up for Part A or claiming Social Security after 65 backdates Part A up to six months, which can turn recent HSA contributions into excess ones.
  • A common fix is to stop HSA contributions about six months before you enroll in Medicare or claim Social Security.

Definition

Medicare and a health savings account do not coexist for contribution purposes. A health savings account is available only to someone covered by a qualifying high-deductible health plan and not enrolled in other disqualifying coverage, and Internal Revenue Code section 223(b)(7) makes Medicare disqualifying coverage: once you are entitled to or enrolled in any part of Medicare, your allowable HSA contribution for that month and every month after is zero. The account itself does not disappear. You keep it, it keeps growing, and you can spend it tax-free on qualified medical expenses, including many Medicare costs. What ends is the ability to put new money in.

Advanced Explanation

The precise trigger is enrollment, not age and not eligibility. Turning 65 does not by itself end HSA contributions; being enrolled in Medicare does. Section 223(b)(7) reduces the contribution limit to zero for "the first month such individual is entitled to benefits under title XVIII," meaning enrolled in Medicare, and for every month after. So a worker who reaches 65, keeps employer high-deductible coverage, and deliberately delays all parts of Medicare can continue contributing to an HSA. The moment they enroll in even premium-free Part A, contributions must stop.

Spending is unaffected. After Medicare enrollment you can still withdraw HSA funds tax-free for qualified medical expenses, and once you are 65 the account also becomes a flexible retirement resource, because non-medical withdrawals after 65 are taxed as income without the 20% penalty. Notably, HSA funds can pay Medicare premiums, Parts A, B, and D and Medicare Advantage, as qualified expenses. The exception that surprises people is Medigap: premiums for a Medicare supplement policy are not a qualified HSA expense, so paying them from the account is a taxable withdrawal.

The sharpest trap is the six-month retroactivity of Part A. When you enroll in Part A after 65, or claim Social Security, Part A coverage is backdated up to six months, though never earlier than the month you turned 65. Because Medicare enrollment zeros the HSA limit, those retroactive months of coverage retroactively eliminate the contribution room you thought you had. Contributions made in that backdated window become excess contributions, exposed to a 6% excise tax each year they remain. The standard defense is to stop HSA contributions about six months before you plan to enroll in Medicare or file for Social Security, so the backdated coverage lands only on months you did not fund.

When contributions are still allowed, the annual limits are the ordinary HSA figures: $4,400 for self-only coverage and $8,750 for family coverage, plus a $1,000 catch-up for those 55 and older. In the year you enroll mid-year, your limit is prorated to the months before enrollment.

How to Remember

Medicare closes the door on putting money in, but never on taking it out. And because Part A reaches back six months, stop contributing about half a year before you sign up.

Used in a Sentence

“Because Gerald planned to claim Social Security at 66, he stopped his health savings account contributions six months earlier, since Part A would be backdated and any contributions in those months would count as excess.”

How It Works

While you are covered by a qualifying high-deductible plan and not enrolled in Medicare, you contribute normally. When you approach Medicare, you count backward: because enrolling in Part A or claiming Social Security backdates Part A up to six months, you stop contributing roughly six months before that date. After enrollment, you switch from funding the account to spending it, using it tax-free for qualified expenses and Medicare premiums other than Medigap.

A hypothetical example of the retroactivity trap. Nora keeps working past 65 with a high-deductible plan and contributes $300 a month to her HSA. At 66 and 8 months she retires and files for Social Security, which backdates her Part A to six months earlier. Those six months, during which she contributed $1,800, are now Medicare months, so that $1,800 is an excess contribution. If she does not remove it, it faces a 6% excise tax, about $108, for each year it stays in the account. Stopping contributions six months before filing would have avoided the excess entirely.

Pros and Cons

What still works after Medicare

  • The HSA balance remains yours, keeps growing tax-free, and pays qualified medical expenses without tax at any age.
  • HSA funds can cover Medicare Part A, B, and D premiums and Medicare Advantage premiums, a real ongoing use in retirement.
  • After 65, non-medical withdrawals are taxed as income but carry no penalty, so the account doubles as a retirement fund.

The constraints and traps

  • Enrolling in any part of Medicare, including premium-free Part A, permanently ends new HSA contributions.
  • Part A's six-month backdating can turn recent contributions into excess contributions subject to a 6% annual excise tax.
  • Medigap premiums are not a qualified HSA expense, unlike other Medicare premiums.
  • Claiming Social Security at or after 65 forces you into Part A, so it ends HSA eligibility even if you did not intend to enroll in Medicare yet.

People Also Asked

Answers to the most frequently asked questions.

Can I contribute to an HSA if I'm enrolled in Medicare?
No. Enrollment in any part of Medicare, including premium-free Part A, drops your HSA contribution limit to zero for that month and every month after. You can still spend the existing balance tax-free on qualified expenses, but you cannot add new money.
Can I keep contributing to an HSA if I'm 65 and still working?
Yes, if you have qualifying high-deductible coverage and have not enrolled in any part of Medicare. Turning 65 does not end HSA contributions by itself; Medicare enrollment does. Delaying all parts of Medicare while you keep employer coverage preserves your ability to contribute.
Can I use HSA money to pay Medicare premiums?
Yes for most of them. Premiums for Medicare Part A, Part B, Part D, and Medicare Advantage are qualified HSA expenses you can pay tax-free. Medigap premiums are the exception; they are not qualified, so paying them from an HSA is a taxable withdrawal.
Why should I stop HSA contributions before claiming Social Security?
Because claiming Social Security at or after 65 forces you into Part A, and Part A is backdated up to six months. Any HSA contributions made during those backdated months become excess contributions subject to a 6% excise tax. Stopping contributions about six months ahead avoids the problem.

Sources

AdviceOnly maintains high editorial standards to improve the quality and accuracy of our educational content. Content is written with the assistance of artificial intelligence tools following a rigorous quality assurance process, and periodically reviewed by credentialed and experienced human financial advisors. References used include government data, academic papers, interviews with industry experts, and reputable primary sources. You can learn more about our efforts to produce accurate content in our editorial policy.

  1. U.S. Code. "26 U.S.C. § 223 — Health savings accounts."
  2. Internal Revenue Service. "Publication 969, Health Savings Accounts and Other Tax-Favored Health Plans."
  3. Internal Revenue Service. "2026 HSA Contribution Limits," Internal Revenue Bulletin 2025-21.

Have a question a definition can't answer?

Advice-only advisors answer questions like this for a transparent flat fee — no products, no commissions, no asset management.

Find an Advisor